Author Topic: Starting a device  (Read 4052 times)

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Starting a device
« on: November 26, 2007, 12:06:43 am »
I'm having a problem getting my Insteon device to start when starting LinuxMCE.  I can start the executable correctly by executing

/usr/pluto/bin/Insteon -d 63


63 is the device number of the Insteon Interface.  It won't run correctly if I don't add the -d parameter.  I'm not sure this is correct, but  I got it working this way and haven't gotten around to looking at this until now. 

The LMCE launch manager tries to launch the device, but the status window says that it timed out waiting for the Insteon device to register.

The device logs shows:

== ATTEMPT FRESH START ==
1   11/25/07 14:24:07   /usr/pluto/bin/Spawn_Device.sh 63 (spawning-device)   21116 Dev: 63; Already Running list: 15,16,17,18,27,37,
== FRESH START ==
1   11/25/07 14:24:07   /usr/pluto/bin/Spawn_Device.sh 63 (spawning-device)   device: 63 ip: localhost cmd_line: Insteon
0   11/25/07 14:24:07   63 (spawning-device)   Entering 63
========== NEW LOG SECTION ==========
1   11/25/07 14:24:07   63 (spawning-device)   Starting... 1
1   11/25/07 14:24:07   63 (spawning-device)   Found ./Insteon
Return code: 126
3   11/25/07 14:24:07   63 (spawning-device)   Device died... count=1/50 dev=63
Sun Nov 25 14:24:07 PST 2007 died
========== NEW LOG SECTION ==========



I need to get this working for release, so any help is appreciated.

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: Starting a device
« Reply #1 on: November 26, 2007, 01:11:28 am »
Got any logs ?

Did you specify Binary to run properly ?

HTH,

regards,

Bulek.
Thanks in advance,

regards,

Bulek.

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Starting a device
« Reply #2 on: November 26, 2007, 01:29:32 am »
That's the only log I dug up so far.

I'm not 100% certain what you mean by specifying the Binary to run properly.  The permissions match the rest of the binaries in the usr/pluto/bin/directory.

Any ideas on where else to look?

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: Starting a device
« Reply #3 on: November 26, 2007, 03:29:44 am »
All devices will need the device ID passed to it, otherwise they are unable to determine which device instance you want to start.
The device may not be registering itself properly with DCE router.

Is your constructor calling its ancestor constructor?

Is getConfig() returning true?

I assume that it is doing what you want when run from the command line (with the device id passed in).

I think the launch manager monitors returns codes and kills devices if they are not good. I believe this is what you are seeing in your log.
Try and find what is giving you a return code of 126?

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Starting a device
« Reply #4 on: November 26, 2007, 04:21:16 am »
The constructor in the Insteon.cpp file (originally generated using DCEGen) does not call any ancestor constructors, but looking at the Zwave, code, that constructor does not do so either.

GetConfig() returns true;

It is in fact behaving correctly when run from the command line with the device ID passed in.

I notice the main file is calling Connect() which is not one that is part of the Insteon class (it must be a member function of a parent class but I can't find the function definition.  However, the function is returning true (at least when I call it from the command line) which looks to be correct.