MySensors: trying to add Things in WebThings Gateway
-
Version 0.1.0 has been accepted. Try it and let me know how it goes?
-
Ok ,updated addon and rebooted GW. This test was in Ethernet mode. No luck but the log sure looks different:
2019-06-21 14:32:15.079 INFO : Opened a new things socket
2019-06-21 14:32:15.185 INFO : About to call startPairing on MySensorsAdapter
2019-06-21 14:32:15.197 INFO : mysensors: -Connection status is present in the config data.
2019-06-21 14:32:15.199 INFO : mysensors: RECREATING DEVICES FROM PERSISTENCE
2019-06-21 14:32:15.200 INFO : mysensors:
2019-06-21 14:32:15.202 INFO : mysensors: #0
2019-06-21 14:32:15.203 INFO : mysensors: -Gateway choice: Ethernet gateway
2019-06-21 14:32:15.205 INFO : mysensors: Selected IP address and port: 192.168.1.98
2019-06-21 14:32:15.206 INFO : mysensors:
2019-06-21 14:32:15.208 INFO : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
2019-06-21 14:32:15.209 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:32:15.211 INFO : mysensors: Re-request thread created
2019-06-21 14:32:15.218 INFO : mysensors:
2019-06-21 14:32:15.220 INFO : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.2.0
2019-06-21 14:32:15.221 INFO : mysensors:
2019-06-21 14:32:15.222 INFO : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
2019-06-21 14:32:15.224 INFO : mysensors:
2019-06-21 14:32:15.225 INFO : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.2.0
2019-06-21 14:32:15.227 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:32:15.465 ERROR : mysensors: Node 2 is unknown
2019-06-21 14:32:36.851 ERROR : mysensors: Node 1 is unknown
2019-06-21 14:32:50.254 ERROR : mysensors: Node 2 is unknown
2019-06-21 14:33:09.496 ERROR : mysensors: Node 1 is unknown
2019-06-21 14:33:15.190 INFO : Pairing timeout
2019-06-21 14:33:15.196 ERROR : Thing was not added
2019-06-21 14:33:15.198 ERROR : addNewThing cancelled
2019-06-21 14:33:15.201 INFO : mysensors: PAIRING INITIATED
2019-06-21 14:33:15.204 INFO : mysensors: Thread already existed
2019-06-21 14:33:15.205 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:33:15.207 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 14:33:15.208 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:33:25.022 ERROR : mysensors: Node 2 is unknown -
Ok ,updated addon and rebooted GW. This test was in Ethernet mode. No luck but the log sure looks different:
2019-06-21 14:32:15.079 INFO : Opened a new things socket
2019-06-21 14:32:15.185 INFO : About to call startPairing on MySensorsAdapter
2019-06-21 14:32:15.197 INFO : mysensors: -Connection status is present in the config data.
2019-06-21 14:32:15.199 INFO : mysensors: RECREATING DEVICES FROM PERSISTENCE
2019-06-21 14:32:15.200 INFO : mysensors:
2019-06-21 14:32:15.202 INFO : mysensors: #0
2019-06-21 14:32:15.203 INFO : mysensors: -Gateway choice: Ethernet gateway
2019-06-21 14:32:15.205 INFO : mysensors: Selected IP address and port: 192.168.1.98
2019-06-21 14:32:15.206 INFO : mysensors:
2019-06-21 14:32:15.208 INFO : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
2019-06-21 14:32:15.209 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:32:15.211 INFO : mysensors: Re-request thread created
2019-06-21 14:32:15.218 INFO : mysensors:
2019-06-21 14:32:15.220 INFO : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.2.0
2019-06-21 14:32:15.221 INFO : mysensors:
2019-06-21 14:32:15.222 INFO : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
2019-06-21 14:32:15.224 INFO : mysensors:
2019-06-21 14:32:15.225 INFO : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.2.0
2019-06-21 14:32:15.227 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:32:15.465 ERROR : mysensors: Node 2 is unknown
2019-06-21 14:32:36.851 ERROR : mysensors: Node 1 is unknown
2019-06-21 14:32:50.254 ERROR : mysensors: Node 2 is unknown
2019-06-21 14:33:09.496 ERROR : mysensors: Node 1 is unknown
2019-06-21 14:33:15.190 INFO : Pairing timeout
2019-06-21 14:33:15.196 ERROR : Thing was not added
2019-06-21 14:33:15.198 ERROR : addNewThing cancelled
2019-06-21 14:33:15.201 INFO : mysensors: PAIRING INITIATED
2019-06-21 14:33:15.204 INFO : mysensors: Thread already existed
2019-06-21 14:33:15.205 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:33:15.207 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 14:33:15.208 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:33:25.022 ERROR : mysensors: Node 2 is unknown@rmalbers Just to add, this a log using USB GW, it seems to looks slightly different:
2019-06-21 14:46:04.725 INFO : Unloading MySensorsAdapter
2019-06-21 14:46:04.729 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"unloadAdapter","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:46:04.734 INFO : mysensors: Shutting down MySensors adapter
2019-06-21 14:46:04.736 INFO : mysensors: MySensors adapter was unable to cleanly close PyMySensors loop. This is not a problem.
2019-06-21 14:46:04.737 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"unloadPlugin","data":{"pluginId":"mysensors-adapter"}}'
2019-06-21 14:46:05.497 INFO : mysensors: MySensors add-on has succesfully loaded the configuration.
2019-06-21 14:46:08.255 INFO : Loading add-on: mysensors-adapter
2019-06-21 14:46:10.552 INFO : mysensors: initialising adapter from class
2019-06-21 14:46:10.555 INFO : mysensors: IpcClient: Connected to server, registering...
2019-06-21 14:46:10.559 INFO : mysensors: IpcClient: Received manager message: b'{"messageType":"registerPluginReply","data":{"pluginId":"mysensors-adapter","ipcBaseAddr":"gateway.plugin.mysensors-adapter"}}'
2019-06-21 14:46:10.561 INFO : mysensors: IpcClient: Registered with PluginServer
2019-06-21 14:46:10.564 INFO : mysensors: AddonManagerProxy: add_adapter: mysensors-adapter
2019-06-21 14:46:17.198 INFO : About to call startPairing on MySensorsAdapter
2019-06-21 14:46:17.205 INFO : mysensors: -Connection status is present in the config data.
2019-06-21 14:46:17.207 INFO : mysensors: RECREATING DEVICES FROM PERSISTENCE
2019-06-21 14:46:17.209 INFO : mysensors:
2019-06-21 14:46:17.210 INFO : mysensors: #0
2019-06-21 14:46:17.212 INFO : mysensors: -Gateway choice: USB Serial gateway
2019-06-21 14:46:17.214 INFO : mysensors: Selected USB device address: /dev/ttyUSB0
2019-06-21 14:46:17.215 INFO : mysensors:
2019-06-21 14:46:17.217 INFO : mysensors: >> incoming message > internal > id: 0; child: 255; subtype: 14; payload: Gateway startup complete.
2019-06-21 14:46:17.218 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:46:17.220 INFO : mysensors: Re-request thread created
2019-06-21 14:46:17.221 INFO : mysensors:
2019-06-21 14:46:17.223 INFO : mysensors: >> incoming message > presentation > id: 0; child: 255; subtype: 18; payload: 2.3.0
2019-06-21 14:46:17.225 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"startPairing","data":{"timeout":60,"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:46:17.245 INFO : Opened a new things socket
2019-06-21 14:46:44.848 ERROR : mysensors: Node 2 is unknown
2019-06-21 14:47:17.202 INFO : Pairing timeout
2019-06-21 14:47:17.206 ERROR : Thing was not added
2019-06-21 14:47:17.208 ERROR : addNewThing cancelled
2019-06-21 14:47:17.211 INFO : mysensors: PAIRING INITIATED
2019-06-21 14:47:17.213 INFO : mysensors: Thread already existed
2019-06-21 14:47:17.215 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 14:47:17.216 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 14:47:17.218 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 14:47:18.140 ERROR : mysensors: Node 1 is unknown -
Very strange.
I notice you press the pairing button immediately. You don't have to press the pairing button for it to scan for devices. But it shouldn't affect things either.
The only device in your persistence file seems to be your gateway (which it does not turn into a thing, but maybe it should. But that's another matter.)
Have you restarted your devices after starting the gateway? Otherwise they won't show up. Also make sure your devices send actual values when they boot or shortly after, otherwise those won't show up as properties.
I think it's time to have a look at your Arduino code.
-
Very strange.
I notice you press the pairing button immediately. You don't have to press the pairing button for it to scan for devices. But it shouldn't affect things either.
The only device in your persistence file seems to be your gateway (which it does not turn into a thing, but maybe it should. But that's another matter.)
Have you restarted your devices after starting the gateway? Otherwise they won't show up. Also make sure your devices send actual values when they boot or shortly after, otherwise those won't show up as properties.
I think it's time to have a look at your Arduino code.
@alowhum Sorry, I forgot about rebooting the sensor - SUCCESS! (Now I just have to find the other sensors to reboot them, LOL! This is with the ethernet gateway:
2019-06-21 15:03:33.639 INFO : Opened a new things socket
2019-06-21 15:04:08.145 ERROR : mysensors: Node 2 is unknown
2019-06-21 15:04:25.229 ERROR : mysensors: Child 0 is unknown
2019-06-21 15:04:33.108 INFO : Pairing timeout
2019-06-21 15:04:33.111 ERROR : Thing was not added
2019-06-21 15:04:33.113 ERROR : addNewThing cancelled
2019-06-21 15:04:33.117 INFO : mysensors: PAIRING INITIATED
2019-06-21 15:04:33.118 INFO : mysensors: Thread already existed
2019-06-21 15:04:33.120 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 15:04:33.121 INFO : mysensors: << Requesting presentation from 1
2019-06-21 15:04:33.123 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 15:04:33.124 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 15:04:35.520 INFO : Successfully created new thing MySensors_1
2019-06-21 15:04:42.920 ERROR : mysensors: Node 2 is unknown
2019-06-21 15:04:57.864 ERROR : mysensors: Child 0 is unknown -
@alowhum Sorry, I forgot about rebooting the sensor - SUCCESS! (Now I just have to find the other sensors to reboot them, LOL! This is with the ethernet gateway:
2019-06-21 15:03:33.639 INFO : Opened a new things socket
2019-06-21 15:04:08.145 ERROR : mysensors: Node 2 is unknown
2019-06-21 15:04:25.229 ERROR : mysensors: Child 0 is unknown
2019-06-21 15:04:33.108 INFO : Pairing timeout
2019-06-21 15:04:33.111 ERROR : Thing was not added
2019-06-21 15:04:33.113 ERROR : addNewThing cancelled
2019-06-21 15:04:33.117 INFO : mysensors: PAIRING INITIATED
2019-06-21 15:04:33.118 INFO : mysensors: Thread already existed
2019-06-21 15:04:33.120 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 15:04:33.121 INFO : mysensors: << Requesting presentation from 1
2019-06-21 15:04:33.123 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 15:04:33.124 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 15:04:35.520 INFO : Successfully created new thing MySensors_1
2019-06-21 15:04:42.920 ERROR : mysensors: Node 2 is unknown
2019-06-21 15:04:57.864 ERROR : mysensors: Child 0 is unknown@rmalbers Success with second sensor in garage: (Posting log for informational purposes only)
2019-06-21 15:11:18.780 INFO : Opened a new things socket
2019-06-21 15:11:22.651 INFO : Successfully created new thing Temperature Sensor
2019-06-21 15:11:24.864 ERROR : Thing was not added
2019-06-21 15:11:24.865 ERROR : addNewThing cancelled
2019-06-21 15:11:24.869 INFO : mysensors: PAIRING INITIATED
2019-06-21 15:11:24.871 INFO : mysensors: Thread already existed
2019-06-21 15:11:24.872 INFO : mysensors: Re-requesting presentation of all nodes on the network
2019-06-21 15:11:24.874 INFO : mysensors: << Requesting presentation from 1
2019-06-21 15:11:24.875 INFO : mysensors: Re-request of node presentation restarted
2019-06-21 15:11:24.877 INFO : mysensors: << Requesting presentation from 2
2019-06-21 15:11:24.878 INFO : mysensors: AddonMangerProxy: recv: b'{"messageType":"cancelPairing","data":{"adapterId":"mysensors-adapter","pluginId":"mysensors-adapter"}}'
2019-06-21 15:11:25.829 INFO : getValue for property 2-0-0 for: Temperature Sensor returning 24.1 -
Oh my god :-D
-
@alowhum I guess I should sum it up: I have V2.2 and V2.3 sensors running using the Ethernet GW addon config and using the MySensors original, not rebuilt gateway, so the MS gateway is running unchanged, yet does work with the addon and WebThings GW. (I do have to rebuild sensors again for the 'imperial' config setting. domoticz didn't care but it looks like the WebThings GW does use it. (I have mixtures of F degrees, C degrees, etc.)
-
I've updated the first post of the Gateway Addon thread to indicate that devices must be restarted to initially connect them.