InsteonPLM on raspberry pi

This is what i get when i type dmesg | grep tty:

[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0x10 bcm2708.serial=0xe8161c76 smsc95xx.macaddr=B8:27:EB:16:1C:76 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 0.001739] console [tty1] enabled
[ 0.139326] 20201000.uart: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev2
[ 5.697359] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0

So I would try

insteonplm:port_0=/dev/ttyAMA0

instead of insteonplm:port_0=/dev/ttyUSB0

No luck, I get this error:
2015-09-24 00:58:28.043 [ERROR] [.o.b.i.i.driver.SerialIOStream] - got no such port for /dev/ttyAMA0 (Linux, with usb based PLM modem)
2015-09-24 00:58:28.055 [ERROR] [.o.b.i.InsteonPLMActiveBinding] - initialization complete, but found no ports!

could there be a permissions issue? I’m running under the pi accound and I start with sudo ./start.sh I would think that would grant all ther permissions needed, but I’m newish to linux so IDK.

Yes, could be a permission error, but when you start with “sudo …” openhab runs with root permission.
I do the same and have no problems at all.
Sorry, my knowledge about Linux ends at this point, you have to wait for more experienced users … :joy:

Thanks for trying

Maybe you should try what Chris recommends here:

… ls /dev/tty*` - do this with and without the stick plugged in and see what changes

Continuing the discussion from How-to Article on MakeUseOf:

Did you add the port to your startup script?
Last hint here?

Good point, but only valid for more than one usb stick attached.
It looks like @l1t7l3ph0o7 has only one stick attached …

That is correct, I only have one stick.

I have enabled debug logging and here is what it has yeilded:
2015-09-24 02:00:25.267 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - activating binding
2015-09-24 02:00:25.271 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - global binding config has arrived.
2015-09-24 02:00:25.274 [INFO ] [.o.b.i.InsteonPLMActiveBinding] - dead device timeout set to 3000s
2015-09-24 02:00:25.282 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - configuration update complete!
2015-09-24 02:00:25.291 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - initializing…
2015-09-24 02:00:25.295 [INFO ] [.o.b.i.InsteonPLMActiveBinding] - config: port_0 -> /dev/ttyUSB0 (Linux, with usb based PLM modem)
2015-09-24 02:00:25.298 [INFO ] [.service.AbstractActiveService] - InsteonPLM has been started
2015-09-24 02:00:25.358 [INFO ] [.o.b.i.InsteonPLMActiveBinding] - devices: 0 configured, 0 polling, msgs received: 0
2015-09-24 02:00:25.361 [DEBUG] [o.o.b.i.internal.driver.Poller] - starting poll thread.
2015-09-24 02:00:25.611 [DEBUG] [o.o.b.i.internal.driver.Driver] - added new port: port_0 /dev/ttyUSB0 (Linux, with usb based PLM modem)
2015-09-24 02:00:25.617 [INFO ] [.o.b.i.InsteonPLMActiveBinding] - config: service.pid -> org.openhab.insteonplm
2015-09-24 02:00:25.619 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - setting driver listener
2015-09-24 02:00:25.624 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - starting 0 ports
2015-09-24 02:00:25.631 [DEBUG] [o.o.b.i.internal.driver.Port ] - starting port /dev/ttyUSB0 (Linux, with usb based PLM modem)
2015-09-24 02:00:25.900 [ERROR] [.o.b.i.i.driver.SerialIOStream] - got no such port for /dev/ttyUSB0 (Linux, with usb based PLM modem)
2015-09-24 02:00:25.906 [DEBUG] [o.o.b.i.internal.driver.Port ] - failed to open port /dev/ttyUSB0 (Linux, with usb based PLM modem)
2015-09-24 02:00:25.909 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - ports started
2015-09-24 02:00:25.917 [ERROR] [.o.b.i.InsteonPLMActiveBinding] - initialization complete, but found no ports!
2015-09-24 02:00:25.925 [DEBUG] [.o.b.i.InsteonPLMActiveBinding] - item lampLeft binding changed: addr=27.2A.C7|prodKey:F00.00.05|feature:dimmer

I meant have you added this to your startup:

-Dgnu.io.rxtx.SerialPorts=/dev/USBrfxcom:/dev/ttyUSB0

No I have not, what file would i need to alter? and its location please, sorry I’m still learning raspbian.

If you start it via script then check the symlink description.
Otherwise your normal start-script (how do you start open hab)

I’ve added -Dgnu.io.rxtx.SerialPorts=/dev/USBrfxcom:/dev/ttyUSB0 to the bottom of start.sh

but I’m still getting the same errors

Are you starting it with start.sh oder with a script?
And can you please copy the insteon-part of your config here?

[quote=“l1t7l3ph0o7, post:17, topic:2759, full:true”][/quote]

By the way, did you put your password as username?

(Just joking …) :wink:

Good luck with solving your error …

The first thing to establish is that you can actually connect to the FTDI device at a lower level.
I use the “cu” tool like this:

cu -l /dev/ttyUSB0

just to see if I can open the port. There are a host of other tools like this (screen etc), or you could actually just try to write to the port via

echo "foo" > /dev/ttyUSB0

Run this as sudo first, then try under the userid you want to run. You may have to set udev rules (does raspian even run udev?) to create the device under group “plugdev”, and make your user id a member of “plugdev”.

There is no point trying to run the insteonplm binding until you have established at the OS level that the device is present and working.

Once you have that going, proceed with getting rxtx/java/insteonplm working.I usually don’t have to add any magic rxtx flags into the startup script. In fact I would first try without them.

when i run cu -l /dev/ttyUSB0 returns command not found, is there a package i need installed?
echo “foo” > /dev/ttyUSB0 returns nothing

I believe on ubuntu 14.04 the package
to install is called “cu”. Don’t know about raspian.

  Well, that you are not getting an error when you echo to
  /dev/ttyUSB0 is a good sign.


  Try




  cat /dev/ttyUSB0




  and watch for characters on the console, or




  cat /dev/ttyUSB0  > some_file_name.txt &




  and see if the filename grows. That would tell you if messages are
  coming in.


  You may have to flip some light switches to generate traffic.




  Are there any other usb serial devices attached that could show up
  under /dev/ttyUSB0?

I installed cu and when i run it i do get data when pressing buttons on switches around the house

I also tried cat /dev/ttyUSB0 which gets the same resault.

Ok, so that checks out.

  Now try and run openhab under the same user id that you ran the
  previous tests under (hopefully not root, that's insecure).


  Let me know what the insteonplm debug log says.




  If you have energy for it, there is another tool, more primitive
  than openhab, that shares the low-level interface with the
  insteonplm binding. You may want to see if you can get that one to
  work:

https://github.com/pfrommerd/insteon-terminal