MySensors addon never detects my nodes



  • Hello,
    I have been trying this new controller but could not make it work with mysensors. The sensors never get properly detected.
    I have flashed the webthings image on my raspberry sd card, and configured it. Then I turned my raspberry to a gateway by downloading and compiling the development version of the gateway. I configured it as an ethernet gateway.
    When I read the logfile of the gateway, I see communication with my nodes seems ok. I have a temperature and humidity sensor running, I can see its traffic:

    Aug 06 18:46:34 DEBUG TSF:MSG:READ,4-4-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    Aug 06 18:46:34 DEBUG TSF:MSG:BC
    Aug 06 18:46:34 DEBUG TSF:MSG:FPAR REQ,ID=4
    Aug 06 18:46:34 DEBUG TSF:PNG:SEND,TO=0
    Aug 06 18:46:34 DEBUG TSF:CKU:OK
    Aug 06 18:46:34 DEBUG TSF:MSG:GWL OK
    Aug 06 18:46:35 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    Aug 06 18:46:36 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    Aug 06 18:46:36 DEBUG TSF:MSG:PINGED,ID=4,HP=1
    Aug 06 18:46:36 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    Aug 06 18:46:36 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    Aug 06 18:46:36 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    Aug 06 18:46:37 DEBUG TSF:MSG:READ,4-4-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.3.0
    Aug 06 18:46:37 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=11,pt=0,l=22,sg=0:TemperatureAndHumidity
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=0,c=0,t=7,pt=0,l=8,sg=0:Humidity
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=1,c=0,t=6,pt=0,l=11,sg=0:Temperature
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    Aug 06 18:46:39 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=1,c=1,t=0,pt=7,l=5,sg=0:24.63
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=0,c=1,t=1,pt=7,l=5,sg=0:73.47
    Aug 06 18:46:39 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=0,pt=1,l=1,sg=0:100
    
    

    I'm running mySensors v 2.3 on my node.
    I have installed the mySensors addon for webthings, configured it for ethernet.
    When I try to detect sensors, I have the following output from WebThings logfile:

    2019-08-06 18:09:57.805 INFO   : About to call startPairing on ThingURLAdapter
    2019-08-06 18:09:57.807 INFO   : About to call startPairing on PresenceAdapter
    2019-08-06 18:09:57.809 INFO   : About to call startPairing on MySensorsAdapter
    2019-08-06 18:09:57.820 INFO   : Opened a new things socket
    2019-08-06 18:09:57.826 INFO   : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
    2019-08-06 18:09:57.828 INFO   : network-presence-detection: Saving updated list of found devices to json file
    2019-08-06 18:09:57.829 INFO   : network-presence-detection: 
    2019-08-06 18:09:57.831 INFO   : network-presence-detection: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"network-presence-detection-adapter","pluginId":"network-presence-detection-adapter"}}'
    2019-08-06 18:09:57.832 INFO   : network-presence-detection: Adapter: PresenceAdapter id network-presence-detection-adapter pairing started
    2019-08-06 18:10:41.920 ERROR  : Thing was not added
    2019-08-06 18:10:41.922 ERROR  : addNewThing cancelled
    2019-08-06 18:10:41.929 INFO   : mysensors: PAIRING INITIATED
    2019-08-06 18:10:41.931 INFO   : mysensors: Thread already existed
    2019-08-06 18:10:41.932 INFO   : mysensors: Re-requesting presentation of all nodes on the network
    2019-08-06 18:10:41.933 INFO   : mysensors: Re-request of node presentation restarted
    2019-08-06 18:10:41.935 INFO   : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
    2019-08-06 18:10:41.936 INFO   : network-presence-detection: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"network-presence-detection-adapter","pluginId":"network-presence-detection-adapter"}}'
    2019-08-06 18:10:41.942 INFO   : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
    2019-08-06 18:38:18.362 INFO   : About to call startPairing on ThingURLAdapter
    2019-08-06 18:38:18.364 INFO   : About to call startPairing on PresenceAdapter
    2019-08-06 18:38:18.366 INFO   : About to call startPairing on MySensorsAdapter
    2019-08-06 18:38:18.374 INFO   : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
    2019-08-06 18:38:18.376 INFO   : network-presence-detection: Saving updated list of found devices to json file
    2019-08-06 18:38:18.377 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.378 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.380 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.381 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.382 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.383 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.385 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.386 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.387 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.388 INFO   : network-presence-detection: 
    2019-08-06 18:38:18.389 INFO   : network-presence-detection: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"network-presence-detection-adapter","pluginId":"network-presence-detection-adapter"}}'
    2019-08-06 18:38:18.390 INFO   : network-presence-detection: Adapter: PresenceAdapter id network-presence-detection-adapter pairing started
    2019-08-06 18:38:21.347 INFO   : Opened a new things socket
    2019-08-06 18:39:18.377 INFO   : Pairing timeout
    2019-08-06 18:39:18.380 ERROR  : Thing was not added
    2019-08-06 18:39:18.381 ERROR  : addNewThing cancelled
    

    I have tried to reset my nodes to have them present themselves, but same result they do not appear in webthings interface after detection.
    Any idea of what i'm doing wrong?
    Thank you


  • Plugin Developer

    • Have you physically restarted your nodes? You need to for them to show up. I don't see any incoming device data in your log.

    Thread already existed

    • Don't jump into the "add new things" page immediately. Give it a minute so it can grab the data from your devices first. That thread is still busy.


  • Thank you for your help. I had restarted my nodes with reset button.
    I tested the following today:
    -restart my raspberry gateway
    -restart mysgw.service. Don't know why, it starts automatically and then gets killed:

    Aug 07 20:48:57 gateway systemd[1]: Started MySensors Gateway daemon.
    Aug 07 20:49:40 gateway systemd[1]: mysgw.service: Main process exited, code=kil
    Aug 07 20:49:40 gateway systemd[1]: mysgw.service: Failed with result 'signal'.
    

    So I have to restart it manually with sudo systemctl start mysgw.service .
    -Once the service was active , I turned on my sensor at 20:57. mysgw log says:

    Aug 07 20:54:58 DEBUG TSF:WUR:MS=0
    Aug 07 20:54:58 DEBUG TSM:INIT:TSP OK
    Aug 07 20:54:58 DEBUG TSM:INIT:GW MODE
    Aug 07 20:54:58 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Aug 07 20:54:58 DEBUG MCO:REG:NOT NEEDED
    Aug 07 20:54:58 DEBUG Listening for connections on @▒▒~:5003
    Aug 07 20:54:58 DEBUG MCO:BGN:STP
    Aug 07 20:54:58 DEBUG MCO:BGN:INIT OK,TSP=1
    Aug 07 20:54:58 DEBUG TSM:READY:NWD REQ
    Aug 07 20:54:58 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    Aug 07 20:57:45 DEBUG TSF:MSG:READ,4-4-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    Aug 07 20:57:45 DEBUG TSF:MSG:BC
    Aug 07 20:57:45 DEBUG TSF:MSG:FPAR REQ,ID=4
    Aug 07 20:57:45 DEBUG TSF:PNG:SEND,TO=0
    Aug 07 20:57:45 DEBUG TSF:CKU:OK
    Aug 07 20:57:45 DEBUG TSF:MSG:GWL OK
    Aug 07 20:57:45 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    Aug 07 20:57:47 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    Aug 07 20:57:47 DEBUG TSF:MSG:PINGED,ID=4,HP=1
    Aug 07 20:57:47 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    Aug 07 20:57:47 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    Aug 07 20:57:47 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    Aug 07 20:57:47 DEBUG TSF:MSG:READ,4-4-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.3.0
    Aug 07 20:57:47 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=11,pt=0,l=22,sg=0:TemperatureAndHumidity
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=0,c=0,t=7,pt=0,l=8,sg=0:Humidity
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=1,c=0,t=6,pt=0,l=11,sg=0:Temperature
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    Aug 07 20:57:49 DEBUG TSF:MSG:SEND,0-0-4-4,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=1,c=1,t=0,pt=7,l=5,sg=0:24.71
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=0,c=1,t=1,pt=7,l=5,sg=0:62.34
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=0,pt=1,l=1,sg=0:100
    

    Waited two minutes as proposed, then I went back to Webthings gateway and triggered a thing detection. It does not seem to work better:

    2019-08-07 21:00:48.323 INFO   : About to call startPairing on ThingURLAdapter
    2019-08-07 21:00:48.327 INFO   : About to call startPairing on PresenceAdapter
    2019-08-07 21:00:48.329 INFO   : About to call startPairing on MySensorsAdapter
    2019-08-07 21:00:48.344 INFO   : network-presence-detection: 
    2019-08-07 21:00:48.345 INFO   : network-presence-detection: 
    2019-08-07 21:00:48.347 INFO   : network-presence-detection: 
    2019-08-07 21:00:48.349 INFO   : network-presence-detection: 
    2019-08-07 21:00:48.350 INFO   : network-presence-detection: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"network-presence-detection-adapter","pluginId":"network-presence-detection-adapter"}}'
    2019-08-07 21:00:48.352 INFO   : network-presence-detection: Adapter: PresenceAdapter id network-presence-detection-adapter pairing started
    2019-08-07 21:00:48.355 INFO   : mysensors: Making initial scan of USB ports
    2019-08-07 21:00:48.357 INFO   : mysensors: -Connection status is present in the config data.
    2019-08-07 21:00:48.358 INFO   : mysensors: Debugging enabled
    2019-08-07 21:00:48.360 INFO   : mysensors: RECREATING DEVICES FROM PERSISTENCE
    2019-08-07 21:00:48.362 INFO   : mysensors: 
    2019-08-07 21:00:48.363 INFO   : mysensors: #0
    2019-08-07 21:00:48.365 INFO   : mysensors: End of recreation function
    2019-08-07 21:00:48.367 INFO   : mysensors: -Gateway choice: Ethernet gateway
    2019-08-07 21:00:48.369 INFO   : mysensors: Selected IP address and port: 127.0.0.1
    2019-08-07 21:00:48.371 INFO   : mysensors: 
    2019-08-07 21:00:48.372 INFO   : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
    2019-08-07 21:00:48.374 INFO   : mysensors: self.GATEWAY.metric was set to: True
    2019-08-07 21:00:48.376 INFO   : mysensors: self.GATEWAY.metric is now set to: True
    2019-08-07 21:00:48.378 INFO   : mysensors: Re-requesting presentation of all nodes on the network
    2019-08-07 21:00:48.379 INFO   : mysensors: Re-request thread created
    2019-08-07 21:00:48.381 INFO   : mysensors: 
    2019-08-07 21:00:48.383 INFO   : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.3.2-beta
    2019-08-07 21:00:48.385 INFO   : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
    2019-08-07 21:01:48.334 INFO   : Pairing timeout
    2019-08-07 21:01:48.339 ERROR  : Thing was not added
    2019-08-07 21:01:48.341 ERROR  : addNewThing cancelled
    2019-08-07 21:01:48.346 INFO   : network-presence-detection: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"network-presence-detection-adapter","pluginId":"network-presence-detection-adapter"}}'
    2019-08-07 21:01:48.349 INFO   : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
    2019-08-07 21:01:48.351 INFO   : mysensors: PAIRING INITIATED
    2019-08-07 21:01:48.352 INFO   : mysensors: Thread already existed
    2019-08-07 21:01:48.353 INFO   : mysensors: Re-requesting presentation of all nodes on the network
    2019-08-07 21:01:48.355 INFO   : mysensors: Re-request of node presentation restarted
    2019-08-07 21:01:48.356 INFO   : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
    

    Finally says no new things found.
    So I'm afraid I did not make any progress since yesterday 😓


  • Plugin Developer

    incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.

    Well, the good news is it does look like it's working. Perhaps the problem is in your mysgw settings or your nodes? Are they on the same channel? Do they use encryption? Perhaps the issue is that you're using the beta version of MySensors and your nodes don't?

    Try running the mysgw in debug mode and make sure that any data from your nodes is actually coming in.



  • The log shown in the previous post is the one from the mysensors gateway:

    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=1,c=1,t=0,pt=7,l=5,sg=0:24.71
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=0,c=1,t=1,pt=7,l=5,sg=0:62.34
    Aug 07 20:57:49 DEBUG TSF:MSG:READ,4-4-0,s=255,c=3,t=0,pt=1,l=1,sg=0:10
    

    Can i get a more verbose debug?
    I think the communication between the nodes and the gateway is fine since gateway is displaying the temperature and humidity of the node.

    Could it be a problem between the mySensors gateway and the webthings gateway? The mySensors is built with the following options:
    --my-transport=rf24 --my-gateway=ethernet --my-port=5003
    The mySensors plugin for webthings is configured to connect by ethernet on 127.0.0.1.

    Thanks for your help.



  • Normally you can use the log parser to get more info but it looks like it doesn't have support in it for those debug log records: https://www.mysensors.org/build/parser


  • Plugin Developer

    Since you are getting an incoming message from the mysgw, it seems that the route between it and the add-on it working. If you can get one message, you should be able to get all of them.

    The add-on is built on top of the PyMysensors library. I don't know if it supports your beta version. Here is the code that starts it.

    I believe @rmalbers has (had) the ethernet version working?

    • Try testing with mysensors version 2.2. That's 100% supported.
      - Have you tried adding a port number to the IP address? 127.0.0.1:5003

  • Plugin Developer

    @pentaglut Did you manage to get it working in the end?


Log in to reply
 

Suggested Topics

  • 6
  • 3
  • 5
  • 55
  • 3
  • 4

10
Online

11.4k
Users

11.1k
Topics

112.7k
Posts