Pacmunchiez
Hey guys, I might have jumped in a bit too far too fast. IT background, bit of Python coding, just started working IT at a factory and as such I get to play with OT stuff as well. Interested in learning more about automation so I grabbed one of the Pi's from work and chucked OpenPLC on it. Problem is I don't have much in the way of home automation because I've never seen the need (forever renting). Cue me buying a Genio Wifi Smart Plug to test stuff out. I was originally gonna flash it with Tasmota firmware because there is a ton of documentation out there but after I saw that OpenPLC had it's own firmware, I figured I'd just get straight to it. Fast forward to now, I have flashed the firmware to the device. I can see it on my network, I can see that port 502 is open, I can make a raw socket connection to it but I can't get it to do anything useful. When I add it as a slave to OpenPLC and hit start PLC I get the following,

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device GenioPlug0 is disconnected. Attempting to reconnect...
Warning: Persistent Storage file not found
Connection failed on MB device GenioPlug0: Operation now in progress
Modbus Read Discrete Input Registers failed on MB device GenioPlug0: Bad file descriptor
Modbus Write Coils failed on MB device GenioPlug0: Bad file descriptor
Modbus Read Input Registers failed on MB device GenioPlug0: Bad file descriptor
Modbus Write Holding Registers failed on MB device GenioPlug0: Bad file descriptor
Device GenioPlug0 is disconnected. Attempting to reconnect...
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
Connection failed on MB device GenioPlug0: Operation now in progress
Device GenioPlug0 is disconnected. Attempting to reconnect...

On the very odd occasion I've seen it say it was connected but then it just fails again almost immediately. Is there anything super obvious I am missing? Should I have modified something in the firmware file prior to flashing (besides the ssid and pass that is)?

Sorry for the long post these are probably dumb questions. I may just flash it to Tasmota firmware and then try and get OpenPLC to that. Any suggestions regarding OpenPLC firmware would be appreciated.
Quote 0 0
thiagoralves
The firmware was made for pure ESP8266 boards (like NodeMCU) or Sonoff Basic.For the supported platforms there isn't any change required on the firmware. I don't know how it would behave on the Genio WiFi thing. Perhaps for this device you might need to change something, IDK. Try using a Modbus software like Radzio Modbus and check if you can talk to your device using Modbus. OpenPLC uses Modbus to talk to its slave devices. If you can't talk to it using Radzio, then you won't be able to talk to it using OpenPLC either.
Quote 1 0
Pacmunchiez
Hey man, thanks for the response. I watched your Defcon 26 talk yesterday, was good fun. I grabbed Radzio Modbus (as I saw you suggest it in another post) and I'm getting super intermittent responses. I guess that means I'll be messing with the code (I enjoy this so it's not a problem). Wish me luck.
Quote 0 0
thiagoralves
Before you start fiddling around with code, check your network first. From your description it seems that the problem is on the network, not the firmware
Quote 0 0