We have moved at community.getvera.com

Author Topic: Invalid table during device creation  (Read 552 times)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Invalid table during device creation
« on: July 12, 2017, 01:15:39 am »
I'm trying to modify the Rainforest Smart meter which was working fine until I modified the files further and now I hit this error when trying to create a new device:
Code: [Select]
2017-07-11 21:31:43.782   openLuup.server:: GET /data_request?id=action&output_format=json&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreateDevice&Description=Alpha%20Smart%20Meter&UpnpDevFilename=D_SmartMeterHAN1.xml&UpnpImplFilename=I_SmartMeter_HAN1v2.xml&RoomNum=0&Reload=1 HTTP/1.1 tcp{client}: 0x17d5348
2017-07-11 21:31:43.782   luup.call_action:0: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.CreateDevice
2017-07-11 21:31:43.790   luup.create_device:: ERROR [49] D_SmartMeterHAN1.xml / I_SmartMeter_HAN1v2.xml /  : ./openLuup/loader.lua:282: invalid value (table) at index 1 in table for 'concat'
What is this trying to tell me?  Alas, I backed out my changes but still can't get this to behave.  I'm sure the problem is obvious, but where do I find the error?



Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Invalid table during device creation
« Reply #1 on: July 12, 2017, 02:37:33 am »
I'm trying to modify the Rainforest Smart meter which was working fine until I modified the files further and now I hit this error ...

Ah, this reminds me of a programmer who used to work for me who said:

Quote
I can't understand what went wrong - I only changed one line!

...however, I'll concede that the error message isn't terribly helpful.

Can you send me one version of the implementation file which doesn't work.  Or, for a start, you could run it through an XML syntax checker.  For better error messages, I would avoid putting anything but the barest essential Lua into an implementation file and move the to a separate .lua file.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Invalid table during device creation
« Reply #2 on: July 12, 2017, 09:26:53 am »
Okay, I'll send it.  It's telling me that the XML syntax is wrong - nothing to do with Lua syntax?  And is there anyway to know if the I_.xml or D_.xml is causing the problem from the error message?  thanks.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Invalid table during device creation
« Reply #3 on: July 20, 2017, 04:14:19 pm »
Did you ever sort this out?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Invalid table during device creation
« Reply #4 on: July 20, 2017, 05:23:51 pm »
Yes and no.  The issue is resolved, but I am not 100% sure what was wrong.  What I ended up doing is copying and pasting the newly written code into the old code and it worked fine.  I have a couple of suspicions, but I'm not certain and there isn't a lot of incentive to go back at this point.  But it's possible I had the DOS mode on instead of Unix in the editor so there were CR's, and the other choice is that it had some unacceptable XML that it was choking on.  On the other hand, I double checked the editor mode, and I ran the XML through the online web checkers and it didn't complain.  Unless I hit again I don't think I'm going to try to debug further.