I am following the tutorial " Tutorial | Creating Drivers for LAN Devices with SmartThings Edge" and can’t seem to get the device registered into the SmartThings app.
I am able to configure and set up the ESP8266 with the app. I am also able to upload the driver to my SmartThings hub. Everything seems to be working until the driver tried to get the device information from the xml file on the ESP device. The ESP seems to “lock-up” after sending the location of the xml file, and therefore it seems that the Edge driver times out and tries to process a NULL message at line 38.
The source is a clone of the SampleDrivers from github
Any help in deeper troubleshooting would be much appreciated.
Here is the terminal log from the ESP8266
NodeMCU 188.8.131.52 built on nodemcu-build.com provided by frightanic.com branch: release commit: f25dc56d3c6213b8ac7ce46d1293466137746eae release: release DTS: 202112300746 SSL: false build type: float LFS: 0x0 bytes total capacity modules: file,gpio,http,net,node,pwm2,sjson,tmr,uart,wifi build 2022-06-15 21:04 powered by Lua 5.1.4 on SDK 3.0.1-dev(fce080e) > LightBulb ESP8266 App Ready... > WiFi Access Point enabled... > service: station status: connected ssid: XXXXXXXXXX bssid: e4:c3:2a:12:7e:92 service: station status: IP Address ready action: start UPnP Socket netmask: 255.255.255.0 gateway: 255.255.255.0 >>> DEVICE AVAILABLE OVER LAN AT: 192.168.1.105 INCOMING TRAFFIC: M-SEARCH * HTTP/1.1 HOST: 184.108.40.206:1900 MAN: "ssdp:discover" MX: 4 ST: urn:SmartThingsCommunity:device:LightBulbESP8266:1 SSDP RESPONSE: HTTP/1.1 200 OK Cache-Control: max-age=100 EXT: SERVER: NodeMCU/Lua5.1.4 UPnP/1.1 LightBulbESP8266/0.1 ST: upnp:rootdevice USN: uuid:6003e2-SN-ESP8266-696 Location: http://192.168.1.105:80/LightBulbESP8266.xml
Here is the associated logcat:
connecting... connected 2022-06-15T21:29:36.461603962+00:00 TRACE LAN LightBulb Setup driver LAN-LightBulb with lifecycle handlers: DeviceLifecycleDispatcher: LAN-LightBulb default_handlers: init: added: removed: driverSwitched: child_dispatchers: 2022-06-15T21:29:36.465603837+00:00 TRACE LAN LightBulb Setup driver LAN-LightBulb with Capability handlers: CapabilityCommandDispatcher: LAN-LightBulb default_handlers: refresh: refresh switchLevel: setLevel colorControl: setColor switch: on off child_dispatchers: 2022-06-15T21:29:36.473678587+00:00 TRACE LAN LightBulb Server.new_with 2022-06-15T21:29:36.476659587+00:00 TRACE LAN LightBulb Server:post 2022-06-15T21:29:36.479638129+00:00 TRACE LAN LightBulb Server:listen 2022-06-15T21:29:36.498580670+00:00 DEBUG LAN LightBulb driver device thread event handled 2022-06-15T21:29:36.501626170+00:00 TRACE LAN LightBulb Received event with handler _resync 2022-06-15T21:29:36.504757920+00:00 TRACE LAN LightBulb Received event with handler environment_info 2022-06-15T21:29:36.508690920+00:00 TRACE LAN LightBulb Received event with handler environment_info 2022-06-15T21:29:36.511569129+00:00 DEBUG LAN LightBulb Z-Wave hub node ID environment changed. 2022-06-15T21:29:36.515362212+00:00 TRACE LAN LightBulb Received event with handler discovery 2022-06-15T21:29:36.531520170+00:00 INFO LAN LightBulb ===== SCANNING NETWORK... 2022-06-15T21:29:37.551655254+00:00 INFO LAN LightBulb ===== DEVICE FOUND IN NETWORK... 2022-06-15T21:29:37.554529796+00:00 INFO LAN LightBulb ===== DEVICE DESCRIPTION AT: http://192.168.1.105:80/LightBulbESP8266.xml 2022-06-15T21:29:37.557379837+00:00 INFO LAN LightBulb ===== FETCHING DEVICE METADATA... 2022-06-15T21:29:37.570759671+00:00 ERROR LAN LightBulb discovery thread encountered error: [string "discovery.lua"]:38: attempt to index a nil value (field 'root')