Pages: [1]   Go Down
Author Topic: fpv antenna tracker programming help  (Read 1278 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
i need some help here ...
i want to have an antenna tracker and i found a code for arduino but the problem i have is, that the code needs rssi ( signal strength ) input from two different video receivers and i already have an expensive diversity receiver ( 2 antennas ) which has a special tracker port for an expensive antenna tracker. this tracker port puts out different information, amongst others the rssi signal i need for the cheap tracker.

this is the stuff the tracker port puts out , i copied it from another document, the guy who posted it doesnt seem that sure but noone corrected him yet
My discovery of "Tracking link output".
Please correct me if you have other information.

Tracker Link output:
Yellow (Video) - Video output
White  (Audio L) - ???
Red (Audio R) - RS232 TTL Telemetry output

Telemetry protocol:

Bitrate:19200bps
Sends 6 byte message with frequency: ~30Hz (probably related to video frame rate)

Message example (HEX):
AA 03 75 79 96 55

AA - Sync byte
03,04 -  ??
RSSI 2 Bytes 75 - Channel1 79 - Channel2, ~12 - maximum signal, ~79 - no signal
96 - Power voltage 11v-8F 12v-9B 10v-7F
55 - end of message



and this is a link to the software i wanted to use for my arduino tracker
http://www.michael-heck.net/bilder/diversityrc305/rssi.pde



can anyone please help me , or at least show me, how i can get my rssi1 and rssi2 values from the tracker port?

unfortunately i do not know how to do that

cheers
« Last Edit: June 16, 2012, 04:12:16 pm by M4d_D » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Set your serial port to be 19200 baud.
Your loop code waits for a character available and inputs it.
If it is the Sync byte, which is 0xAA, it reads the next 5 bytes and stores the 3rd and 4th as your rssi values.
Before using them you map them to the 0-100 range that your tracker software needs.
Code:
int   rss1=0, rss2=0;
void setup()
{
   Serial.begin(19200);
}

void loop()
{
   byte  incomingByte;
   if (Serial.available() > 0)
   {
        // read the incoming byte:
        incomingByte = Serial.read();

        if (incomingByte == 0xAA)
        {
            while (Serial.available() <= 0)  ;   // just wait.  need the semicolon as a null
            Serial.read();    // waste the 2nd byte

            while (Serial.available() <= 0)  ;
            rss1 = Serial.read();

            while (Serial.available() <= 0)  ;
            rss2 = Serial.read();

            while (Serial.available() <= 0)  ;
            Serial.read();    // waste the 5nd byte
            while (Serial.available() <= 0)  ;
            Serial.read();    // waste the 6nd byte   - last of message

            rss1 = map (rss1, 0x79, 0x12, 0, 100);
            rss2 = map (rss2, 0x79, 0x12, 0, 100);
         }
     }
}
I'd verify the slight weirdness that the value for max signal is smaller than no signal.  If not, adjust the map statements appropriately.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey , thanks for that
can i just put that in front of the already existing code now and it should work ?
i just need to define an input and tell the existing code to take these values and not look at the original input ports , am i right ?

cheers
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Exactly.  Just use the rss1 and rss2 values, commenting out the first section of code.
Code:
void loop()
{
 byte  incomingByte;
   if (Serial.available() > 0)
   {
     // (Serial code as posted)
   } 

//    Map values to defined range
//    rssiTrack = map(analogRead(rssi1), 0, calibrate1, 0, 100);
//    rssiTrack = analogRead(rssi1);
//    rssiFix = map(analogRead(rssi2), 0, calibrate2, 0, 100);
//    rssiFix =analogRead(rssi2);
   
        rssiTrack = rss1;
        rssiFix = rss2;
   
   // All the rest of tracker code:
 
       //Info to searial port
       ...
}
Logged

Pages: [1]   Go Up
Jump to: