Device Installation

I have finally got to the point where I have my first device files are ready for use. I don’t yet know if they are correct (attached). I have uploaded them using the Vera upload page, created a device, and associated the device with a serial port. When I check the UPnP log I see the log messages below which appears to indicate the device file is not being found? I can see these files as /etc/cmh-ludl/D_GSMControl.xml.lzo and /overlay/etc/cmh-ludl/D_GSMControl.xml.lzo but the log messages indicate that a different directory is being checked? Any help getting me over what I hope are the final hurdles and any advice on device file structure more than welcome. (The device is to be a simple interface which other devices can call to send sms through a mobile phone attached to a serial port.)

01 11/21/12 12:13:33.812 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 9/D_GSMControl so device 9 is offline <0x2b5af000>
09 11/21/12 12:13:38.994 JobHandler_LuaUPnP::Run device 9 Send SMS room 0 type GSMControl id 123456789 parent 0/0xccacb8 upnp: 0 <0x2b5af000>
03 11/21/12 12:13:39.002 JobHandler_LuaUPnP::Run ready 9 devices installation 30101136 missing /etc/cmh-lu//D_GSMControl version 1.5.408 allow_evt: 1 allow_ud: 1 upnp 1 netpnp: 1 reprovision: 0 changed: 0 pMem 0xd42000 start 13254656 diff: 647168 <0x2b5af000>
01 11/21/12 12:22:33.897 Device_LuaUPnP::LoadDeviceDoc can’t load /etc/cmh-lu//D_GSMControl <0x2ba26000>
02 11/21/12 12:22:33.898 JobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_GSMControl <0x2ba26000>
01 11/21/12 12:22:33.898 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 9/D_GSMControl so device 9 is offline <0x2ba26000>
09 11/21/12 12:22:39.081 JobHandler_LuaUPnP::Run device 9 Send SMS room 0 type GSMControl id 123456789 parent 0/0x837cb0 upnp: 0 <0x2ba26000>
03 11/21/12 12:22:39.090 JobHandler_LuaUPnP::Run ready 9 devices installation 30101136 missing /etc/cmh-lu//D_GSMControl version 1.5.408 allow_evt: 1 allow_ud: 1 upnp 1 netpnp: 1 reprovision: 0 changed: 0 pMem 0x8af000 star

You have some XML errors … See attached snaps.

Your I_ file looks like you tried to add an XML comment in the file but it is embeded in the lua. LUA will see this as code and try to execute it! Lua comments are “–”
or long comments --[[
Multiple lines
here
]]

In the RUN there is an OK with a comment without an operator after this.

You have a line:
luup.log('GSMControl : Error Sending SMS: ’ … smsstring
No closing parenthesis.

I suggest you stub functions and slowly add code so you know what is breaking.
Or setup an environment to test your lua code.

Thanks Richard. Not a very auspicious start. I think I have fixed the errors you identified but am still getting failure message in the log so I obviously still have errors in them. I have commented out my code so it there isn’t a lot left (attached). Is there a further strategy to find the problem?

01 11/21/12 19:29:53.989 Device_LuaUPnP::LoadDeviceDoc can’t load /etc/cmh-lu//D_GSMControl <0x2b7ec000>
02 11/21/12 19:29:53.989 JobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_GSMControl <0x2b7ec000>
01 11/21/12 19:29:53.989 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 9/D_GSMControl so device 9 is offline <0x2b7ec000>
01 11/21/12 19:29:54.056 Device_LuaUPnP::CreateServices Aborting device 9 because the topmost device has no interface <0x2b7ec000>
01 11/21/12 19:29:54.056 JobHandler_LuaUPnP::CreateAllServices failed to create 9 <0x2b7ec000>
01 11/21/12 19:29:54.074 Device_LuaUPnP::CreateImplementations Aborting 9 because it failed to load <0x2b7ec000>
01 11/21/12 19:29:54.074 JobHandler_LuaUPnP::CreateAllImplementations failed to create 9 <0x2b7ec000>

You’ll want to run your XML files through an XML validator, such as this one:
The W3C Markup Validation Service

That’ll capture a bunch of issues up front. You don’t need to fix all of the issues, but in this case you have things like duplicate close elements that will need to be fixed.

You can also remove the “empty” elements (like and ) in any ACTION block where you don’t need them, just to simplify stuff for now

I have validated the device files (attached) and I did have a number of problems where I had some comments that included < and > characters. I have also cleaned out empty tags. When I restart Vera now, I am getting the error messages below, but after these, later in the log, I am getting a message (further below) which is suggesting that something has changed?

01 11/21/12 22:16:12.017 Device_LuaUPnP::LoadDeviceDoc can’t load /etc/cmh-lu//D_GSMControl <0x2b3bb000>
02 11/21/12 22:16:12.017 JobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_GSMControl <0x2b3bb000>
01 11/21/12 22:16:12.017 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 9/D_GSMControl so device 9 is offline <0x2b3bb000>
01 11/21/12 22:16:12.079 Device_LuaUPnP::CreateServices Aborting device 9 because the topmost device has no interface <0x2b3bb000>
01 11/21/12 22:16:12.079 JobHandler_LuaUPnP::CreateAllServices failed to create 9 <0x2b3bb000>
01 11/21/12 22:16:12.096 Device_LuaUPnP::CreateImplementations Aborting 9 because it failed to load <0x2b3bb000>
01 11/21/12 22:16:12.096 JobHandler_LuaUPnP::CreateAllImplementations failed to create 9 <0x2b3bb000>

09 11/21/12 22:16:17.202 JobHandler_LuaUPnP::Run device 9 Send SMS room 0 type GSMControl id 123456789 parent 0/0xdc3cb0 upnp: 0 <0x2b3bb000>

Are you sure you filled in the device_type properly when you created the device? Extension .xml, no rogue spaces.

It looks like you left off the extension, and there’s no file D_GSMControl.lzo.

I had plenty of problems but that was the problem causing the log messages. I hadn’t put the file extension on the D or I file in the device definition. Thanks guys. It’s getting late now so I will start trying to run some code tomorrow. No doubt, I will be back looking for more assistance.

I guess this reply could be a separate thread? The device files load fine now and the startup function does run. However, I can only get a single log message into the log, even though I have multiple log statements in the startup function. The first log statement encountered shows up in the log, any following ones do not. If I disable the the first one, the next one (now the first one) will show up. Is some kind of flush required? Code file attached.

The attached code results in the following output to the log. The part after the time field in red.

01 11/22/12 22:41:15.203 luup_log:9: GSMControl: Device : 9

Logging problem resolved by :

http://forum.micasaverde.com/index.php/topic,1672.msg5610.html#msg5610