Changes

Line 18: Line 18:  
There are a couple of different use cases with Node-RED and Teltonika devices:
 
There are a couple of different use cases with Node-RED and Teltonika devices:
   −
# [[Draft:Nodered#MQTT_Gateway | MQTT gateway using either Node-RED or Teltonika device as MQTT broker.]]
+
# [[Modbus_and_Bluetooth_data_sending_to_Node-RED#MQTT_Gateway | MQTT gateway using either Node-RED or Teltonika device as MQTT broker.]]
# [[Draft:Nodered#Modbus_Data_to_Server_via_MQTT_protocol | Modbus data to server using either Node-RED or Teltonika device as MQTT broker.]]
+
# [[Modbus_and_Bluetooth_data_sending_to_Node-RED#Modbus_Data_to_Server_via_MQTT_protocol | Modbus data to server using either Node-RED or Teltonika device as MQTT broker.]]
# [[Draft:Nodered#Bluetooth_Data_to_Server_via_MQTT_protocol | Bluetooth data to server using Teltonika device as MQTT broker.]]
+
# [[Modbus_and_Bluetooth_data_sending_to_Node-RED#Bluetooth_Data_to_Server_via_MQTT_protocol | Bluetooth data to Node-RED server.]]
# [[Draft:Nodered#Modbus_Data_to_Server_via_HTTP_protocol | HTTP data to Node-RED server.]]
+
# [[Modbus_and_Bluetooth_data_sending_to_Node-RED#Modbus_Data_to_Server_via_HTTP_protocol | HTTP data to Node-RED server.]]
# [[Draft:Nodered#MQTT_gateway_using_MQTT_explorer_and_Node-RED_broker | MQTT gateway using MQTT Explorer.]]
      
==Node-RED installation and setup==
 
==Node-RED installation and setup==
Line 54: Line 53:  
==MQTT Gateway==
 
==MQTT Gateway==
   −
MQTT Gateway allows to query the device from MQTT Clients, in this section we will configure it to work with the Node-RED. Here is connection topology to help you understand things better:
+
MQTT Gateway allows to query the device from MQTT Clients, in this section we will configure it to work with the Node-RED.  
 
  −
[[File:Nodered configurationexample topo1.png|border|600px|class=tlt-border]]
      
===Using Teltonika device as an MQTT broker===
 
===Using Teltonika device as an MQTT broker===
 
----
 
----
 +
 +
Here is connection topology for this use case:
 +
 +
[[File:Nodered configurationexample topo5gw.png|border|700px|class=tlt-border]]
 +
 
Router setup when using the router as a broker consists of two parts. First, we are going to set up a local broker. In order to do so, navigate to '''Services -> MQTT -> Broker''' and enable the broker.
 
Router setup when using the router as a broker consists of two parts. First, we are going to set up a local broker. In order to do so, navigate to '''Services -> MQTT -> Broker''' and enable the broker.
   Line 138: Line 140:  
===Using Node-RED as an MQTT broker===
 
===Using Node-RED as an MQTT broker===
 
----
 
----
 +
 +
Here we are using Node-RED as MQTT Broker, so we are going to do necessary changes in order for this functionality to work.
 +
 +
Here is the connection topology for this use case:
 +
 +
[[File:Nodered configurationexample topo1.png|border|700px|class=tlt-border]]
 +
 
====Adjusting Node-RED configuration====
 
====Adjusting Node-RED configuration====
   Line 155: Line 164:     
To test the configuration, '''deploy''' the nodes again and send the message by clicking on the '''inject''' node.
 
To test the configuration, '''deploy''' the nodes again and send the message by clicking on the '''inject''' node.
 +
 +
===MQTT gateway using MQTT explorer and Node-RED broker===
 +
----
 +
In this example, we are going to use the same Node-RED broker configured in previous parts of this article, only this time we are going to use [http://mqtt-explorer.com/ MQTT Explorer] app to Publish and Subscribe to Modbus data.
 +
 +
Here's connection topology for this use case:
 +
 +
[[File:Nodered configurationexample topo6.png|border|800px|class=tlt-border]]
 +
 +
====Device setup====
 +
----
 +
Navigate to '''Services -> Modbus -> MQTT Gateway'''. Follow these steps for the configuration:
 +
# '''Enable''': on
 +
# '''Host''': input '''192.168.10.139''', or if you would like to use local broker on the device - input '''127.0.0.1'''
 +
Leave everything else as default, or adjust according to your needs
 +
 +
[[File:MQTT gateway settings node red local router.png|border|500px|class=tlt-border]]
 +
 +
====MQTT explorer setup and testing====
 +
----
 +
Open MQTT Explorer application and in the default screen input the '''Host IP (1)'''  of MQTT Broker, then press '''Connect (2)'''.
 +
 +
[[File:Mqtt explorer server connection to broker example.png|border|600px|class=tlt-border]]
 +
 +
Once done, locate Publish section on the right side. You can use the same settings as in previous sections of MQTT Gateway:
 +
 +
# '''Topic:''' request
 +
# '''Data:''' 0 65432 0 192.168.10.1 502 5 1 3 6 2
 +
 +
[[File:Publish from mqtt explorer node red example.png|border|500px|class=tlt-border]]
 +
 +
If everything is set up correctly, then you should be able to see response from the router:
 +
 +
[[File:Mqtt explorer response from router.png|border|400px|class=tlt-border]]
    
==Modbus Data to Server via MQTT protocol==
 
==Modbus Data to Server via MQTT protocol==
Line 162: Line 205:  
Here's connection topology for this use case:
 
Here's connection topology for this use case:
   −
[[File:Nodered configurationexample topo2.png|700px|class=tlt-border]]
+
[[File:Nodered configurationexample topo2.png|850px|class=tlt-border]]
    
===Device configuration===
 
===Device configuration===
Line 206: Line 249:  
# '''Topic''': rutx (input any preferred topic, make sure to subscribe on the same topic)
 
# '''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|800px|class=tlt-border]]
    
===Node-RED setup===
 
===Node-RED setup===
Line 235: Line 278:  
Here's connection topology for this use case:
 
Here's connection topology for this use case:
   −
[[File:Nodered configurationexample topo3.png|border|700px|class=tlt-border]]
+
[[File:Nodered configurationexample topo3.png|border|800px|class=tlt-border]]
    
===Device configuration===
 
===Device configuration===
Line 254: Line 297:  
# '''Topic''': beacon (input any preferred topic, make sure to subscribe on the same topic)
 
# '''Topic''': beacon (input any preferred topic, make sure to subscribe on the same topic)
   −
[[File:Bluetooth data sender settings rutx11.png|border|600px|class=tlt-border]]
+
[[File:Bluetooth data sender settings rutx11.png|border|800px|class=tlt-border]]
    
===Node-RED setup===
 
===Node-RED setup===
Line 268: Line 311:  
Here's connection topology for this use case:
 
Here's connection topology for this use case:
   −
[[File:Nodered configurationexample topo4.png|border|700px|class=tlt-border]]
+
[[File:Nodered configurationexample topo4.png|border|800px|class=tlt-border]]
    
===Device configuration===
 
===Device configuration===
Line 300: Line 343:     
[[File:Nodered configurationexample httpData incoming v1.png|border|400px|class=tlt-border]]
 
[[File:Nodered configurationexample httpData incoming v1.png|border|400px|class=tlt-border]]
  −
==MQTT gateway using MQTT explorer and Node-RED broker==
  −
  −
In this example, we are going to use the same Node-RED broker configured in previous parts of this article, only this time we are going to use [http://mqtt-explorer.com/ MQTT Explorer] app to Publish and Subscribe to Modbus data.
  −
  −
Here's connection topology for this use case:
  −
  −
[[File:Nodered configurationexample topo6.png|border|700px|class=tlt-border]]
  −
  −
===Device setup===
  −
----
  −
Navigate to '''Services -> Modbus -> MQTT Gateway'''. Follow these steps for the configuration:
  −
# '''Enable''': on
  −
# '''Host''': input '''192.168.10.139''', or if you would like to use local broker on the device - input '''127.0.0.1'''
  −
Leave everything else as default, or adjust according to your needs
  −
  −
[[File:MQTT gateway settings node red local router.png|border|500px|class=tlt-border]]
  −
  −
===MQTT explorer setup and testing===
  −
----
  −
Open MQTT Explorer application and in the default screen input the '''Host IP (1)'''  of MQTT Broker, then press '''Connect (2)'''.
  −
  −
[[File:Mqtt explorer server connection to broker example.png|border|600px|class=tlt-border]]
  −
  −
Once done, locate Publish section on the right side. You can use the same settings as in previous sections of MQTT Gateway:
  −
  −
# '''Topic:''' request
  −
# '''Data:''' 0 65432 0 192.168.10.1 502 5 1 3 6 2
  −
  −
[[File:Publish from mqtt explorer node red example.png|border|500px|class=tlt-border]]
  −
  −
If everything is set up correctly, then you should be able to see response from the router:
  −
  −
[[File:Mqtt explorer response from router.png|border|400px|class=tlt-border]]
      
==Summary==
 
==Summary==