Non-connected star IoT
What is the simplest possible home IoT architecture we can build?
See MyIoT for a little more elaborate attempt.
Topology
sensor <-> gateway -> MQTT server <-> sensor controller
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.
Sample applications
A simple semi-generic hardware could be used for a number of applications.
- Environment sensor (temperature, humidity) sensor e.g. STS4L or any other sensor. May be used to monitor your house and office.
- Bicycle odometer using a simple Hall effect sensor
- Wireless button interaction
- Door/window sensor
Applications that also require server responses may be
- Control of a single relay for
- Lighting control
- Garage port
- Heating control
A semi-generic kit with the following items could be provided
- Cable for Segger EDU
- Segger EDU (resale)
- PCB with coincell, BLE module, debug port and I2C/SPI port
- Main USP is power consumption
- Existing alternatives
- nRF dongle requires cutting access to USB and adding debug port
- XIAO BLE requires TBD
- BLE gateways
- Build your own using a PoE Ethernet bridge and nRF chipset PP-W5500-POE
- Minew Nova GW - where wifi can be provisioned via BluFi
- Minew G1 - $65