Lucifer06 / RemoteGPIO

Remote General Purpose I/O for Venus OS devices (Cerbo GX, ...)
11 stars 3 forks source link

Trying to configureCerbo GX to use Dingtian via Ethernet - message 'rgpio_driver: RemoteGPIO driver restart triggered by watchdog' #39

Closed matthewsellis closed 3 months ago

matthewsellis commented 3 months ago

Hi,

I have been trying without success to get either of a pair of DingTian 4 relay units (one is RS485 + Ethernet while the other is CAN + Ethernet) to work over Ethernet (also tried the RS485 interface with no luck). Initially I found the old venus_rgpio and this did not work either (tried both RS485 with a non FT232R USB interface and then Ethernet).

Having reinstalled the 'small' Venus OS and your RemoteGPIO package and followed (I hope!) the instructions, I do see 4 extra relays in the GUI but the actual interfaces do not operate.

I had a look in the logs and foundthe lLatest message (numerous times) in /data/log/RemoteGPIO/current rgpio_driver: RemoteGPIO driver restart triggered by watchdog

My configuration is below.

Are there any other logs I should look in, and per the below information is my config correct?

Thank you.

Cerbo GX

Version V3.32 Build Date 20240523125018

Modbus TCP/UDP devices

Automatic scanning disabled No Saved or Discovered devices

Ethernet

State Connected IP Address 192.168.88.23

Services

Modbud TCP Enabled

IO - RemoteGPIO

Enabled 1 Unit Installed Unit 1

IP Address 192.168.88.45
Protocol Modbus via TCP
No. of Relays 4
Additional Options
------------------
  Digital Inputs Enabled
  Reading Relay State Enabled

Packages

SetupHelper V8.5 GuiMods V10.33 RemoteGPIO v3.3.2

DingTian

Setting

Hardware Version    V3.6J
Software Version    V3.1.3541A
Build Date  2024/03/06 18:20:38
Model   Dingtian DT-R004
ETH DHCP    Yes
ETH IP  192.168.88.45

Relay Connect

Channel - RS485 Protocol Modbus-RTU Addr 1 Baud 115200bps Databits 8bit Stopbits 1bit Parity None Channel - CAN Protocol Dingtian String ID 1 Speed 125Kbps Frame Type Standard Frame Channel - UDP1
Protocol Dingtian Binary Remote Address 192.168.1.9 Remote Port 60000 Local Port 60000 Channel - UDP2 Protocol Dingtian String Remote Address 192.168.1.9 Remote Port 60001 Local Port 60001 Channel - TCP Server
Protocol Modbus-TCP Local Port 502 Channel - TCP Client
Protocol Modbus-RTU Over TCP Remote Address Remote Port 502

matthewsellis commented 3 months ago

Had a further dig and found the below errors in /data/log/rgpio_driver/current

@40000000665ae82e005a242c *** starting RemoteGPIO ***
@40000000665ae82f1362268c Reply time-out!
@40000000665ae8301419ab04 Reply time-out!
@40000000665ae830146ff4dc /data/RemoteGPIO/rgpio_driver: line 220: slave...: syntax error: invalid arithmetic operator (error token is "...")
@40000000665ae83014fff80c *** starting RemoteGPIO ***
@40000000665ae831297d6044 Reply time-out!
@40000000665ae8322887e86c *** starting RemoteGPIO ***
@40000000665ae8322a3bf554 Reply time-out!
@40000000665ae83400b2b7f4 Reply time-out!

And having has a look at that line of code, I can see it makes a call which returns the following (when I added the DingTian IP address):

root@einstein:/data/RemoteGPIO# /data/RemoteGPIO/bin/modpoll/arm-linux-gnueabihf/modpoll -m enc -1 -r 11 -c 1 -a 1 192.168.88.45
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: Encapsulated RTU over TCP, FC3
Slave configuration...: address = 1, start reference = 11, count = 1
Communication.........: 192.168.88.45, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave...
Reply time-out!
root@einstein:/data/RemoteGPIO# 

I am able to ping the DingTian:

root@einstein:/data/RemoteGPIO# ping 192.168.88.45
PING 192.168.88.45 (192.168.88.45): 56 data bytes
64 bytes from 192.168.88.45: seq=0 ttl=255 time=0.574 ms
64 bytes from 192.168.88.45: seq=1 ttl=255 time=0.532 ms
64 bytes from 192.168.88.45: seq=2 ttl=255 time=0.459 ms
64 bytes from 192.168.88.45: seq=3 ttl=255 time=0.479 ms
64 bytes from 192.168.88.45: seq=4 ttl=255 time=0.453 ms
^C
--- 192.168.88.45 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.453/0.499/0.574 ms

So guessing this is an issue with the config in the DingTian?

matthewsellis commented 3 months ago

Final update - the issue was that the DingTian TCP Server value was set to Modbus-TCP. When I changed it to Modbus-RTU over TCP everything worked :)