Hooking with spinwaves system SWGW
-
Hello Udi,
Spinwave's comment was this:
There might be an address offset issue. Depending on how Mango works he might have to read holding register 0 or holding register 1 if he wants to read the 1st holding register (aka 4xxx registers).
According to them the hardware supports either Modbus TCP or RTU, both of which Mango also supports. Note that Mango uses 0-indexing of Modbus registers. Hope this helps.
-
Hi,
thank you for your response,
However i'm stuck in an earlier stage, i get the error
**Error while polling modbus network: java.net.UnknownHostException: http://10.2.20.3/ **
when trying to connect from Mango Data Source to the SWGW via TCP.
i realize there might be a reason for that ,
the http://10.2.20.3/ port 80 is protected by username / password
i tried to change that to the default password of Mango but still it gave the same error. the username / password are compulsory and cannot be overrideis there another basic check or something i can do to ? something to further pinpoint the problem ?
-
An UnknownHostException occurs well before you would ever have a problem with HTTP authentication. (Besides, Modbus over TCP doesn't have anything to do with HTTP.) The exception means that the host on which Mango runs can't find the target host (10.2.20.3).
-
Hi,
i winder what is the source of the problem - i can surf to the gatway from the same browser that i use for MangoM2m and at the same time i get the following error withing the mango M2m ,
Here is the part from the tomcat window that mention the source of the problem.
can you please outline some steps to take or check?**
INFO 2009-04-02 20:30:10,281 (com.serotonin.mango.rt.dataSource.modbus.ModbusDa
taSource.doPoll:131) - Error while polling modbus network
com.serotonin.modbus4j.exception.ModbusTransportException: java.net.UnknownHostE
xception: http://10.2.209.3/
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:64)
at com.serotonin.modbus4j.ModbusMaster.sendFunctionGroup(ModbusMaster.ja
va:325)
at com.serotonin.modbus4j.ModbusMaster.send(ModbusMaster.java:268)
at com.serotonin.mango.rt.dataSource.modbus.ModbusDataSource.doPoll(Modb
usDataSource.java:88)
at com.serotonin.mango.rt.dataSource.PollingDataSource.scheduleTimeout(P
ollingDataSource.java:70)
at com.serotonin.mango.util.TimeoutJob.execute(TimeoutJob.java:49)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:516)
Caused by: java.net.UnknownHostException: http://10.2.209.3/
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.serotonin.modbus4j.ip.tcp.TcpMaster.openConnection(TcpMaster.java
:111)
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:61)
... 7 more
INFO 2009-04-02 20:30:10,359 (com.serotonin.mango.rt.dataSource.modbus.ModbusDa
taSource.doPoll:131) - Error while polling modbus network
com.serotonin.modbus4j.exception.ModbusTransportException: java.net.UnknownHostE
xception: http://10.2.20.3/
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:64)
at com.serotonin.modbus4j.ModbusMaster.sendFunctionGroup(ModbusMaster.ja
va:325)
at com.serotonin.modbus4j.ModbusMaster.send(ModbusMaster.java:268)
at com.serotonin.mango.rt.dataSource.modbus.ModbusDataSource.doPoll(Modb
usDataSource.java:88)
at com.serotonin.mango.rt.dataSource.PollingDataSource.scheduleTimeout(P
ollingDataSource.java:70)
at com.serotonin.mango.util.TimeoutJob.execute(TimeoutJob.java:49)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:516)
Caused by: java.net.UnknownHostException: http://10.2.20.3/
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.serotonin.modbus4j.ip.tcp.TcpMaster.openConnection(TcpMaster.java
:111)
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:61)
... 7 more** -
Sometimes Java appears to cache network information. It might have decided on its own that the host is unknown. Can you try restarting Tomcat to see if it works better?
-
Hi,
Considering that the problem might rise from the medium between the MangoM2M and SWGW , i did the following- Restart the computer
- shut down the firewall and ant virus
- made sure there is a browser connection
to no avail - the problem still exist ,
both machine are now connected to the same Hubi will try to install on another machine and later on use crosspair Cat5 cable between the machine and the SWGW
i will welcome any debugging idea .
10nx
--udi -
Duh. I just saw this. Your hostname should be simply "10.2.209.3", not "http://10.2.209.3/".
-
Hi,
Thanks , indeed it seem to progress ,
we now have a new error further down the road ..Error while polling modbus network: No response from network
(please see below the extracted error fro the tomcat window)
However i can access the SWGW embedded webserver from the browser at the same time .when activating another application from
http://www.codeproject.com/KB/IP/Modbus_TCP_class.aspxi get *Modbus slave error: Slave time out! * on the c# application there
any ideas ?
10nx** 49,093 (com.serotonin.mango.rt.dataSource.modbus.ModbusDa
taSource.doPoll:131) - Error while polling modbus network
com.serotonin.modbus4j.exception.ModbusTransportException: com.serotonin.io.mess
aging.SendTimeoutException
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:87)
at com.serotonin.modbus4j.ModbusMaster.sendFunctionGroup(ModbusMaster.ja
va:325)
at com.serotonin.modbus4j.ModbusMaster.send(ModbusMaster.java:268)
at com.serotonin.mango.rt.dataSource.modbus.ModbusDataSource.doPoll(Modb
usDataSource.java:88)
at com.serotonin.mango.rt.dataSource.PollingDataSource.scheduleTimeout(P
ollingDataSource.java:70)
at com.serotonin.mango.util.TimeoutJob.execute(TimeoutJob.java:49)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
ava:516)
Caused by: com.serotonin.io.messaging.SendTimeoutException
at com.serotonin.io.messaging.SenderConnection.send(SenderConnection.jav
a:85)
at com.serotonin.io.messaging.SenderConnection.send(SenderConnection.jav
a:92)
at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:83)
... 7 more** -
Hi,
Reseting the computer and the gateway didn't help situation stayed the same , i cannot see any configuration that suppose to change timeout in the gateway.Best
--udi -
Ok
Problem sovled ( also with spinwave's help)the port should be 502 not 80 ,
the offset start at 101 and on .
the data arrive as 2 bytes bsigned integer .10nx to all
--udi