论坛风格切换切换到宽版
  • 7257阅读
  • 10回复

APRS and APRS-IS协议学习 [复制链接]

上一主题 下一主题
离线BA5AG
 
发帖
4257
只看楼主 倒序阅读 0楼 发表于: 2006-07-24
我的一个学生做内部简报用的ppt
附件: APRS And APRS-IS Protocol.zip (0 K) 下载次数:475
离线BG6AGB
发帖
915
只看该作者 1楼 发表于: 2006-07-24
打开时提示
!   f:\documents\aprs and aprs-is protocol.zip: 不可预料的压缩文件末端

强制解压时提示
!   f:\documents\aprs and aprs-is protocol.zip: 这个压缩文件格式未知或者数据已经被损坏
离线BA5AG
发帖
4257
只看该作者 2楼 发表于: 2006-07-24
我这里没问题,存下来再打开就可以,直接打开不行
离线BG6AGB
发帖
915
只看该作者 3楼 发表于: 2006-07-24
论坛的老毛病,我用传送带下下来就ok了

不知道最新的arps协议手册是什么版本了?
离线BA7IX
发帖
4054
只看该作者 4楼 发表于: 2006-07-25
下载下来, 把后缀改为rar, 就可以了
离线BG6MGD
发帖
353
只看该作者 5楼 发表于: 2016-10-10
离线爱不交租
发帖
12284
只看该作者 6楼 发表于: 2017-02-07
有关天气的格式没有写啊
我读书少  不要骗我
离线husy
发帖
3935
只看该作者 7楼 发表于: 2017-02-17
回 爱不交租 的帖子
爱不交租:有关天气的格式没有写啊 (2017-02-07 09:55) 

气象信标的格式在哪里能找到?另外,发现APRS.FI上的气象信标都无法正常显示,求解。
LOC:OL63na
离线BG6MGD
发帖
353
只看该作者 8楼 发表于: 2017-03-06
在github上搜arduino aprs weather可以看到程序里的天气协议

内容来自Android手机客户端

离线BG6MGD
发帖
353
只看该作者 9楼 发表于: 2017-03-06
/*
APRS Weather Station
coded by Yang Lei
20120412
Beta 1.8
*/

#include <Adafruit_BMP085.h>
#include <DHT.h>

#include <Wire.h>
#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <util.h>
#define DHTTYPE DHT21
#define DHTPIN 3

//****************************************************************************
//Some network settings below.
byte mac[] = {0xDE, 0xAD, 0xBE, 0x00, 0xFE, 0x00};//Set your MAC Address here.
char SVR_NAME[] = "hangzhou.aprs2.net";
#define SVR_PORT 14580
//  define your callsign, passcode and location below
#define callsign "yourcall-13"
#define passcode "your passcode"
#define location "0000.00N/00000.00E"

#define VER "2.0"
#define SVR_PROMPT "javAPRSSrvr"
#define SVR_VERIFIED "verified"
int REPORT_INTERVAL = 10;

#define TO_LINE  10000

//****************************************************************************

EthernetClient client;//Create a client

#define DHTTYPE DHT22
#define DHTPIN 3
DHT dht(DHTPIN, DHTTYPE);
Adafruit_BMP085 bmp;

void setup()
{
  Serial.begin(9600);
  delay(2000);
  Serial.println();
  Serial.println("APRS WX Station");
  bmp.begin();
  initNet();  
}

void loop()
{
  float h =0;
  float t =0;
  float b =0;
  boolean sent = false;

  if ( dht.read() )
  {
    h = dht.readHumidity();
    t = dht.readTemperature(true);
    b = bmp.readPressure();
    
    Serial.print(h);
    Serial.print(" ");
    Serial.print(t);    
    Serial.print(" ");
    Serial.println(b);    
    
    if ( client.connect(SVR_NAME, SVR_PORT) )
    {
      Serial.println("Server connected");
      if ( wait4content(&client, SVR_PROMPT, 11) )
      {
        Serial.println("Prompt ok");
        client.print("user ");
        client.print(callsign);
        client.print(" pass ");
        client.print(passcode);
        client.print(" vers APRSduino ");
        client.println(VER);
        if ( wait4content(&client, SVR_VERIFIED, 8) )
        {
          Serial.println("Login ok");
          client.print(callsign);
          client.print(">APRS,TCPIP*:");
          client.print("!");
          client.print(location);
          client.print("_");
          client.print("000/000g000t");
          sendTemp(t);
          client.print("r000p000P000h");
          sendHumi(h);
          client.print("b");
          sendBaro(b);
          client.print("APRSWXBox ");//Sending comments
          client.println(VER);
          Serial.println("Data sent ok");
          delay(5000);
          client.stop();
          Serial.println("Server disconnected");
          delay((long)REPORT_INTERVAL*60L*1000L);
          //delay(30*1000L);
          sent = true;
        }  //  if login
        else
        {
          Serial.println("Login failed.");
        }
      }  //  if prompt
      else
      {
        Serial.println("No prompt from the server.");
      }
    }  //  if connect
    else
    {
      Serial.println("Can not connect to the server.");
    }
    if ( !sent )
    {
      initNet();
    }
  }  //  if dht.read()
  else
  {
    Serial.println("DHT fail");
  }
  delay(5000);
}

void initNet()
{
  Serial.println("Initiating net");
  
  do {
  } while ( Ethernet.begin(mac) == 0 );
  delay(1000);//wait for the Ethernet Shield for 1 second
  Serial.print("Net inited, IP:");
  Ethernet.localIP().printTo(Serial);
  Serial.println();
}

void sendTemp(float t)
{
  int i=t+0.5;
  if ( i<0 ) {
    client.print("-");
    i = -i;
    if ( i>99 )
      i=99;
    else if ( i<10 )
      client.print("0");
  } else {
    if ( i<10 )
      client.print("00");
    else if ( i<100 )
      client.print("0");
  }
  client.print(i);
}

void sendHumi(float h)
{
  int i = h+0.5;
  if ( i>99 )  i=99;
  if ( i<10 )
    client.print("0");
  client.print(i);
}

void sendBaro(float b)
{
  int i = b/10;
  if (i > 99999){
    i = 99999;
    client.print(i);}
  if (i > 10000 && i <= 99999){
    client.print(i);}
  if (i < 10000 && i >= 1000){
    client.print(0);
    client.print(i);}
  if (i < 1000 && i > 0){
    client.print(00);
    client.print(i);}
  if(i<0){
    client.print(00000);}
}

boolean wait4content(Stream* stream, char *target, int targetLen)
{
  size_t index = 0;  // maximum target string length is 64k bytes!
  int c;
  boolean ret = false;
  unsigned long timeBegin;
  delay(50);
  timeBegin = millis();
  
  while ( true )
  {
    //  wait and read one byte
    while ( !stream->available() )
    {
      if ( millis() - timeBegin > TO_LINE )
      {
        break;
      }
      delay(2);
    }
    if ( stream->available() ) {
      c = stream->read();
      //  judge the byte
      if ( c == target[index] )
      {
        index ++;
        if ( !target[index] )  
        // return true if all chars in the target match
        {
          ret = true;
          break;
        }
      }
      else if ( c>=0 )
      {
        index = 0;  // reset index if any char does not match
      } else //  timed-out for one byte
      {
        break;
      }
    }
    else  //  timed-out
    {
      break;
    }
  }
  return ret;
}

内容来自Android手机客户端

离线爱不交租
发帖
12284
只看该作者 10楼 发表于: 2017-03-20
我读书少  不要骗我