Pages: [1]   Go Down
Author Topic: APRS and Arduino  (Read 2790 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :
void trameaprs() {
while (TNC.available() > 0)
    inbyte =;      // 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?

« Last Edit: May 27, 2011, 11:21:13 am by dias » Logged

Offline Offline
Faraday Member
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Pages: [1]   Go Up
Jump to: