Skip to content

abadar05/ble-sensor-to-mqtt-broker

Repository files navigation

ble-mqtt-connector

Connect BLE sensors to local Mosquitto MQTT Broker. Current implementation read BLE beacons in disconnected mode that means sensors do not need to connect to BLE controller all the time. The following BLE sensor essentim SPOT is integrated. In principle the source code can recieve ble sensor data from any other ble sensors as well. https://essentim.com/en/essentim-sensors

image

Prequisites:

  • Local MQTT Broker running as docker container or systemd service
    • sudo apt-get install mosquitto
    • sudo systemctl status mosquitto

Deploy container via CLI:

  • The --cpus= option specify how much of the available CPU resources a container can use. Example the following command limit the container at most 10% of the CPU every second.

  • The --memory= option specify maximum amount of memory the container can use. If you set this option, the minimum allowed value is 6m (6 megabytes).

sudo docker run -d \
 --net=host \
 --name bluetooth --privileged \
 --cpus=".1" --memory="20m" \
 --restart=always \
 --log-driver json-file amjadbadar05/mx-ble-mqtt:0.0.4-armhf --ipv4="127.0.0.1"
 

Deploy container via docker-compose:

 docker-compose up
  • OUTPUT As you can see bluetooth application is connected successfully to local mosquitto broker image

  • Verify conatiner is running image

  • Verify container logs

  • sudo docker container logs bluetooth image

start an interactive bash shell inside your running container in order to change the configuration

sudo docker exec -it bluetooth "bash"

image

Payload

image

About

Connect BLE sensors to Mosquitto Broker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages