Difference between revisions of "Serial Hack"
(Trout, I'm not sure what you're trying to achieve here so quit screwing things up, you're NOT helping) |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category: Programmer's Guide]] | ||
+ | [[Category: Serial]] | ||
+ | [[Category: GSD]] | ||
+ | |||
+ | This should no longer be needed. If it is, please file a detailed bug report. | ||
+ | |||
== Serial List Hack == | == Serial List Hack == | ||
In some situations, (which, I might add are becoming more and more common now) a core or core/hybrid may not have enough, or indeed, any serial ports for automation kit such as the [[X10]] modules to jack into. | In some situations, (which, I might add are becoming more and more common now) a core or core/hybrid may not have enough, or indeed, any serial ports for automation kit such as the [[X10]] modules to jack into. | ||
Line 6: | Line 12: | ||
A simple replacement, which, while inferior to the current script in that it does not detect the ports in use, does correctly list all serial ports, both USB and normal serial. However, it requires the 'tree' command, so: | A simple replacement, which, while inferior to the current script in that it does not detect the ports in use, does correctly list all serial ports, both USB and normal serial. However, it requires the 'tree' command, so: | ||
+ | sudo apt-get install tree | ||
− | + | Once that has completed, tree will have been installed, and we can use its '-fi' mode to produce full paths, then it is just a simple matter of removing the original ListSerialPorts.sh file and writing our own, just copy these commands in a terminal window (see [[Editing_Text]] for alternative options), it will make a backup of the old script too: | |
− | + | ||
− | + | ||
− | Once that has completed, tree will have been installed, and we can use its '-fi' mode to produce full paths, then it is just a simple matter of removing the | + | |
− | + | mv -iv /usr/pluto/bin/ListSerialPorts.sh /usr/pluto/bin/ListSerialPorts.sh-`date '+%Y%m%d:%H%M'` && | |
− | + | cat >/usr/pluto/bin/ListSerialPorts.sh << "EOF" | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | cat >/usr/pluto/bin/ListSerialPorts.sh <<"EOF" | + | |
#!/bin/bash | #!/bin/bash | ||
Line 42: | Line 23: | ||
tree -fi /dev | grep ttyUSB | tree -fi /dev | grep ttyUSB | ||
EOF | EOF | ||
+ | |||
− | + | ==Comments== | |
− | + | ||
− | + | If someone out there has a better way of doing this, please post it here! -AVJohn | |
− | + | ||
− | + | ||
− | + |
Latest revision as of 09:24, 14 January 2010
This should no longer be needed. If it is, please file a detailed bug report.
Serial List Hack
In some situations, (which, I might add are becoming more and more common now) a core or core/hybrid may not have enough, or indeed, any serial ports for automation kit such as the X10 modules to jack into.
In these cases a USB-to-Serial converter may be used, but LinuxMCE does not list these correctly in its admin pages. This is due to the script "/usr/pluto/bin/ListSerialPorts.sh" which creates the list of serial ports, not giving the correct path (usually /dev/ttyUSB#, where # is a number).
A simple replacement, which, while inferior to the current script in that it does not detect the ports in use, does correctly list all serial ports, both USB and normal serial. However, it requires the 'tree' command, so:
sudo apt-get install tree
Once that has completed, tree will have been installed, and we can use its '-fi' mode to produce full paths, then it is just a simple matter of removing the original ListSerialPorts.sh file and writing our own, just copy these commands in a terminal window (see Editing_Text for alternative options), it will make a backup of the old script too:
mv -iv /usr/pluto/bin/ListSerialPorts.sh /usr/pluto/bin/ListSerialPorts.sh-`date '+%Y%m%d:%H%M'` && cat >/usr/pluto/bin/ListSerialPorts.sh << "EOF" #!/bin/bash tree -fi /dev | grep ttyS tree -fi /dev | grep ttyUSB EOF
Comments
If someone out there has a better way of doing this, please post it here! -AVJohn