FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,336 views 1 comments
by anonymous

Hello!

I am configuring the RUT955 (FW version: RUT9XX_R_00.06.08.3) to work as a MQTT gateway between a Solar Inverter (Modbus data) and a MQTT broker.


I have run into several issues trying to figure this out. I tried setting up different topologies according to this manual: https://community.teltonika-networks.com/?qa=blob&qa_blobid=4208100263841122966 
 

In the 1st example I set up 2 RUT955 routers as slave, master/gateway and broker. I successfully set up Slave/Master. When configuring the Flespi.io broker to the gateway I am unable to connect them together. Flespi settings say that the password is supposed to be left blank, but RUT requires either UN+PW or none at all. As an alternative, Flespi instructs to connect instead with Token ID as username and Token itself as PW, but this does not seem to work aswell. (Works only with ASC token). Tried with and without "FlespiToken_" infront of the Token code, does not connect. Tried with ports 443, 1883, 80 and 8883. 
When inside MQTT board I subscribe to topics "respond" and publish to "request". When I publish a request with a correct message format, no response comes from Subscribe tab... 
I assume the issue might be in connecting Gateway to Flespi, because the login procedure is messy.

After countless tries I moved on to the 2nd topology.
 

In the 2nd example I connect 3 RUT routers together as instructed in the manual. First is configured as Master/Gateway, 2nd is slave and 3rd is the Broker. I connect these all with different IP addresses (master IP ending .1 - slave .2 and broker .3) and control them through master router using Port Forwarding. Connecting all with LAN. 

Configured Slave/Master as before. Test worked.

Configured MQTT broker to listen port 1883.  I subscribe to the broker topic "respond" and publish to "request". I do not get a response.
Format I am using: mosquito_pub -h [Host] -h [Host_address] -p [Port] -m [‘Message’] -t [Topic] and "0 65432 0 192.168.1.2 502 5 1 3 2 2" as payload message.

(Also tried with Bridge/Publisher enabled. When I do, I see in Terminal window that 192.168.1.3 - RUT MQTT broker is connecting as client. As I understand bridge is necessary to pass on data from Gateway to Mosquitto Broker?) I enter my PC IP there.)

It seems to me that the MQTT gateway is not working since it is not passing the request along to the Master>Slave...

Can someone give suggestions how I can get this running?

Overall, my end goal is to use MQTT gateway to exchange/push the parameters of a solar inverter (status/voltage/power..) to the Broker and to be able to read this data as different Topics from the brokers side.  Is this even possible? Considering that the gateway needs to be receiving individual request messages from the broker... I would like to have real-time data pushed from the inverter through MQTT. 

Any help is greatly appreciated,
If my configuration is unsuitable then feel free to requests alternatives.

Kind Regards
Boris

by anonymous

Hi Boris

I would suggest you look at using a groov RIO unit - it has all the Modbus connectivity and security embedded and MQTT works with several brokers...connect the ethernet port of the RUT955 to one of the ethernet ports of the RIO and use the RUT955 purely as an industrial cellular router. (You could actually use any of the cellular routers in the Teltonika range...like the RUT240).

The groov RIO modules are cost-effective and designed for IIoT edge computing, and the RUT's are very good industrial cellular routers for communication...don't try and do all in one box...stay modular... less headaches...

1 Answer

0 votes
by anonymous

I read many people trying to do this and having no success, only suggestions to use "Alarms" to trigger changes

Turns out it was the "Modbus Data to Server" function that we were was looking for. <

Here is a guide that helped me:
How can I get Modbus data on the local or a remote MQTT broker (innon.com)