Removing bad entries from modem db

Is there a way to remove old devices from the 2012 hub modem db? I tried insteon terminal, but it does not look like it work wish 2012 hub. Ideally the insteonplm would allow for some basic add/delete functionality.

I had some rudimentary add/delete functionality in the insteonplm binding but it was hard to use so I removed it eventually.

@dan_pfrommer and I wrote the InsteonTerminal for exactly that purpose. I will send him a note to add the 2012 hub. Should be easy since the InsteonTerminal uses the same connectivity layer as openhab.

@sipvoip

I’ve added (untested) support for the 2012 hub to the terminal. You can connect either by configuring connectToMyLegacyHub() in the init.py or using connectToLegacyHub(host, port) through the command line.

The addition and removal of links in the modem database can be done through the commands in the Modem2413U class.
For a list of methods in the class use

help(Modem2413U)

The legacy hub support has not been tested (as I have no legacy hub to test it on). If you encounter any difficulties, please let me know.

[root@marge insteon-terminal]# ./insteon-terminal
Insteon Terminal
Python interpreter initialized…

connectToLegacyHub(“10.71.129.10”, 9761)

modem.getdb()
16:14:14.232 [Thread-2] ERROR u.pfrommer.insteon.cmd.msg.MsgReader - incoming message does not start with 0x02, searching for start

I can get the id(), just not the db()

modem.getid()
sent msg: OUT:Cmd:0x60|

getid got msg: IN:Cmd:0x60|IMAddress:25.DC.72|DeviceCategory:0x03|DeviceSubCategory:0x37|FirmwareVersion:0x9C|ACK/NACK:0x06|

@sipvoip

I think I know what’s going on. The insteon terminal uses an ancient version of the binding’s parsing code, which is rather unrobust to bytes being dropped. Unfortunately, the old hub has a tendency to drop bytes mid-message, which is probably the cause of the error. I’ll put updating that on my to-do list and try to get to it as soon as possible (probably today or tomorrow).

Do you get the error every time you try to access the database?

Also, for debugging purposes you can monitor the messages sent and received from the PLM using trackPort() (requires a graphical display, unfortunately). That might help track down what exactly is going wrong.

@sipvoip

Updated the message reading code. It should’ve fixed the issue, as the messaging code should now be up-to-date with the binding’s.

Just a heads up: After pulling, make sure you run

ant jar

or the insteon-terminal executable will still be using the old version.

Any idea how to cut and paste from that? A bunch of data went in/out when I typed modem.getdb(), but then it froze, last thing I saw was:

IN: 02 6A 06
IN: 02 57 E2 F7 28 A5 DD 01 00 F7
OUT: 02 6A
IN: 02 6A 06

I think it may have to do with the size of my db and getting a bad command. I connected another 2012 hub to the internet (50.246.121.170, 9761). Sometimes I can do a modem.getdb(), but if I hit up arrow and enter a few times it will lock up. I also tried to do a modem.nukeDB() and it locks up every time.

Feel free to play with it, its a hub that I am not using so you can do whatever you want to it.

Have you pulled and used the new code? (don’t forget to re-run ant jar)

I connected to your modem and pulled the database seven times times. With the new code, it only gave a bad message error once, and even then still correctly pulled the database.

Note that I didn’t test nuking the database, as didn’t want to mess around with your insteon network.

Try nuking the db, its a test hub, not related to my network.

modem.nukeDB()
nuking 16 records
Traceback (most recent call last):
File “”, line 1, in
File “/root/insteon-terminal/./python/modem2413U.py”, line 260, in nukeDB
self.dbbuilder.nukeDB(self)
File “/root/insteon-terminal/./python/dbbuilder.py”, line 212, in nukeDB
modem.deleteFirstRecord(rec[“addr”], rec[“group”])
AttributeError: Modem2413U instance has no attribute ‘deleteFirstRecord’

This seems like a bug in the scripted part of the insteon terminal. I’ll take a look at it as soon as I finish some re-writing of parts of the terminal.