Jump to content

Modbus and Bluetooth data sending to Node-RED: Difference between revisions

Line 176: Line 176:
Add new request and adjust settings according to your needs. For this example, we are going to pull device name from the registers, so our configuration looks like this:
Add new request and adjust settings according to your needs. For this example, we are going to pull device name from the registers, so our configuration looks like this:


*'''Name''': test (input any preferred name)
# '''Name''': test (input any preferred name)
*'''Data type''': ASCII (to get a string of text)
# '''Data type''': ASCII (to get a string of text)
*'''Function''': Read holding registers (3)
# '''Function''': Read holding registers (3)
*'''First register number''': 72
# '''First register number''': 72
*'''Register count/values''': 3
# '''Register count/values''': 3
*'''Brackets''': use brackets
# '''Brackets''': use brackets
*Press enable to enable the Modbus request


[[File:Tcp master nodered.png|border|1000px|class=tlt-border]]
Press enable to enable the Modbus request
 
[[File:Tcp master nodered.png|border|1050px|class=tlt-border]]


----
----
Line 190: Line 191:
To finish up the device configuration, navigate to '''Services -> Data to server.''' Add new data sender and configure settings accordingly:
To finish up the device configuration, navigate to '''Services -> Data to server.''' Add new data sender and configure settings accordingly:


*'''Enable''': on
# '''Enable''': on
*'''Name''': Data_to_node (input any preferred name)
# '''Name''': Data_to_node (input any preferred name)
*'''Data source''': MODBUS data
# '''Data source''': MODBUS data
*'''Protocol''': MQTT
# '''Protocol''': MQTT
*'''JSON format''': {"Router name": %a} - adjust this according to your needs
# '''JSON format''': {"Router name": %a} - adjust this according to your needs
*'''Segment count''': All
# '''URL/Host/Connection string''': 192.168.10.139 (virtual machine address)
*'''URL/Host/Connection string''': 192.168.10.139 (virtual machine address)
# '''Port''': 1883
*'''Port''': 1883
# '''Topic''': rutx (input any preferred topic, make sure to subscribe on the same topic)
*'''Keepalive''': 60
*'''Topic''': rutx (input any preferred topic, make sure to subscribe on the same topic)


[[File:Data sender settings to node red with node red broker.png|border|1000px|class=tlt-border]]
[[File:Data sender settings to node red with node red broker.png|border|1000px|class=tlt-border]]