Author Topic: Why is my device disabled?  (Read 6600 times)

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Why is my device disabled?
« on: January 13, 2009, 05:02:40 am »
I am trying to control an LCD via serial port, but the device will not start and is disabled. When I go to the admin site, the checkbox for disabled is checked. I uncheck the box and hit save but still nothing happens. When I restart the MD or the core, and sometimes reloading the router the checkbox will become checked again.
any ideas for me?
I can control the LCD from the command line using testserialport.sh just fine, and the LCD was recognized automatically by LMCE.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Why is my device disabled?
« Reply #1 on: January 13, 2009, 07:55:09 am »
When that device was created, it should have installed GSD - would be worth ensuring the process is running (and installed). Each device should create a log file you can access from the command line or the web admin. Tail that file. Just unchecking the disabled button will not actually start the process. However, a reload will. So tail the log file, then reload to see what gets logged.

If the log file doesn't even get created, then you will have to tail some of the other log files to see why it isn't getting spawned. There are spawn log files, and also the LM log file, even the DCERouter log file. Unfortuantely, I'm not sure which process would be responsible for disabling the device again, which is why I suggest trying to catch the error (presumably) that causes it to do this. Might give you an idea where to start... Certainly, I have created devices before where GSD didn't get installed properly, so the device wouldn't start as there was no executable in the location the device indicated...

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Why is my device disabled?
« Reply #2 on: January 13, 2009, 10:44:04 am »
I am trying to control an LCD via serial port, but the device will not start and is disabled. When I go to the admin site, the checkbox for disabled is checked. I uncheck the box and hit save but still nothing happens. When I restart the MD or the core, and sometimes reloading the router the checkbox will become checked again.
any ideas for me?
I can control the LCD from the command line using testserialport.sh just fine, and the LCD was recognized automatically by LMCE.

Look in the log files. I am pretty sure, the rs232 connection has some problems, lmce tries for up to 50 times to connect and do things, and eventually gives up, and marks the device disabled.

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Why is my device disabled?
« Reply #3 on: January 13, 2009, 03:25:08 pm »
I was trying to look on the device log file last night and noticed like Collin said that it was not even created so I didnt know where to look beyond that, should I delete the device and try again? i did the command that ensured I had the proper software installed for GSD's.

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Why is my device disabled?
« Reply #4 on: January 13, 2009, 09:50:36 pm »
Maybe you can check to see if GSD is even installed? If it failed, then there would be no binary to create the log file. I'm no expert, but I think this might give you some info:

sudo apt-get -s install pluto-generic-serial-device

It should simulate installing the package, which should then tell you if it is already installed or not - I can't double check as I am stuck in package dependency hell!

If it isn't installed, then perhaps you should try deleting and recreating the device to re-trigger the install process. Then reload before you try to use it. Then the log file should be created, the device start and you will see the process when using ps and top

If it is installed, then use ps/top to monitor the process list whilst doing a reload to see if the process even starts...

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Why is my device disabled?
« Reply #5 on: January 14, 2009, 06:06:08 am »
When I got home I deleted the device and re-added it. The LCD is still not being controlled, but at least now the device isnt showing up as disabled in the web admin, and it actually created a log, here is the output from the log.

/var/log/pluto/221_Generic_Serial_Device.log

 38:01   01/13/09 22:56:24.271      Failed loading code: Error loading code:
error: (eval):36: compile error
(eval):26: syntax error, unexpected tIDENTIFIER, expecting kEND
log('Sending ON Command') conn_.Send("ka 01 01\r")
                               ^, line: 36
. <0xb5874b90>
05   01/13/09 22:56:29.550      void ClientSocket::Disconnect() on this socket: 0x80ab5a0 (m_Socket: 8) <0xb78796c0>
Return code: 0
2   01/13/09 22:56:29   221 (spawning-device)   Shutting down... count=1/50 dev=221
Tue Jan 13 22:56:29 CST 2009 Shutdown

Any clues in there?
Here is how I have the on command written in ruby it was what came with the template--- log('Sending ON Command') <$"ka 01 01\r"$>

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Why is my device disabled?
« Reply #6 on: January 14, 2009, 06:34:11 am »
something wrong with the ruby, so it fails during initialisation of the device.

The log('Sending.... blah blah bit is what the GSD assembles from what is inside the template. So, as I understand it, the only thing you should have in your ruby codes section for the On command is:

<$"ka 01 01/r"$>

The GSD then combines this with the other part of the string (Log('Sending..) bit and exectutes it. What have you actually got in the box?

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Why is my device disabled?
« Reply #7 on: January 14, 2009, 10:32:34 am »
i think he misses a newline between the log and the _Send statement.

br Hari
rock your home - http://www.agocontrol.com home automation

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Why is my device disabled?
« Reply #8 on: January 14, 2009, 03:36:03 pm »
('Sending ON Command') <$"ka 01 01\r"$>

^^ that is exactly what is in the box for the On command

Hari: are you saying that it should be written like this..

('Sending ON Command')
<$"ka 01 01\r"$>

?

or just get rid of ('Sending ON Command')  all together?

Collin: So are you saying that it checks all the codes before it will initialize the device properly? Because this log was just from me reloading the router, i had not even send the on command to the LCD yet or any command for that matter.

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Why is my device disabled?
« Reply #9 on: January 14, 2009, 05:58:39 pm »
here is a link to the full log, maybe it can shed some more light on the situation

http://docs.google.com/Doc?id=df5mjmrp_4fr2fwrgn

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Why is my device disabled?
« Reply #10 on: January 14, 2009, 10:14:15 pm »
Krys

Yes, when the device starts it will try to "precompile" the entire code chunk based on what it pieces together from your ruby code chunks and the code it has internally for each command. You see this "program" being listed between the RCODE line and the red error messages. This only happens on device start. The thing about On is it is just telling you that compiling that piece failed. It isn't actualy trying to execute that command just yet, it is raelly just checking it. You need to get right through that section before the device will initialise.

I would just get rid of the the log bit althogether for now.

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Why is my device disabled?
« Reply #11 on: January 15, 2009, 03:54:13 pm »
alright guys, I am not exactly sure what the fix was, but I deleted the device, and went into webadmin and took our all the commands except "on" which I set to <$"ka 01 01\r"$> Reloaded and I could control the LCD from the webadmin.... I started jumping for joy and went ahead and set up my audio/video pipes. as soon as I set up the pipes I lost all control of the LCD. I tried a few things and was completely bummed. On last resort I deleted the device again and reinstalled it, went through all the same steps and it is now working as it should, I can control the TV from the orbiter and it automatically switches to the correct input when I play a video, and turns on and off automatically.... needless to say I am really enjoying it now that it works.

One question: On the LMCE demo video, the guy is watching Myth TV and wants to watch the HD feed from his STB, he clicks on live TV and it switches the input on his TV and flashes the channel to his STB, is there a button = to that on UI1, or do you have to have UI2 for that feature?

chrisbirkinshaw

  • Guru
  • ****
  • Posts: 431
    • View Profile
Re: Why is my device disabled?
« Reply #12 on: June 07, 2010, 03:06:13 pm »
This has always caused me bother - on 3 motherboards, with multiple RS232 devices (denon amp, zwave stick, onkyo, CM11A). I have tried to describe the issue in this ticket:

http://svn.linuxmce.org/trac.cgi/ticket/719

Please add if you have any more info.

Thanks,

Chris