W5100 Gateway frustration
-
The Gateway giving me trouble is an Arduino UNO + W5100 SHield + Hard SPI...
I also set up two nodes (one with DHT11 and another with Light+Buzzer)The two nodes work fine with a serial Gateway.
The Ethernet Gateway connects to the controller, creates a node (without any parameters) and just sits there.
I see the Gateway is exchanging messages with the two nodes I set up, but nothing is showing up in the controller.
Automatic NODE_ID also fails, so I have to assign MY_NODE_ID 1 and MY_NODE_ID 2 to the nodes.Let's see if anyone can help me sort this out...
Looking at the server log file, I see the following:
*2016-12-03 12:43:59,761 ERROR [Quartz_Scheduler_Worker-5] [org.mycontroller.standalone.gateway.ethernet.EthernetGatewayActionThread:103] Exception, java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.8.0_111] at java.net.SocketOutputStream.write(SocketOutputStream.java:141) ~[na:1.8.0_111] at org.mycontroller.standalone.gateway.ethernet.EthernetGatewayActionThread.write(EthernetGatewayActionThread.java:100) ~[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.gateway.ethernet.EthernetGatewayImpl.write(EthernetGatewayImpl.java:46) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McMessageUtils.sendToGateway(McMessageUtils.java:522) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge.executeMcMessage(MySensorsProviderBridge.java:45) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McMessageUtils.sendToProviderBridge(McMessageUtils.java:557) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McActionEngine.discover(McActionEngine.java:290) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.api.GatewayApi.executeNodeDiscover(GatewayApi.java:129) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.jobs.ExecuteDiscoverJob.doRun(ExecuteDiscoverJob.java:59) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.knowm.sundial.Job.execute(Job.java:57) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.quartz.core.JobRunShell.run(JobRunShell.java:178) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.quartz.core.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:515) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] 2016-12-03 12:43:59,838 ERROR [Quartz_Scheduler_Worker-5] [org.mycontroller.standalone.message.McMessageUtils:529] Message sending failed! RawMessage(gatewayId=6, data=255;255;3;0;20; , subData=null, isTxMessage=false, networkType=MY_SENSORS) org.mycontroller.standalone.gateway.GatewayException: GATEWAY_ERROR: There is no connection with EthernetGateway! at org.mycontroller.standalone.gateway.ethernet.EthernetGatewayActionThread.write(EthernetGatewayActionThread.java:106) ~[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.gateway.ethernet.EthernetGatewayImpl.write(EthernetGatewayImpl.java:46) ~[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McMessageUtils.sendToGateway(McMessageUtils.java:522) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge.executeMcMessage(MySensorsProviderBridge.java:45) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McMessageUtils.sendToProviderBridge(McMessageUtils.java:557) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.message.McActionEngine.discover(McActionEngine.java:290) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.api.GatewayApi.executeNodeDiscover(GatewayApi.java:129) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.mycontroller.standalone.jobs.ExecuteDiscoverJob.doRun(ExecuteDiscoverJob.java:59) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.knowm.sundial.Job.execute(Job.java:57) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.quartz.core.JobRunShell.run(JobRunShell.java:178) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] at org.quartz.core.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:515) [mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2] 2016-12-03 12:44:05,416 INFO [Thread-7] [org.mycontroller.standalone.gateway.ethernet.EthernetGatewayActionThread:148] Reconnected gateway successfully...
Looking at the gateway serial:
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0) 0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSM:RADIO:OK 0;255;3;0;9;TSM:GW MODE 0;255;3;0;9;TSM:READY IP: 10.0.0.33 0;255;3;0;9;No registration required 0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:59 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:60 0;255;3;0;9;TSP:MSG:READ 2-2-0 s=0,c=1,t=1,pt=7,l=5,sg=0:69.0 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:61 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:62 0;255;3;0;9;TSP:MSG:READ 2-2-0 s=1,c=1,t=0,pt=7,l=5,sg=0:28.0 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:63 0;255;3;0;9;TSP:SANCHK:OK 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:62 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:61 0;255;3;0;9;TSP:MSG:READ 2-2-0 s=0,c=1,t=1,pt=7,l=5,sg=0:69.0 0;255;3;0;9;TSP:MSG:READ 1-1-0 s=0,c=1,t=23,pt=2,l=2,sg=0:62 0;255;3;0;9;TSP:MSG:READ 2-2-0 s=1,c=1,t=0,pt=7,l=5,sg=0:28.0 0;255;3;0;9;TSP:SANCHK:OK
Looking at one of the nodes:
Starting repeater (RNNRA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=2) TSM:FPAR TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-2 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:FPAR (PPAR FOUND) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSM:CHKID:OK (ID=2) TSM:UPL TSP:PING:SEND (dest=0) TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-2 s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSP:MSG:PONG RECV (hops=1) TSP:CHKUPL:OK TSM:UPL:OK TSM:READY
-
including first few lines of server log:
2016-12-03 12:38:34,171 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:154] Application information: [Version:0.0.3.Alpha2, Database version:1.02.10 - 2016 Jul 29] 2016-12-03 12:38:37,721 INFO [main] [org.mycontroller.standalone.mqttbroker.MoquetteMqttBroker:51] MQTT Broker started successfully. MqttBrokerSettings(enabled=true, bindAddress=0.0.0.0, httpPort=1883, websocketPort=7080, allowAnonymous=false) 2016-12-03 12:38:38,389 INFO [main] [org.mycontroller.standalone.gateway.ethernet.EthernetGatewayActionThread:60] Connected successfully with EthernetGateway[10.0.0.33:5003] 2016-12-03 12:38:45,167 INFO [main] [org.mycontroller.standalone.StartApp:209] TJWS server started successfully, HTTPS Enabled?:false, HTTP(S) Port: [8443] 2016-12-03 12:38:45,169 INFO [main] [org.mycontroller.standalone.StartApp:107] MyController.org server started in [22937] ms
-
@adulovic looks like you have trouble with ethernet gateway. Can you please check your ethernet connection details?
-
@jkandasa sure can, and thanks for your time.
So, the W5100 lights up and responds to ping. I've also edited Ethernet.h and ethernetConfig.h.
That's all I've done to check the Ethernet side of things. What else should I check?Once I add the gateway the controller (resouces/gateways), the controller adds just ONE node (resources/nodes). This node changes status to "offline" after some time (anywhere between 5 and 30 minutes). If I delete the node, it gets recreated again on discovery.
No further nodes are automatically added, and the single "gateway node" that appears is suspiciously empty of data (no version, no script name, no library version, no node type).The error I pasted above seems to be linked to gatewayID=6, which I got rid of by reinstalling the controller (I used the opportunity to upgrade to 0.0.3.Final). That particular error no longer appears in the log, and the new server log is free of errors but I still can't get any new nodes to register automatically or manually.
Sending a RAW message from the controller does reach the nodes, I can see when both nodes receive the messages as I put the following in their sketches.
void receive(const MyMessage &message) { Serial.print("=== RECEIVED A MESSAGE === TYPE: "); Serial.println(message.type); }
This action also registers the nodes and their sensors, but then they stay blank and do not get updated. If this explanation is confusing, I can include a few screenshots of the mycontroller.
I tried swapping the LAN patch cable, I tried using both hard SPI and soft SPI, with and without an SD card, and I also installed the controller on a windows laptop, same results in each case. I unfortunately only have the one W5100 so I can't swap that out (yet).
Do you have any suggestions on how to proceed with the debugging?
Also, once I get this working, I wouldn't mind pitching in to help by translating mycontroller to a few more languages.
-
@adulovic Thank you for the detailed explanation and support! Looks like what you did was correct. Let me have a setup locally and check it. Seems no one is using ethernet gateway, hence we might miss some issue an upgrade version to version. I will check it soon and report back. In the mean-time you may connect your devices with Serial gateway or ESP/MQTT gateway.
- What version of MySensor firmware are you using?
- What is your ethernet gateway IP?
- What is your MyController IP?
-
What version of MySensor firmware are you using?
-- am using 2.0.0 (I also tried 2.1 beta, that gave me other problems)
What is your ethernet gateway IP?
-- 10.0.0.33
What is your MyController IP?
-- 10.0.0.32gateway (router) is 10.0.0.1. mask is 255.255.255.0
For MyController, am using 0.0.3.FInal
-
@adulovic I yet to setup ethernet gateway. Till now don not get enough time. Will report the status soon. Thank you for your patience
-
No worries... Whenever you get the time.
FYI, I tested with a W5100 MQTT sketch last night and that seems to work fine, so I guess you can eliminate the W5100 as a potential source of the problem. Let me know if I can help in any other way. Cheers.