Go Down

Topic: APRS and Arduino (Read 4229 times) previous topic - next topic


May 27, 2011, 06:19 pm Last Edit: May 27, 2011, 06:21 pm by dias Reason: 1
Hi all,

I'm looking to interface an arduino with a hamradio to send and receive AX25 packet for APRS MODE.

I've seen on some topic that some guy, have already done this but no code is posted.

The problem is that i'm trying to decode the trame, I've already done Call separation, but after that i'm a bit confused...

To explain you this a little diagram of the installation :

VHF -> TNC -> Arduino|-> LCD shield
                               |-> Computer

Take a look at my code :
Code: [Select]

void trameaprs() {
while (TNC.available() > 0)
   inbyte = TNC.read();      // Get the byte
   if (inbyte == '\n')          //Wiat for end trame caracter    {
   lcd.clear();       // Clear LCD
   delay(10);                 // Wait clair LCD
     //Print on serial port trame as it
     //Start decode the trame
     indicatif = strtok_r(buf,">", &parsebuf);//Get the Call
     via = strtok_r(NULL,"<", &parsebuf);//Get the via
     posetmes = strtok_r(NULL,":", &parsebuf);//clear flag <UI>:
     posetmes = strtok_r(NULL,"=", &parsebuf);//Get position and message
   //Print on LCD
     lcd.print(indicatif);//Print CALL on 1 line
     if (type == 2)
     lcd.print(via); //print path
     else if (type == 3)
     lcd.print(posetmes); //print message
   //Reset buffer
     buflen = 0;
   else if (inbyte > 31 && buflen < 260)  
   //Record each aracter of the trame until the \n appear
     buf[buflen++] = inbyte;
     buf[buflen] = 0;

As you can see my code will work fine until the trame is not a micE or weather.. for a "classic" station it's ok

Is there someone who have already try a things like this and had a working code, or someone who can help me decoding different station?



Maybe the binary character in a Mic-E packet is causing the LCD to hang? I'm not familiar enough with the LCD library (and LCDs in general) to say for sure.

Mic-E can give you 8 bit data in the lat/lon, depending on where the station is located.  Maybe the weather stations are doing the same.

Code fragments are far less easy to troubleshoot than entire programs.  For more useful help post the whole sketch.


Go Up