Difference: CommunicatingOverMQTT (4 vs. 5)

Revision 52019-06-16 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="AFNOGWorkshop2019"

Communicating over MQTT

Line: 33 to 33
  https://afnog.iotworkshop.africa/pub/AFNOG/CommunicatingOverMQTT/clientPublic.py.txt
Added:
>
>
As you can observe by studying the begin method of the CayenneMQTTClient class that default values for ssid and wifiPassword are used, which correspond to the WiFi ssid and password we had during the tutorial in the classroom. In the Cayenne example programs the begin method is called without these parameters. If you want to run these programs with your own WiFi network, you will have to pass these two parameters ssid="Your SSID" and wifiPassword="Your WiFi password" thus overriding the default.

The method call will therefore be changed from:

client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID, loglevel=logging.INFO) to

client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID, ssid="Your SSID", wifPassword="Your Wifi paddword", loglevel=logging.INFO)

 https://afnog.iotworkshop.africa/pub/AFNOG/CommunicatingOverMQTT/__init__.py.txt

https://afnog.iotworkshop.africa/pub/AFNOG/CommunicatingOverMQTT/ledControlPublic.py.txt

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback