"snap, gobble and pop"
An IoT project written in Go for BLE devices, to be distributed as a Snap.
Uses:
The Snap binary currently exists in this repo. It will be added to the Snap Store once it is past proof-of-concept stage.
Current iteration is proof-of-concept. When activated, it scans for all BLE devices, packages info found about devices as JSON, then sends that JSON out as MQTT.
- Clone this git repo.
- Navigate to /snap/ directory within repo.
- Enter:
sudo snap install --devmode snap-goble-and-pop_0.2_amd64.snap
- Make sure /snap/bin/ exists in your $PATH
- Make sure you have a BLE device attached to your system
- Enter:
sudo snap-goble-and-pop
- The snap connects to an unencrypted broker on localhost port 1883 running TCP (default "tcp://127.0.0.1:1883"). This can be changed by passing the
-broker
flag to the snap. - The snap scans for a duration of five seconds (default 5s). This can be changed by passing the
-du
flag. - The snap publishes to MQTT topic ble/test (default "ble/test"). This can be changed by passing the
-topic
flag.
A complete list of flags can be generated by passing the --help flag.
- Run an MQTT broker such as Mosquitto on the local machine.
- Point an MQTT client to the broker and subscribe to the topic. For example, if using mosquitto.sub, enter:
mosquitto.sub -h 127.0.0.1 -p 1883 -t ble/#
.
Plan is to develop a modular thermostat using BLE thermometers, a central controller, and relays, IR blasters, and device APIs to control window air conditioners and plug-in heaters.
- Add security configurations to snap so snap can connect to AWS for example.
- Target known BLE devices and pass only relevant information.