Changes between Version 7 and Version 8 of nodered
- Timestamp:
- 12/17/2021 11:57:39 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
nodered
v7 v8 63 63 * This demo takes an incoming MQTT message from a client and just prints it out in the debug screen. 64 64 * Use the MQTT input module connected to a debug module ti replicate what is shown in the picture below. 65 [[Image(nodered .png,600px)]]65 [[Image(nodered2.png,600px)]] 66 66 67 67 = Create a Client on Gateworks SBC … … 80 80 The below is a sample python script to pass MQTT messages from the Gateworks SBC to the Node-Red server (broker). The script will pass the Gateworks SBC temperature as the payload and send it specific to the device's serial number. 81 81 82 Running the script on the client: 83 {{{ 84 root@focal-venice:~# python gateworks.py 85 852420 86 Connected with result code {'session present': 0} 87 in loop 88 done publishing 89 ('message received ', '50.4') 90 ('message topic=', u'gateways/id/852420') 91 ('message qos=', 0) 92 ('message retain flag=', 0) 93 in loop 94 done publishing 95 ('message received ', '50.5') 96 ('message topic=', u'gateways/id/852420') 97 ('message qos=', 0) 98 ('message retain flag=', 0) 99 100 }}} 101 102 Script source code: 82 103 {{{ 83 104 # Compatible with python 2.* version … … 106 127 client.on_connect = on_connect 107 128 client.on_message = on_message 108 broker = "1 72.24.33.93"129 broker = "122.24.33.93" 109 130 client.connect(broker) 110 131 client.loop_start()