Author Topic: New generic serial device  (Read 3693 times)

permo

  • Making baby steps
  • Posts: 3
    • View Profile
New generic serial device
« on: August 24, 2009, 12:36:03 pm »
Hey!

I just got my 810 install working, and I love it! Now I want to make a new gsd to get a device working. Its a rf transmitter to control lightswitches from nexa, usb connected. There is a command line app to send commands with it called rfcmd, and you run it like this: rfcmd NEXA A 1 1. That will turn on the switch with id A 1, using the NEXA protocol. I figured i could make this easy, make a new gsd, run this command in its process receive command for child with the proper ID. The thing is, I followed the wiki on how to add a new gsd, but it does not register, there is no logfile created for it, and the DCERouter.log just says: The target device 118 (routed to 118) has not registered. <0x89a70b90>. I have the gsd package installed. Anyone know what I am doing wrong?

/Per

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: New generic serial device
« Reply #1 on: August 24, 2009, 03:18:45 pm »
sometimes a gsd doesn't completely install properly until you reboot, worth a try. You need to look at all the log files in /var/log/pluto ... the spawn and appserver log files to find the error message when it tries to start the device as that will probably give you a clue ... i remember once I added one and it couldn't find the binary until I rebooted...

permo

  • Making baby steps
  • Posts: 3
    • View Profile
Re: New generic serial device
« Reply #2 on: August 24, 2009, 07:42:53 pm »
A reboot did the trick, now the device starts and registers properly! Now I just have to figure out how my device works :)

Thank you!

/Per

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: New generic serial device
« Reply #3 on: August 24, 2009, 11:02:00 pm »
no worries ... now you just need to check the commands you want the device to implement, and then insert the Ruby code snippets to actually implement those commands. In Ruby you can execute a command line like this:

system 'rfcmd NEXA A 1 1'

If you are controlling more than one device, then I believe you will need to add each device as a child to this GSD and tell the system that the GSD processes commands for that device (ie the child device is not a DCE device itself), and put each child in the appropriate entertainment area. I really do not know how to right the Ruby script so that you can pass in the correct variables so that the commands you fire have the right parameters... you will need to research some other GSDs to see how that can be done.