I'm trying to set up my Raspberry Pi to read data from a PLC over Modbus TCP and sending this data over to cloud using MQTT. Now, I'm able to read the data from PLC and send the same to the cloud using MQTT separately. However, when I try to do both the things i.e. reading data over MB and sending over MQTT, it doesn't work. Could anyone help me with this, please?
Here's a configuration of my setup:
- PLC (192.168.0.113)- MB TCP Slave
- RP Ethernet (192.168.0.120) - MB TCP Master
RP WiFi (192.168.1.170)
- Wifi Router (192.168.1.254) - connected to Internet