InsteonPLM and Linking Devices to PowerLinc V2 USB Modem Database

Hello

Is it required to relink devices when moving PowerLinc V2 USB Modem from iMac running Indigo 4 to Raspberry Pi 3 B+ running openHABian openHAB 2.4.0-1?

Switches functioning properly with iMac, Indigo, PowerLinc V2 combo.

The openhab.log shows the following:

2019-12-14 19:26:05.836 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 2 configured, 0 polling, msgs received: 0
2019-12-14 19:26:06.150 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:30:06.154 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:34:06.157 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:36:05.841 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 2 configured, 0 polling, msgs received: 0
2019-12-14 19:38:06.163 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:42:06.165 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:46:05.846 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 2 configured, 0 polling, msgs received: 0
2019-12-14 19:46:06.167 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:50:06.171 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:54:06.174 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 19:56:05.849 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 2 configured, 0 polling, msgs received: 0
2019-12-14 19:58:06.181 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!
2019-12-14 20:02:06.185 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!

Trying to figure out why openhab will not turn on and off two switches that have been set up for testing.

For more details please visit the following link:

ā€œCompatibility with PowerLinc V2 USB 2414U w/ 2476S & 2476D?ā€

Comment one of your items. You should get a message in the logs that say item in modem but not in item.

Rekindling may be required depending on how indigo handles things.

No relinking needed.

Iā€™d suggest posting your whole log from openHAB start so we can figure out why you canā€™t download the modemā€™s DB. It is almost always a problem with getting the correct port put into the cfg file or permissions or some incomparable version of Java.

1 Like

Hello Tom

Below is the contents from openhab.log after rebooting.

2019-12-15 09:23:58.966 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel

2019-12-15 09:23:59.030 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder

2019-12-15 09:24:06.912 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ā€˜insteon.itemsā€™

2019-12-15 09:24:10.639 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

2019-12-15 09:24:11.187 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ā€˜masterbedroom.sitemapā€™

2019-12-15 09:24:12.519 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://xxx.xxx.xxx.xxx:XXXX

2019-12-15 09:24:12.523 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://xxx.xxx.xxx.xxx:XXXX

2019-12-15 09:24:12.937 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui

2019-12-15 09:24:13.204 [INFO ] [nding.insteonplm.InsteonPLMActivator] - Insteon PLM binding has been started.

2019-12-15 09:24:13.531 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - refresh interval set to 600s

2019-12-15 09:24:13.533 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - poll interval set to 300000 per config file

2019-12-15 09:24:13.535 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - setting modem db retry timeout to 240s

2019-12-15 09:24:13.536 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - dead device timeout set to 3000s

2019-12-15 09:24:13.540 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: poll_interval -> 300000

2019-12-15 09:24:13.543 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: modem_db_retry_timeout -> 240000

2019-12-15 09:24:13.545 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: port_0 -> /dev/ttyAMA0

2019-12-15 09:24:13.549 [INFO ] [b.core.service.AbstractActiveService] - InsteonPLM has been started

2019-12-15 09:24:13.570 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 0 configured, 0 polling, msgs received: 0

2019-12-15 09:24:13.602 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: refresh -> 600000

2019-12-15 09:24:13.604 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - config: service.pid -> org.openhab.insteonplm

2019-12-15 09:24:13.686 [INFO ] [onplm.internal.driver.SerialIOStream] - successfully opened port /dev/ttyAMA0

2019-12-15 09:24:13.914 [INFO ] [eemulation.internal.ConfigManagement] - Hue Emulation pairing disabled. Service available under /api

2019-12-15 09:24:14.795 [WARN ] [r.internal.EmbeddedBrokerServiceImpl] - Embedded broker offline - Reason unknown

2019-12-15 09:24:14.903 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ā€˜127.0.0.1ā€™ with clientid embedded-mqtt-broker and file store ā€˜/var/lib/openhab2/mqtt/127.0.0.1ā€™

2019-12-15 09:24:14.952 [WARN ] [mqtt.internal.MqttPersistenceService] - mqtt-persistence:broker

2019-12-15 09:24:14.956 [WARN ] [mqtt.internal.MqttPersistenceService] - mqtt-persistence:topic

2019-12-15 09:24:14.959 [WARN ] [mqtt.internal.MqttPersistenceService] - mqtt-persistence:message

2019-12-15 09:24:15.060 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=embedded-mqtt-broker

2019-12-15 09:24:15.082 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=embedded-mqtt-broker

2019-12-15 09:28:13.780 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!

2019-12-15 09:31:30.634 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - Item: bedroom got command ON

2019-12-15 09:31:30.651 [INFO ] [onplm.internal.device.CommandHandler] - LightOnOffCommandHandler: sent msg to switch xx.xx.xx to on

2019-12-15 09:31:30.655 [INFO ] [onplm.internal.device.CommandHandler] - Sending message to xx.xx.xx

2019-12-15 09:32:13.784 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!

2019-12-15 09:32:39.100 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - Item: bedroom got command OFF

2019-12-15 09:32:39.104 [INFO ] [onplm.internal.device.CommandHandler] - LightOnOffCommandHandler: sent msg to switch xx.xx.xx off

2019-12-15 09:32:39.108 [INFO ] [onplm.internal.device.CommandHandler] - Sending message to xx.xx.xx

2019-12-15 09:33:15.759 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - Item: bedroom got command ON

2019-12-15 09:33:15.773 [INFO ] [onplm.internal.device.CommandHandler] - LightOnOffCommandHandler: sent msg to switch xx.xx.xx to on

2019-12-15 09:33:15.777 [INFO ] [onplm.internal.device.CommandHandler] - Sending message to xx.xx.xx

2019-12-15 09:34:13.573 [INFO ] [g.insteonplm.InsteonPLMActiveBinding] - devices: 2 configured, 0 polling, msgs received: 0

2019-12-15 09:36:13.790 [WARN ] [onplm.internal.device.ModemDBBuilder] - modem database download unsuccessful, restarting!

Are you using moquette (listed under Misc in PaperUI) as broker? If so remove it and use mosquitto. Itā€™s listed under Bindins in PaperUI.

Also if running OH 2.4 and using files for configuration of mqtt you will need to restart OH after any change to the file. This is a bug in 2.4 that has been fixed in later versions.

Installed MQTT Binding 2.4.0 under binding but have not configured it.

Make sure you have uninstall the other mqtt binding and configure the new mqtt thing as running both will lead to further issues.

I highly suspect you have the wrong port. Your log file says it is trying to connect to your PLM via /dev/ttyAMA0. This is the built in serial port (I think) on the Raspberry PI, but it is almost definitely not your USB PLM. I also run OpenHAB on a RPI, but my setup is a little different where I have a USB->Serial converter with a serial PLM plugged into it.

On Linux, USB serial devices typically get enumerated as /dev/ttyUSBn where n = numbers from 0-whatever. I have two different USB->Serial converters, so I have a /dev/ttyUSB0 and a /dev/ttyUSB1. Iā€™m not 100% sure but I believe the Insteon USB PLMs are essentially a serial PLM with a USB->Serial converter inside the PLM box so I think it might behave the same.

Since you say you are coming from an iMac, not sure how familiar you are with Linux, but I would do this:

ls -al /dev | grep tty

Hopefully youā€™ll see something like this (along with a bunch of other tty devices:

crw-rw----  1 root dialout 188,   0 Dec 15 11:09 ttyUSB0

If you do and you donā€™t have any other USB devices connected it is pretty likely to be your PLM.

Next go edit your /etc/openhab2/services/insteonplm.cfg file. You should have a line like this:

insteonplm:port_0=/dev/ttyUSB0

Note: if yo \u have more than one USB Serial device things get a little more tricky as youā€™ll have to write some udev rules, but Iā€™d simplify things first and just have the PLM plugged in for now.

Once you do all that, restart OH and see if you get a modem DB to download.

Hope this helps.

Hi Tom

Results from ls -al /dev | grep tty

crw-rw---- 1 root dialout 204, 64 Dec 15 10:53 ttyAMA0

lrwxrwxrwx 1 root root 7 Dec 15 10:53 serial1 -> ttyAMA0

insteonplm.cfg

port_0=/dev/ttyAMA0
modem_db_retry_timeout=240000
poll_interval=300000
refresh=600000

I think you will need to add openhab user to dialout and tty group. You can use the openhabian tool to fix these permissions. sudo openhabian-config

Try unplugging your PLM from the RPI and run the command again. I could be wrong, but Iā€™m pretty sure this is the built in RPI serial port.

https://www.raspberrypi.org/documentation/configuration/uart.md

If that device is still there with the PLM unplugged this is definitely not your PLM.

If this is correct and /dev/AMA0 is still seen with ls -al /dev | grep tty with the PLM unplugged, Iā€™d try this:

With PLM unplugged: type:

dmesg

Now, plug in the PLM and immediately do the same command again. The new lines you see might provide a clue as to how the PLM is connecting or show errors that are preventing it from connecting.

Hi Tom

With the PLM plugged in dmesg shows the following:

[ 0.897268] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2

[ 1.251813] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 1.254495] Indeed it is in host mode hprt0 = 00001101
[ 1.492117] usb 1-1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[ 1.497376] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.500860] hub 1-1:1.0: USB hub found
[ 1.503764] hub 1-1:1.0: 4 ports detected
[ 1.821810] usb 1-1.1: new high-speed USB device number 3 using dwc_otg

[ 1.952212] usb 1-1.1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3

[ 1.959903] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.966339] hub 1-1.1:1.0: USB hub found
[ 1.969313] hub 1-1.1:1.0: 3 ports detected

[ 2.071819] usb 1-1.2: new low-speed USB device number 4 using dwc_otg
[ 2.225709] usb 1-1.2: New USB device found, idVendor=10bf, idProduct=0004, bcdDevice= 4.00
[ 2.232391] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.235855] usb 1-1.2: Product: SmartHome PowerLinc USB E
[ 2.239008] usb 1-1.2: Manufacturer: SmartHome
[ 2.258411] hid-generic xxxx.xxxx.xxxx.xxxx: hiddev96,hidraw0: USB HID v1.00 Device [SmartHome SmartHome PowerLinc USB E] on usb-3f980000.usb-1.2/input0

[ 2.741827] usb 1-1.1.1: new high-speed USB device number 5 using dwc_otg

[ 2.882242] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800, bcdDevice= 3.00
[ 2.889094] usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

[ 3354.811790] usb 1-1.2: USB disconnect, device number 4
[ 3569.125426] usb 1-1.2: new low-speed USB device number 6 using dwc_otg
[ 3569.274761] usb 1-1.2: New USB device found, idVendor=10bf, idProduct=0004, bcdDevice= 4.00
[ 3569.274774] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3569.274784] usb 1-1.2: Product: SmartHome PowerLinc USB E
[ 3569.274794] usb 1-1.2: Manufacturer: SmartHome
[ 3569.290828] hid-generic xxxx.xxxx.xxxx.xxxx hiddev96,hidraw0: USB HID v1.00 Device [SmartHome SmartHome PowerLinc USB E] on usb-3f980000.usb-1.2/input0

hmm - I donā€™t see any clues here about what port it is connected to. I think Iā€™m out of ideas unfortunately but ti seems to me that /dev/ttyAMA0 is not the PLM, but the built in RPI serial device. Iā€™d suggest searching for how people have used USB PLMs here. Mine is serial so I canā€™t try to figure it out.

Hi Tom

With the PLM unplugged dmesg shows the following:

[ 0.071348] usbcore: registered new interface driver usbfs
[ 0.071430] usbcore: registered new interface driver hub
[ 0.071541] usbcore: registered new device driver usb

[ 0.305619] usbcore: registered new interface driver lan78xx
[ 0.308083] usbcore: registered new interface driver smsc95xx

[ 0.897262] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2

[ 0.797067] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19

[ 0.801574] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.804018] usb usb1: Product: DWC OTG Controller
[ 0.806388] usb usb1: Manufacturer: Linux 4.19.75-v7+ dwc_otg_hcd
[ 0.808808] usb usb1: SerialNumber: 3f980000.usb
[ 0.811776] hub 1-0:1.0: USB hub found
[ 0.814046] hub 1-0:1.0: 1 port detected

[ 1.241811] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 1.244466] Indeed it is in host mode hprt0 = 00001101
[ 1.482099] usb 1-1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[ 1.487361] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.490843] hub 1-1:1.0: USB hub found
[ 1.493704] hub 1-1:1.0: 4 ports detected
[ 1.811814] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 1.816526] systemd[1]: System time before build time, advancing clock.
[ 1.942116] usb 1-1.1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[ 1.947713] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.951334] hub 1-1.1:1.0: USB hub found
[ 1.954319] hub 1-1.1:1.0: 3 ports detected

[ 2.821830] usb 1-1.1.1: new high-speed USB device number 4 using dwc_otg

[ 2.952348] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800, bcdDevice= 3.00

[ 2.958734] usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0

Have you tried to see if you can access the device using Insteon Terminal? https://github.com/pfrommerd/insteon-terminal

Hello Rob N.

Attempted to use insteon-terminal. Was able to connect to PLM but it hung at modem.getdb()

Please visit the following link for more details:

Compatibility with PowerLinc V2 USB 2414U w/ 2476S & 2476D?

Hi

Is that required if insteon-terminal can connect to the PLM using
connectToSerial(ā€œ/dev/ttyAMA0ā€)?

It seems that a connection can be made but modem.getdb() just hangs.

Is it false positive and insteon-terminal is not really connected?

Since /dev/ttyAMA0 is an actual serial port that insteon-terminal is pretty happy with being connected to it. Its just that no actual PLM is connected to the other end so trying to communicate with it hangs.

ā€¦or that is at least what I suspectā€¦ :~)

So something I was thinking about. Back when I was trying to get my USB-Serial converter working for one of my serial devices (I have an insteon PLM as well as an old X10 device) I couldnā€™t get it to register as a serial port. Turned out I needed to add a kernal module for this device. Once I did, it was automatically assigned a port when plugged in.

As an example, I unplugged one of my USB Serial converters and replugged back in. Here is what I saw:

[2222481.592728] usb 1-1.5: USB disconnect, device number 6
[2222481.593138] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[2222481.593178] ftdi_sio 1-1.5:1.0: device disconnected
[2222488.802414] usb 1-1.5: new full-speed USB device number 7 using dwc_otg
[2222488.961110] usb 1-1.5: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[2222488.961120] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2222488.961125] usb 1-1.5: Product: FT232R USB UART
[2222488.961130] usb 1-1.5: Manufacturer: FTDI
[2222488.961135] usb 1-1.5: SerialNumber: AH060VJ1
[2222488.969045] ftdi_sio 1-1.5:1.0: FTDI USB Serial Device converter detected
[2222488.969157] usb 1-1.5: Detected FT232RL
[2222488.969978] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB2

Notice the last line where It says it is not attached to ttyUSB2. Your output from dmesg never shows that. Infact it looks like it connects, finds no driver and disconnects, then reconnects for a 2nd attempt. This is exactly what my USB-Serial used to do too.

I think it is actually not this USB-Serial converter that I showed the example for, but I had to add the following to my /etc/modules in order to get this to load properly.

pl2303

You might want to search to see what kind of kernal module driver might need to be loaded to get a USB PLM to work.