Non-connected star IoT
What is the simplest possible home IoT architecture we can build?
See MyIoT for a little more elaborate attempt.
Messages
From sensor
Update: #MyIoT, ID, data
From server
Response: #MyIoT, ID, data
- Sensor update with #MyIoT tag will be seen as add device request
- Server response will trigger on any update message
- Sensors must check for possible responses directly after sent message
Sample interactions
Sync clock
- Sensor update: ID, my time
If sensor time is not updated respond with current time
- Server response: ID, current time
TODO: How to avoid delay between server time and response time
Upload trip meter data
- Sensor update: ID, current trip meter, max speed
If server can respond a request for more data can be responded
- Server response: ID, get annual stats
Client rotates data updates for some time
- Sensor update: ID, month, stats
- Sensor update: ID, month, stats
- Sensor update: ID, month, stats
...
Architecture
Possibly we could make a simple architecture using MQTT.
- BLE gateway(s) must have direct access to a single MQTT server e.g. ESP32 based
- Possibly two way communication can be done using
ADV_SCAN_IND, SCAN_REQ, SCAN_RSPmessages- Its called Active Scanning
SCAN_REQ,SCAN_REQshould come within 10 ms- See Experimental Evaluation of Advertisement-Based Bluetooth Low Energy Communication and Advertising Process
- Timing is explained in Anti-Collision Adaptations of BLE Active Scanning for Dense IoT Tracking Applications and BLE in the Real World
- Inter frame spacing 150 us
- Channel switching delay 274 us
- One way communication can use
ADV_NONCONN_IND - ESP32 device discovery
- BLE package formats
- Possibly two way communication can be done using
- All sensor updates are sent as
update/idtopics - All responses are sent as
response/idtopics
Latest responses are kept in memory and updated for all id's that have been spotted so messages can be responed to sensors quickly.
Sensor interaction is handled by small pub/sub script clients on MQTT.