Skip to content

sheffieldhackspace/hackspace-sensing-mqtt-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sensing MQTT Listener

Listens to MQTT messages like this:

SHHNoT/environment/room-d/sensor_ESP8266-SCD40-1/humidity 60.735
# i.e.,
SHHNoT/environment/<location>/<sensor_id>/<measurement> <value>

…and sends them to InfluxDB via the HTTP API

test MQTT

listen to MQTT messages with a command like

# listen to all messages
mosquitto_sub -h mosquitto.shhm.uk -t '#' -v
# listen to only environment messages
mosquitto_sub -h mosquitto.shhm.uk -t 'SHHNoT/environment/#' -v
# ignore messages before subscription ("retained" messages)
mosquitto_sub -R -h mosquitto.shhm.uk -t 'SHHNoT/environment/#' -v

install

# ssh key for git interaction
mkdir -p /usr/shhm/.ssh/
ssh-keygen -f /usr/shhm/.ssh/mqtt-deploy-key
export GIT_SSH_COMMAND="ssh -i /usr/shhm/.ssh/mqtt-deploy-key"
# clone
git clone … /usr/shhm/mqtt
cd /usr/shhm/mqtt
# enable systemd service to run in background
sudo cp mqtt-to-influx.service /etc/systemd/system/mqtt-to-influx.service
sudo systemctl enable mqtt-to-influx.service
sudo systemctl start mqtt-to-influx.service
sudo systemctl status mqtt-to-influx.service

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages