|
SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
How-to serial port tuning?
THIS PROBLEM SEEMS TO NOW BE RESOLVED
If you are using USB to serial in multiples (4 for me) and have issues with device mappings remaining consistent, see http://forums.sagetv.com/forums/show...9&postcount=16 for my udev rules and script. B PS - Leaving the error codes in post for searching. Running Ubuntu 7.04 Server Error: Quote:
Now when trying to tune; I see this in the log: Quote:
TIA B Last edited by bcjenkins; 08-20-2007 at 03:58 AM. Reason: Problem resolved (Thanks _Demo_) |
#2
|
|||
|
|||
COM1 is mapped to ttyS0 like you expected.
_Demo_ |
#3
|
|||
|
|||
Is there a way to change the mapping, or can I symlink like I did? I just switched my main box from 2K3 to linux, and all this was working fine in windows.
Also, is there a way to make the default baud rate 9600? TIA B |
#4
|
|||
|
|||
Creating a symlink should be fine. There is no way to specify a default rate of 9600 but it already falls back to 9600 when 115200 fails.
_Demo_ |
#5
|
|||
|
|||
Upon reboot the /dev/ttyS0 symlink is destroyed and the node is put back. Is there a way to change the COM1 definition to be /dev/ttyUSB0?
TIA B |
#6
|
|||
|
|||
UDev Rules...
Most current Linux distros use udev for device file management.
You can add a rule to one of the /etc/udev/rules.d files (probably 98-local.rules or similar) Example rule: KERNEL=="ttyUSB*", SYMLINK+="ttyS%n" This will add a symlink for all numbered ttyUSB to ttyS. You could also create a link based on the serial number or product name or whatever. See tutorial below. A good tutorial on udev rules: http://www.reactivated.net/writing_udev_rules.html HTH, John |
#7
|
|||
|
|||
Thanks for that. According to /var/log/udev it set up a symlink on S0.
Quote:
B Still isn't tuning. Quote:
Last edited by bcjenkins; 08-09-2007 at 08:46 PM. |
#8
|
|||
|
|||
UDEV rule writing sucks!
So here's the deal..
I can't use just ttyS%n because it tries to link to an existing node. I tried using ttyS1% to register S10-S13 but is seems there is an artificial cap on how many ports the plugin will support. So the question is: Can I write a udev rule like: Code:
KERNEL=="ttyUSB*", SYMLINK+="ttyS{%n+4}" Failing this, I will add a ln -s /dev/ttyUSB0 /dev/ttyS4-7 to the startsage script. Although it seems silly to do so. B |
#9
|
|||
|
|||
Well, if anyone knows a simpler way, I am all ears. I wrote the following rule:
Code:
KERNEL=="ttyUSB*", PROGRAM="/opt/sagetv/server/ttyUSB_converter %n", SYMLINK+="ttyS%c" Code:
#!/bin/bash echo $[4+$1] Quote:
Now on to tuning.. B Which doesn't work!~ It hung at tuning and log indicated the tuning attempt stating it was stepping down the speed.. I let it sit for 5 mins, killed the PS window and the error log filled up with messages about the broken pipe. FYI - if I use the directv.pl from Myth, I can interact with the box all day long. Last edited by bcjenkins; 08-10-2007 at 03:17 PM. |
#10
|
|||
|
|||
UDev Serial Numbers...
Since it seems that you have a large number of usb devices, I suggest that you use the serial number(s) of the devices to define a "static" device mapping via udev. For each device, use the device's serial number to define the device name.
ie: BUS=="usb", SYSFS{serial}=="L72010011070626380", SYMLINK+="epson_680" Does that seem to be a workable solution? John |
#11
|
|||
|
|||
Hi John,
Actually there isn't a serial number for each device. A coworker and I had this discussion last week. About the only thing unique is the following: Quote:
If I can key off the parent device, then I can tie the ttyUSB# to the physical port it is plugged in to. I was going to test a reboot this morning to see if the numbering remains the same. I assume udev is processing in a 1-n order by default. B |
#12
|
|||
|
|||
Almost there!
Now I know what my wife feels like after child birth!
Serial tuning is functioning, not sure how reliable yet because everytime I reboot the ttyUSB devices are moved around. Very annoying! To resolve the serial tuning, I installed the kernel headers and downloaded a matching source from kernel.org. Side note, for some reason I could not easily find the right kernel source for Ubuntu.
This basically drops the baud rate down to 9600 for requests going in at 115200. I will go back to default drivers once SageTV figures out why it is hanging. Since my USB devices seem to be non-unique, I think I can solve this by putting them all on one hub. Then I can make the nodes based on hub port number. |
#13
|
|||
|
|||
Can you try the attached version without using your modified driver?
Thanks _Demo_ |
#14
|
|||
|
|||
No go with test lib
Quote:
Code:
/opt/sagetv/server/irtunerplugins/libDirecTVSerialControl.so: linux-gate.so.1 => (0xffffe000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ec8000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7ea1000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e94000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d53000) /lib/ld-linux.so.2 (0x80000000) B |
#15
|
|||
|
|||
Could you try the latest beta version and tell me the results. It has updated file.
Thanks _Demo_ |
#16
|
|||
|
|||
Took a few days..
Quote:
However, my USB to serial adapter scripts needed some further work.. Previously, I tried plugging all 4 devices into a cheap USB 2.0 hub I had. I think it was too much so I had to put 2 of them back on to the standard ports. At least now though I have a unique way to identify each pair of devices. Also each pair loads in the same order every time. Without further ado: bash script called by udev rules: Code:
#!/bin/bash if echo $2 | grep -q no; then if [ $[6+$1] -gt 7 ]; then echo $[4+$1] else echo $[6+$1] fi elif [ $[6+$1] -gt 7 ]; then echo $[2+$1] else echo $[4+$1] fi Code:
SUBSYSTEMS=="usb" , KERNELS=="?-?.?:?.0" , DRIVERS=="pl2303" , PROGRAM="/opt/sagetv/server/ttyUSB_converter %n hub", SYMLINK+="ttyS%c" SUBSYSTEMS=="usb" , KERNELS=="?-?:?.0" , DRIVERS=="pl2303" , PROGRAM="/opt/sagetv/server/ttyUSB_converter %n nohub", SYMLINK+="ttyS%c" B Last edited by bcjenkins; 09-06-2007 at 03:38 AM. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serial port on Motorola Cable (Comcast) box? | Fountainhead | Hardware Support | 2 | 07-16-2007 02:58 PM |
Channel Changing Issues and Serial Com Port | mike1961 | SageTV Beta Test Software | 7 | 02-21-2007 02:04 PM |
D11 linkup hardware and cabling options - calling all D11 owners | IncredibleHat | Hardware Support | 7 | 01-14-2007 02:45 AM |
serial port channel change | Ryel | Hardware Support | 1 | 11-21-2006 02:44 PM |
What's the trick to get SageTV to accept COM port 5 for serial DirecTV tuning? | mkanet | Hardware Support | 6 | 08-21-2006 08:38 PM |