Omega Onion2 put value on Cayenne MQTT Dashboard

I can send message from my Omega Onion2 by using mosquitto.

install mosquitto by typing in Omega Onion2 terminal
opkg update
opkg install mosquitto mosquitto-client libmosquitto

Use this command to publish on Cayenne Dashboard a message

mosquito_pub -h mqtt.mydevices.com -i “client_id” -u “username” -P “password” -t v1//things//data/1 -m “message”

You can substitute “client_id” “username” and “password”. After you can put a value on “message” field

You also can create a python program that send a value for 5 times:
import time
from subprocess import call

while True:
try:
for i in range(0,5):
call('mosquito_pub -h mqtt.mydevices.com -i “client_id” -u “username” -P “password” -t v1//things//data/1 -m '+ str(i), shell=True)
print(“sended”)
time.sleep(5)

except (EOFError, SystemExit, KeyboardInterrupt):
sys.exit()

1 Like

If now omega can run mosquitto is soo good :smiley:
I will made a nodejs way to connect to cayenne

1 Like