[patch] Support for persistent USB paths

This Forum is about the Opentherm gateway (OTG) from Schelte

Moderator: hvxl

[patch] Support for persistent USB paths

Postby rickvanderzwet » Wed Nov 29, 2017 10:26 am

Persistent USB path listings are currently recognized as hostname, due to the colon in the path:

Code: Select all

Those are useful to support, since they will not change names as their /dev/ttyUSBX counterparts do, when you have multiple installed.

Since forward slash is not supported in hostname, more strict checking at hostname level should fix it:
Code: Select all
diff -ur ../otmonitor.vfs.orig/otmonitor.tcl ./otmonitor.tcl
--- ../otmonitor.vfs.orig/otmonitor.tcl   2017-11-29 10:00:59.575541879 +0100
+++ ./otmonitor.tcl   2017-11-29 10:18:34.525891843 +0100
@@ -1537,7 +1537,7 @@
   } elseif {[llength $arg] == 0} {
       # Use default/saved connection settings
-   } elseif {[regexp {^(.+):(.+)} $fn -> host port]} {
+   } elseif {[regexp {^([^/]+):(.+)} $fn -> host port]} {
       set optcfg(connection,type) tcp
       set optcfg(connection,host) $host
       set optcfg(connection,port) $port

FYI: The source code file has otmonitor.orig included, is this intended on purpose?
Code: Select all
$ unzip -t ~/otmonitor.zip  | grep orig
    testing: otmonitor.vfs/otmonitor.tcl.orig   OK
User avatar
Starting Member
Starting Member
Posts: 6
Joined: January 2017
Location: Zoeterwoude

Re: [patch] Support for persistent USB paths

Postby hvxl » Thu Nov 30, 2017 6:05 pm

Persistent USB paths only work if you always use the same USB port to connect the OTGW. For that reason I usually use an udev rule to create a symbolic link from something like /dev/otgw to the USB device. Then you can just specify "/dev/otgw" in otmonitor.

Of course you can only use that technique if you have root access. So I will implement your suggestion as that works for regular users as well. Thanks.

And no, otmonitor.tcl.orig was not supposed to be in the zip file.
Senior Member
Senior Member
Posts: 1316
Joined: June 2010

Return to Opentherm Gateway Forum

Who is online

Users browsing this forum: No registered users and 1 guest