• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

Linux INSTEON scene management software

johnnynine

Active Member
bpwwer said:
Acutally, there was a typo in the new version's file name. I've fixed it. There is a new version of the code that merges all the command line code and gui code into one package. You can now build either version from the same source.

Got it thanks.

bpwwer said:
After you untar my program, go into the iplc subdirectory and type 'make' That should build the driver. Then, as root, type 'make node' to create the device node needed. Then follow the steps above.

Excellent, this worked, thanks, and I found the resulting iplc0 file in the /dev/usb folder. I will use the insmod executable from your step #3 and pass iplc0 as the command line parameter within the /dev/usb folder.

bpwwer said:
1. plug the PLC into a usb port.
2. run detach to detach it from the HID driver (must be root)
3. insmod the iplc usb driver to install it (must be root)
4. run my program

Can I boot with the PLC already plugged in or must I plug it in after logged in?

Where do I get the "detatch" program? I don't have any files named "detatch".

bpwwer said:
4. run my program

I ran it without having the USB stuff set up and the button/menu events fired just fine, thanks.

Thanks Again!!!

Edited: fixed typo.
 

bpwwer

Member
johnnynine said:
Can I boot with the PLC already plugged in or must I plug it in after logged in?

Won't matter. The HID driver will claim the PLC as soon as it starts up or as soon as the PLC is plugged in.

johnnynine said:
Where do I get the "detatch" program? I don't have any files named "detatch".
It's in the tarfile as detach.c, you'll have to build it with 'make detach' It's a real simple program that uses libusb to detach the PLC from the HID driver.

Thanks for trying it out. I'm looking forward to some feedback once you get it working.

Bob
 

johnnynine

Active Member
It looks like I may have run into some virtual machine issues. I am using VMWare virtual machine software which apparently does not allow the connection of USB HID (Human Interface Device) by default. USB keyboard and mice are virtualized as PS/2 devices in VMWare.

To quote the manual:
USB human interface devices, such as the keyboard and mouse, are not handled though the virtual machine's USB controller. Instead, they appear in the virtual machine as a standard PS/2 keyboard and mouse, even though they are plugged into USB ports on the host.

The Insteon USB PLC is categorized as an HID device so I'm having problems getting it connected as a device.

Apparently adding the following line to the VM's .VMX file solves the problem.
usb.generic.allowHID = "TRUE"


Perhaps Microsoft's VM might work?

I'll mess around with it some more tonight and see if I can come up with anything.

Johnny
 

electron

Administrator
Staff member
I don't think Virtual PC supports USB at all. If the PowerLinc is HID compliant, then it should work in VMware.
 

johnnynine

Active Member
Ok, the VMWare usb.generic.allowHID = "TRUE" did the trick.

detach worked

I was able to successfully call "detach". When I couldn't get VMWare to acknowledge the PLC I would get an "Unable to locate 0x10bf:0x0004". When I got VMWare working, executing "detach" resulted in no console output.

insmod failed

[[email protected] ilink]# insmod /dev/usb iplc0
insmod: can't read '/dev/usb/iplc0': No such device


Is there something I can do to see what is going on?

Johnny
 

bpwwer

Member
johnnynine said:
Ok, the VMWare usb.generic.allowHID = "TRUE" did the trick.

detach worked

I was able to successfully call "detach". When I couldn't get VMWare to acknowledge the PLC I would get an "Unable to locate 0x10bf:0x0004". When I got VMWare working, executing "detach" resulted in no console output.

insmod failed

[[email protected] ilink]# insmod /dev/usb iplc0
insmod: can't read '/dev/usb/iplc0': No such device


Is there something I can do to see what is going on?

Johnny
Does /dev/usb/iplc0 exist? If not you'll need to create it first. The Makefile in the iplc directory can do this if you run 'make node'

You're really close!

If you look at the end of /var/log/messages, it should show some output when the driver loads. Something like this:

Feb 23 07:02:41 kernel: iplc.c: iplc USB #254 now attached to major 180 minor 254
Feb 23 07:02:41 kernel: usbcore: registered new driver iplc
Feb 23 07:02:41 kernel: iplc.c: Smarthome Insteon USB PowerLinc V2 Driver v0.01

Bob
 

johnnynine

Active Member
Yes it exists, when I run insmod /dev/usb iplc0 without a file, it says it can not find the file, which is a different error.
 

bpwwer

Member
johnnynine said:
Yes it exists, when I run insmod /dev/usb iplc0 without a file, it says it can not find the file, which is a different error.
I didn't look close enough at what you typed. Are your typeng 'insmod /dev/usb iplc0' ? The insmod command takes the driver file name as the first argument You need to run:

Code:
insmod ./iplc.ko

Bob
 

johnnynine

Active Member
Holy mamamia, I think that's it!!!

I ran:
insmod ./iplc.ko
which produced no console output.

Apparently .ko files (aka to non-linux users as"knock out" files, jk) are device drivers?

I then ran ./ilink, and it says "PowerLinc 00.d7.20 Ver. 2.12" in the lower left hand corner. When I was not able to get the driver up and running I believe the ilink application indicated the PowerLinc was uninitialized.

So I believe I have it up and working. Now I just need to figure out how to use it.

Is there any way to auto-discover devices?

Thanks,
John
 

bpwwer

Member
johnnynine said:
Holy mamamia, I think that's it!!!

So I believe I have it up and working. Now I just need to figure out how to use it.

Is there any way to auto-discover devices?

Thanks,
John
Great news! It's also very good to to know that it works with VMWARE. I think I'm going to set up one or two of those to get rid of a machine.

I didn't write any device discovery functions because I made sure to write down all the device id's as I installed my devices. I had them listed in a file before I even wrote the software.

I understand the method that PowerHome uses to do device discovery, and it seems like it would be quite a bit of work to get working right. I can look into it and see if I have enough low level code already there to start implimenting something lke that.

I don't have any checks in there to make sure you save before quiting. So if you do add some devices, make sure you do a save before exiting, otherwise you'll lose that work. Right now I have the program trying to read "ilink_scene.inf" on start up so if you save to that file it will automaticlly load the next time you start the program.

Most of the stuff that can have popup tips does but other than that, there's no instructions so if you have questions, ask.

Bob
 

ginigma

Active Member
Johnnynine, you're my hero, after Bob. I ordered my PowerLinc a couple days ago and now I'm kicking myself for not going for the overnight shipping!
Anyway, after following this thread it looks like I'll be up and running in 5 minutes from plugging the thing in!

Thanks for doing the leg work for us.
 

johnnynine

Active Member
Ok, I think I have it up and running...

Here are my starter questions/comments:

Does the "Ping Device" menu do anything?

What is the order of thing I should do?
Add all my devices, then discover existing scenes?

Is the PLC LED supposed to flicker all the time (like many times per second)?

Will "Discover Existing Scenes" only list the devices I have entered, even if there are really more devices in the scene?

It doesn't default to save as the filename that was loaded.

I've experienced problems with deleting devices.

It would be nice to have it ask you to save when you quit.

What is the responder?

Is the "scene group #" the button # on the a control linc for instance?

What is the difference between "Button Group" and "Scene Group #"?


Thanks,
Johnny
 

bpwwer

Member
Good questions! This is probably a good start for a FAQ....

johnnynine said:
Does the "Ping Device" menu do anything?
Not yet. The command line version does have a working ping so it just needs to be hooked up in the GUI.

johnnynine said:
What is the order of thing I should do?
Add all my devices, then discover existing scenes?
Yes, it will only look for scenes on devices that you have entered. It takes a while to discover scenes and while it is doing that, the GUI will "lock up". It should list each device in the command window as it starts to seach that device.

johnnynine said:
Is the PLC LED supposed to flicker all the time (like many times per second)?
It will flicker when it detects commands, noise or when it is communicating with the PC. If it starts flickinger at once per second very consistantly, it might need to have the coreapp re-loaded.

johnnynine said:
Will "Discover Existing Scenes" only list the devices I have entered, even if there are really more devices in the scene?
It will only search the devices you enter. It will find all the links on those devices, hmm, now that I think about it, I'm not sure what will happen if it finds a device link for a device it doesn't know about. It might crash.

johnnynine said:
It doesn't default to save as the filename that was loaded.
True, not yet.

johnnynine said:
I've experienced problems with deleting devices.
Can you elaborate?

johnnynine said:
It would be nice to have it ask you to save when you quit.
Yes, it would :) I've started adding code to keep track of when something has changaed so that it can do that.

johnnynine said:
What is the responder?
"responder" is a term SmartHome uses to designate a device that is responding to commands from another device. The controlling device is called "controller". So for a scene you have only one controller but can have many responders.

johnnynine said:
Is the "scene group #" the button # on the a control linc for instance?
Yes. For ControlLinc's it can be 1 to 5, for KeypadLinc's it can be 1 to 8. For SwitchLinc's it has to be 1. This should probably be limited based on the type of device listed as the controller.

johnnynine said:
What is the difference between "Button Group" and "Scene Group #"?
The 'Button Group' is really only used for KeypadLincs, and I believe it has to be the same value as the scene group. I haven't experimented with setting it differently to see what happens. For other devices, that field is suppose to be ignored.

I just (well, last night) added some additional screens shots to my web page. I have one of what I've started working on for KeypadLinc configuration that will allow all the XOR/Cross-linking of buttons.

Bob
 
Top