Ressources informatiques

Ressources informatiques

Ressources informatiques

Publier un topic MQTT

Installer le client mosquitto

root@Omega-264F:~# opkg update
root@Omega-264F:~# opkg install  mosquitto-client libmosquitto
Installing mosquitto-client-nossl (1.4.15-1) to root...
Downloading http://repo.onion.io/omega2/packages/packages/mosquitto-client-nossl_1.4.15-1_mipsel_24kc.ipk
Installing libmosquitto-nossl (1.4.15-1) to root...
Downloading http://repo.onion.io/omega2/packages/packages/libmosquitto-nossl_1.4.15-1_mipsel_24kc.ipk
Configuring libmosquitto-nossl.
Configuring mosquitto-client-nossl.

Publier un topic

root@Omega-264F:~# mosquitto_pub -h 192.168.1.11 -u user1 -P IOTPasswd -t 'Omega-2
64f/temperature' -m 20

Résultat obtenu :

pi@rpi1:~ $ mosquitto_sub -h localhost -u user1 -P IOTPasswd -t 'Omega-264F/temperature'
20