externally controlled rotor, how to check for dish positioned?
Added by Luca Olivetti almost 6 years ago
Hello,
my aim is to control an old style actuator jack with an arduino and a couple of relays (similar to the setup I used until now with vdr and a parallel port).
As a first step I added a new kind of rotor linuxdvb_rotor_external, the idea is to spawn an external command which in turn will send the positioning command to the arduino.
However I don't like to just wait for an amount of seconds: I know where the dish is, and I'd much prefer to go on with the tuning once the dish is positioned.
Due to my limited understanding of the code, I couldn't find where in the chain I could insert such a check, i.e., instead of "wait x seconds then tune" (where x is the value returned by linuxdvb_rotor_tune), I'd like to implement this kind of sequence:
- move the dish to position X
- check if position X has been reached
- go on with the tuning once it has been reached or wait until it has
Can you tell me if it's possible to implement something like that?
I suppose it would not be correct to not return from linuxdvb_rotor_tune while the dish is moving, would it?
Replies (6)
RE: externally controlled rotor, how to check for dish positioned? - Added by Luca Olivetti almost 6 years ago
Luca Olivetti wrote:
I suppose it would not be correct to not return from linuxdvb_rotor_tune while the dish is moving, would it?
I tried and the web interface freezes, so the answer is "it's not correct"
RE: externally controlled rotor, how to check for dish positioned? - Added by Ron L almost 4 years ago
Did you ever manage to get this working? I have a glitchy setup trying to pass gotox commands to a V-Box through an alternate DVB device. On my machine the command to turn my dish to satellite at 89W for example is...
/usr/local/bin/rotor -gotox 89
This works fine. Diseqc is sent to V-Box by device 0 and LNB coax is connected to device 1 for tuning. If I use the loop through on V-Box there is over 4dB loss. Too much and most signals won't lock.
In TVHeadend config for
External rotor command:/usr/local/bin/rotor -gotox
for
Rotor: External position:89
Not working. Don't know if spawn is running rotor command at all.
From debug...
Jan 4 15:12:11 guitar tvheadend[1390]: http: 192.168.20.99: using ticket 91db383b658d0ea8312ecdda64604847ab09945f for /stream/channel/0ab8edbce7bf8bc03cac8f157c9e317d Jan 4 15:12:11 guitar tvheadend[1390]: mpegts: 3880V in 089 - tuning on TurboSight TBS QBOX2-CI DVB-S/S2 #1 : DVB-S #0 Jan 4 15:12:11 guitar tvheadend[1390]: diseqc: initial sleep 100ms Jan 4 15:12:12 guitar tvheadend[1390]: diseqc: site: lat 55.0000, lon 241.0000, alt 750.0000; sat lon 271.0000 Jan 4 15:12:12 guitar tvheadend[1390]: diseqc: rotor angle azimuth 144.4845 elevation 21.5936 Jan 4 15:12:12 guitar tvheadend[1390]: spawn: 45 78 65 63 75 74 69 6E 67 20 22 2F 75 73 72 2F Executing "/usr/ Jan 4 15:12:12 guitar tvheadend[1390]: spawn: 6C 6F 63 61 6C 2F 62 69 6E 2F 72 6F 74 6F 72 20 local/bin/rotor Jan 4 15:12:12 guitar tvheadend[1390]: spawn: 2D 67 6F 74 6F 78 22 0A -gotox". Jan 4 15:12:12 guitar tvheadend[1390]: spawn: Executing "/usr/local/bin/rotor -gotox" Jan 4 15:12:12 guitar tvheadend[1390]: diseqc: no output from external command Jan 4 15:12:12 guitar tvheadend[1390]: diseqc: linuxdvb_rotor_extcmd moving to 89 returned -1 Jan 4 15:12:16 guitar tvheadend[1390]: subscription: 0019: restarting channel CBS HD East Jan 4 15:12:18 guitar tvheadend[1390]: mpegts: 3880V in 089 - tuning on TurboSight TBS QBOX2-CI DVB-S/S2 #1 : DVB-S #0 Jan 4 15:12:18 guitar tvheadend[1390]: diseqc: initial sleep 100ms Jan 4 15:12:18 guitar tvheadend[1390]: diseqc: site: lat 55.0000, lon 241.0000, alt 750.0000; sat lon 271.0000 Jan 4 15:12:18 guitar tvheadend[1390]: diseqc: rotor angle azimuth 144.4845 elevation 21.5936 Jan 4 15:12:18 guitar tvheadend[1390]: spawn: 45 78 65 63 75 74 69 6E 67 20 22 2F 75 73 72 2F Executing "/usr/ Jan 4 15:12:18 guitar tvheadend[1390]: spawn: 6C 6F 63 61 6C 2F 62 69 6E 2F 72 6F 74 6F 72 20 local/bin/rotor Jan 4 15:12:18 guitar tvheadend[1390]: spawn: 2D 67 6F 74 6F 78 22 0A -gotox". Jan 4 15:12:18 guitar tvheadend[1390]: spawn: Executing "/usr/local/bin/rotor -gotox" Jan 4 15:12:18 guitar tvheadend[1390]: diseqc: no output from external command Jan 4 15:12:18 guitar tvheadend[1390]: diseqc: linuxdvb_rotor_extcmd moving to 89 returned -1 Jan 4 15:12:22 guitar tvheadend[1390]: subscription: 0019: restarting channel CBS HD East
Am I entering things incorrectly in TVH config? Any ideas? This would be a very handy feature to have available.
RE: externally controlled rotor, how to check for dish positioned? - Added by Luca Olivetti almost 4 years ago
Yes, it works here.
I think your problem is that the external command parameter is treated as a single string, so it's trying to execute "/usr/local/bin/rotor -gotox" instead of /usr/local/bin/rotor and passing -gotox as a parameter.
I suggest you try a shell script like this
#!/usr/bin/bash /usr/local/bin/rotor -gotox $1 > /dev/null echo 1
make it executable and use it as the external command.
The > /dev/null is only needed if the rotor command has any output, and the echo 1 is needed since tvheadend expects a numerical value, indicating the approximate time in seconds to reach the position.
RE: externally controlled rotor, how to check for dish positioned? - Added by Ron L almost 4 years ago
Excellent. Thank you. That did the trick.
To adjust the tuning delay while the motor is rotating the dish the echo 1 can be changed? echo 5 or echo 10 etc.? The Motor rate (milliseconds/deg): calculator is not used in this case I gather.
RE: externally controlled rotor, how to check for dish positioned? - Added by Luca Olivetti almost 4 years ago
That's up to you. In my script I calculate the time depending on the current position and the destination, and, yes, IIRC the motor rate is not used.
RE: externally controlled rotor, how to check for dish positioned? - Added by Ron L almost 4 years ago
Right that is probably a better idea. I assume don't send 0 or does that matter? I made the script so it will send 1 instead of 0 any way.
Again thank you very much for your help with this.