basclinic.blogg.se

Bridge wifi to ethernet raspberry pi
Bridge wifi to ethernet raspberry pi






bridge wifi to ethernet raspberry pi bridge wifi to ethernet raspberry pi

It did take some messing around with, and the modbus node was a little quirky (for example, I had to space out writes to the modbus node's registers by a couple milliseconds to make sure data going in didn't ever get dropped). Then I was able to read those out, and send them to other computers, etc over wifi with MQTT, http out, etc. With this scheme, the PLC was programmed with a modbus write instruction, and the data went from the PLC over a wired (ethernet connection) to the pi, into like imaginary registers in the modbus node in node-red. Something that's worked for me before (with a different brand of PLC) was to use the modbus node (node-red-contrib-modbus). Or, if you're using the same IP range for both connections (wired and wireless), maybe that screws things up? What is your raspberry pi's IP address on those 2 interfaces? I wonder if you've lost connection to the PLC because your pi's IP changed when you rebooted it. Separately I've been able to successfully send and receive MQTT messages over WiFi I have been able to successfully communicate with the PLC via the ethernet connection and retrieve data. Is this not working because I'm trying to send and receive data over two different Network Interfaces? Is it possible to use two Network Interfaces at once? Or is there a way of defining which network interface you want Node Red to use? Or have I made some other silly mistake?

bridge wifi to ethernet raspberry pi

Then I rebooted the Raspberry Pi, and when it started up, the MQTT connection was working but the PLC connection wouldn't work. When I first set up this flow, the PLC connection was working, but the MQTT connection didn't work. Separately I've been able to successfully send and receive MQTT messages over WiFi, but when I try and do both, one of them doesn't work.Īll I want to do at the moment is log an MQTT message (over WiFi) and at the same time log data from the PLC (over the LAN connection with an ethernet cable).

bridge wifi to ethernet raspberry pi

The PLC is a Siemens PLC so I'm using the node-red-contrib-s7 library to communicate with it. The Raspberry Pi is connected to the PLC via an ethernet cable and the Raspberry Pi is connected to my Wifi for an internet connection. I'm running Node-Red on a Raspberry Pi 4 (Standard Raspbian Operating System) and I'm trying to retrieve some data from a PLC and then send that data via MQTT. I'm pretty new to all of this so please excuse my ignorance.








Bridge wifi to ethernet raspberry pi