indoor location sensor (BLE scan + RSSI to MQTT publishing)
Posted: Tue May 09, 2017 12:54 pm
I am currently trying my first little project with ESP32 devkit-c and i am running into a multitude of trial-and-error aspects.
What I want to do is this:
(1) make esp32 connect to wifi access point, get IP
(2) connect to an mqtt broker and subscribe to a topic to receive commands
(3) run this loop:
- start BLE scan to scan for BLE device announcements and get the RSSI of the received signal
- send this id (xx:xx:xx:xx + RSSI) to a specific MQTT topic for each found device
(4) keep the loop running and constantly scan for devices - everytime its found the information is sent again to the mqtt topic
(5) on a separate machine/pc the mqtt topic messages are consumed and used to (with knowledge of the location of the esp32 in the house) calculate estimated locations of the devices measured - and moreso, with enough ESP32 also the movement inside the house.
So it will end up with something like this on the mqtt topic:
/location/device_scan/63537dd710ac -74
/location/device_scan/6fd0d06583d0 -68
/location/device_scan/8863dfc2a182 -71
/location/device_scan/55da923818d1 -77
/location/device_scan/62c54c174775 -90
..
..
..
My first tries implementing this can be found here:
https://github.com/bietiekay/hcs-esp32- ... ensor-node
But its constantly crashing and overall behaving erratically. I would really appreciate any help possible to get this stable running and just doing the above job.
Daniel
What I want to do is this:
(1) make esp32 connect to wifi access point, get IP
(2) connect to an mqtt broker and subscribe to a topic to receive commands
(3) run this loop:
- start BLE scan to scan for BLE device announcements and get the RSSI of the received signal
- send this id (xx:xx:xx:xx + RSSI) to a specific MQTT topic for each found device
(4) keep the loop running and constantly scan for devices - everytime its found the information is sent again to the mqtt topic
(5) on a separate machine/pc the mqtt topic messages are consumed and used to (with knowledge of the location of the esp32 in the house) calculate estimated locations of the devices measured - and moreso, with enough ESP32 also the movement inside the house.
So it will end up with something like this on the mqtt topic:
/location/device_scan/63537dd710ac -74
/location/device_scan/6fd0d06583d0 -68
/location/device_scan/8863dfc2a182 -71
/location/device_scan/55da923818d1 -77
/location/device_scan/62c54c174775 -90
..
..
..
My first tries implementing this can be found here:
https://github.com/bietiekay/hcs-esp32- ... ensor-node
But its constantly crashing and overall behaving erratically. I would really appreciate any help possible to get this stable running and just doing the above job.
Daniel