Trying the LAN Lightbulb example in Edge drivers

I’m trying out the LAN Lightbulb example in the Edge tutorial. I’m up to the part where I’m using the phone app to have the HUB do the discovery on the ESP8266. It fails with the following:

2021-12-07T02:01:58.226098720+00:00 TRACE LAN LightBulb Setup driver LAN-LightBulb with lifecycle handlers:
DeviceLifecycleDispatcher: LAN-LightBulb
default_handlers:
driverSwitched:
added:
init:
removed:
child_dispatchers:

2021-12-07T02:01:58.243512053+00:00 TRACE LAN LightBulb Setup driver LAN-LightBulb with Capability handlers:
CapabilityCommandDispatcher: LAN-LightBulb
default_handlers:
colorControl:
setColor
switch:
on
off
refresh:
refresh
switchLevel:
setLevel
child_dispatchers:

2021-12-07T02:01:58.265041386+00:00 TRACE LAN LightBulb Server.new_with
2021-12-07T02:01:58.347124720+00:00 TRACE LAN LightBulb Server:post
2021-12-07T02:01:58.357842387+00:00 TRACE LAN LightBulb Server:listen
2021-12-07T02:01:58.419864387+00:00 TRACE LAN LightBulb Received event with handler _resync
2021-12-07T02:01:58.425454053+00:00 TRACE LAN LightBulb Received event with handler environment_info
2021-12-07T02:01:58.432997720+00:00 TRACE LAN LightBulb Received event with handler environment_info
2021-12-07T02:01:58.444190053+00:00 DEBUG LAN LightBulb Z-Wave hub node ID environment changed.
2021-12-07T02:01:58.451333053+00:00 TRACE LAN LightBulb Received event with handler discovery
2021-12-07T02:01:58.500041720+00:00 INFO LAN LightBulb ===== SCANNING NETWORK…
2021-12-07T02:01:58.533949720+00:00 INFO LAN LightBulb ===== DEVICE FOUND IN NETWORK…
2021-12-07T02:01:58.551633387+00:00 INFO LAN LightBulb ===== DEVICE DESCRIPTION AT: http://192.168.4.253:8080/upnp
2021-12-07T02:01:58.560258387+00:00 INFO LAN LightBulb ===== FETCHING DEVICE METADATA…
2021-12-07T02:01:58.643965720+00:00 ERROR LAN LightBulb discovery thread encountered error: [string “xml2lua”]:92: Incomplete XML Document [char=432]

On the device side I’m seeing this:

INCOMING TRAFFIC:
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250: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:dca13a-SN-ESP8266-696
Location: http://192.168.4.68:80/LightBulbESP8266.xml

Any suggestions?

Hi, @dcabot25!

This error is generally triggered when the parser doesn’t receive a proper XML and the reason can be that during the transmission, the UPnP message sent by the ESP was modified by a router, a proxy, or another device.

In the ESP logs, you see that the Location property is printed:

To check that is not being modified during the transmission, you should print in the driver’s logs, the url parameter included in this function. This parameter must include the same information sent by the ESP.

If you like, you could share those logs with me over a direct message or by sending an email to build@smartthings.com to discuss them further.