Trouble adding simple arduino thing

I have the example LED thing running on an arduino nano33 and I can discover and add it to my pi based gateway. The issue is the newly created thing is not functional (grayed out). I am able to interface with the arduino with curl to query and toggle the onboard LED on and off. Below is what I get in the log file when I add the thing. I’m having trouble making sense of the logs (e.g. I don’t understand why the wemo add-on is involved with my arduino device (192.168.1.83)). I do have a wemo device installed and working separately though. Any guidance is appreciated.

2019-12-31 15:32:34.980 INFO : Opened a new things socket
2019-12-31 15:32:35.102 INFO : About to call startPairing on WemoAdapter
2019-12-31 15:32:35.104 INFO : About to call startPairing on SysteminfoAdapter
2019-12-31 15:32:35.105 INFO : About to call startPairing on ThingURLAdapter
2019-12-31 15:32:35.111 INFO : wemo: AddonManagerProxy: recv: b’{“messageType”:4099,“data”:{“timeout”:60,“adapterId”:“wemo-adapter”,“pluginId”:“wemo-adapter”}}’
2019-12-31 15:32:35.127 INFO : systeminfo: Adapter: SysteminfoAdapter id SysteminfoAdapter pairing started
2019-12-31 15:32:42.050 INFO : Successfully created new thing Built-in LED
2019-12-31 15:32:42.055 INFO : wemo: AddonManagerProxy: recv: b’{“messageType”:8207,“data”:{“deviceId”:“http—192.168.1.83”,“device”:{“title”:“Built-in LED”,“type”:"","@context":“https://iot.mozilla.org/schemas","@type":[“OnOffSwitch”],“description”:"",“href”:"/things/http---192.168.1.83",“properties”:{},“actions”:{},“events”:{},“links”:[{“rel”:“properties”,“href”:"/things/http---192.168.1.83/properties"},{“rel”:“actions”,“href”:"/things/http---192.168.1.83/actions"},{“rel”:“events”,“href”:"/things/http---192.168.1.83/events"},{“rel”:“alternate”,“mediaType”:“text/html”,“href”:"/things/http---192.168.1.83"}],“layoutIndex”:3,“selectedCapability”:“OnOffSwitch”,“iconHref”:null},“adapterId”:“wemo-adapter”,“pluginId”:"wemo-adapter”}}’
2019-12-31 15:32:54.108 ERROR : Thing was not added
2019-12-31 15:32:54.109 ERROR : addNewThing cancelled
2019-12-31 15:32:54.130 INFO : wemo: AddonManagerProxy: recv: b’{“messageType”:4100,“data”:{“adapterId”:“wemo-adapter”,“pluginId”:“wemo-adapter”}}’
2019-12-31 15:32:54.132 INFO : systeminfo: Adapter: SysteminfoAdapter id SysteminfoAdapter pairing cancelled
2019-12-31 15:32:54.135 INFO : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled

I actually just released v0.10.0 of the webthing-arduino library. Would you mind installing the new version and trying again?

1 Like

Just tried your new version of the library and it works great!

One note for the nano33, I had to add the define below at line 18 of WiFi101WebThingAdapter.h to force it to use WiFiNINA. This is a hack because I’m using the nano 33 IOT (which, is pretty much the same as a MKRWIFI1010). (I had to do this for the previous version of the webthing-arduino library too.) I wasn’t sure what the define variable would be for my nano 33.

#define ARDUINO_SAMD_MKRWIFI1010

Chock

Could you try this and let me know if it works?

#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT)

Yes, that works. I found that as well right after I posted (of course) and have just tried it and it works just fine.

Thanks again.

Great! I just released v0.10.1 with that fix. Hooray for not having to patch libraries yourself!