ESP8266 for HDLC decoding, AX.25, APRS (2024)

ESP8266 for HDLC decoding, AX.25, APRS

tags:Arduinoalgorithm

/**************************************************************Function name: aprs_wait_begin() Parameters: None Return value: bool true = get legal pulse, false = not get Explanation: Wait for the first 833us high pulse, the judgment range is 730-930, others are ignored***************************************************************/bool aprs_wait_begin(){static unsigned long lastTime = micros();static unsigned char lastLevel = digitalRead(APRS_DATA_IO);unsigned char nowLevle = digitalRead(APRS_DATA_IO);//Rising edge, set the pulse start timeif(nowLevle && !lastLevel){lastLevel = nowLevle;lastTime = micros();}//Falling edge, judge the pulse widthelse if(!nowLevle && lastLevel){long pulseTime = micros()-lastTime;lastLevel=nowLevle;//Legal pulse is judged at 833us plus or minus 100us, it can be smallerif(pulseTime>730 && pulseTime<930){return true;}}return false;} //end aprs_wait_begin()/************************************************************** Function name: aprs_rx_data() Parameters: None Return value: None Explanation: This function is in blocking mode and will not exit before the reception is completed or timeout 1200bps, 1200 bits per second, 833us per bit width Level flip = logic 0, level remains unchanged = logic 1 After getting the first legal pulse, start to receive data in bytes, and save it once every 8 bits At this time, you will also receive Flag:0x7E, that is: 6 consecutive "1"s Check the value of sameBit when the level is flipped 6 consecutive "1" bytes are the first byte of data And mark isData=1; Received again 6 consecutive "1"s have been received In any case, receiving 7 consecutive "1" judgment data is invalid Set the sameBit to 0 after each level flip, the last time increases the current time +450us, Ensure that every 833us backward sampling point is stuck in the middle of each bit***************************************************************/void aprs_rx_data(){unsigned char bitBuf=0x00; //bit buffer receives the low bit firstunsigned char bitCount=0; //bit counter, once every 8 bits are written to the bufferunsigned char sameBit=0; //Continuous 1 counterunsigned char isData=0; //Whether the data segmentunsigned char lastLevel = digitalRead(APRS_DATA_IO);unsigned char nowLevle;unsigned long lastTime;unsigned long nowTime;//The previous program caught the first legal pulse, so it received a level flip that is "0", and the bit counter is now 1bitCount = 1; lastTime = micros() + 450;while(1){ESP.wdtFeed(); //Feed the dog, I don’t know why ESP8266 triggers the watchdog in the while.//delayMicroseconds(10);nowLevle = digitalRead(APRS_DATA_IO);nowTime = micros();//Level flipif(nowLevle != lastLevel){lastLevel = nowLevle;lastTime = nowTime+450;//According to the HDLC protocol, we regard Flag 0x7E as 6 consecutive "1"s, and insert 5 consecutive "1"s into the data to avoid 6 "1"s.//Here when less than 5, set to 0if(sameBit<5){sameBit=0;}//6 consecutive "1"s appeared, which means the end when receiving dataif(sameBit==6 && isData){toCodeFlag=1;return;}//5 consecutive "1"s, delete 0, ignore this bit and continue will bring the program back to the starting point of whileif(sameBit==5){sameBit=0; continue;}//The number of bits reaches 8, and the full 1 byte is processed accordinglyif(++bitCount==8){//Received bytes that are not 6 consecutive "1"s in the non-data segment, indicating the beginning of the dataif(!isData && sameBit != 6){isData=1;}if(!isData){continue;}//isData = 0;if(aprsCount == APRS_DATA_BUF_MAX){aprsCount=0;}aprsData[aprsCount++]=bitBuf;bitCount=0;bitBuf=0x00;}continue;}//When the level is maintained at 833us, logic 1 is obtainedif(nowTime>lastTime && (nowTime - lastTime) > 833){lastTime = nowTime;//During the data transmission process, any 7 consecutive "1"s that appear before the Flag are judged to be abnormal, and no decoding is performedif(++sameBit==7){toCodeFlag=0;return;}//Fill "1" to the specified positionbitBuf |= 0x01 << bitCount;//Collect 1 byteif(++bitCount==8){if(aprsCount == APRS_DATA_BUF_MAX){aprsCount=0;}aprsData[aprsCount++] = bitBuf;bitCount=0;bitBuf=0x00;}continue;}}// end while}//end aprs_rx_data()

Copyright ComplaintSpam Report

Intelligent Recommendation

Data Link Layer: HDLC

A. Protocol Machine The sender and receiver, while the finite state machine the protocol is formulated as a four-tuple (S, M, I, T), where you S that the process and the channel may enter the set, M i...

HDLC&PPP

Huawei: HDLC configuration: R1<Huawei>system-view [Huawei]sysname AR1 [AR1]interface Serial 1/0/0 [AR1-Serial1/0/0]link-protocol hdlc —— (Enable HDLC) Warning: The encapsulatio...

MGRE, PPP, HDLC experiment

table of Contents Topology design Topology construction Configuration &...

Configure HDLC under ensp

Advanced Data Link Control HDLC PPP point-to-point protocol HDLC interface address borrowing Without an IP address, an interface cannot generate a route and cannot forward packets. IP address borrowin...

HDLC frame format

The DLMS communication link frame basically adopts the HDLC frame format. HDLC except for a few special fields, the other fields are all hexadecimal data, This chapter I mainly share what is HDLC fram...

More Recommendation

PPP protocol and HDLC protocol

PPP protocol and HDLC protocol 1. WAN 2. Features of PPP protocol 3. Requirements that the PPP protocol should meet 4. Requirements that the PPP protocol does not need to meet 5. The three components ...

HDLC and PPP verification

1. Brief introduction 1. The high-level data link control (HDLC) protocol is based on a data link layer protocol, which promotes the data transmitted to the next layer to be accurately received...

Application of HDLC and PPP

HDLC and PPP Serial links are often used in wide area networks to provide long-distance data transmission. HDLC (High-Level Data Link Control) and Point to Point Protocol (PPP) are two typical serial ...

Principle and configuration of HDLC and PPP

Introduction: Serial links are often used in wide area networks to provide long-distance data transmission. HDLC (High-Level Data Link Control) and Point to Point Protocol (PPP) are two typicalSerial ...

Router's WAN HDLC encapsulation

HDLC calls advanced data link control Turn off the power first, then add W1C-1T module to the router, and finally turn on the power Add DCE serial line RA is the same as RB, before 255 is changed to 2...

  • Related Posts
  • Create an APRS meteorological station using ESP8266
  • ESP8266 APRS board modifies to submit data to the T2 server method
  • 25. Wide area network, PPP protocol and HDLC protocol
  • HDLC of WAN
  • HDLC configuration
  • HDLC foundation
  • Transceiver of APRS signal
  • ESP8266 soft serial port decoding infrared remote control
  • Introduction to HDLC Technology
  • WAN technology - two (HDLC)
  • Popular Posts
  • Activity of the four major components of Android
  • Chapter 4 --- The maximum-subarray problem (INTRODUCTION TO ALGORITHMS THIRD EDITION)
  • LUA Learning --__ Index and __newindex
  • Mybatis learning (5) - MyBatis cache
  • @ Select statement learning notes
  • HDFS upload and download files, create a directory delete, query file operations
  • Detailed IO model
  • Toggle control and @Binding attribute decorator based on SwiftUI (including code demo)
  • MySQL DATE_FORMAT() function formatted date
  • Ubuntu 16 Install Torch7, graphics card driver, CUDA, CUDNN
  • Recommended Posts
  • ES starts 08----Generator function started by ES6
  • OpenCV4.5.1 Getting started for the first week
  • Implement vlc player in Java
  • The method of efficiently remove the linear table of the plurality of elements
  • Micro Service-Spring Cloud Integrate Consul Implementation Service Registration and Health Inspection
  • Bit order, endian, type order
  • ioi2000 palindrome
  • Scope of arrow functions
  • Python is used to read the file, take CSV as an example
  • Vue Element Component Image-Viewer Note
  • Related Tags
  • hardwarearduinoAmateur radiolinuxcomputer networknetworkserverNetwork protocolWanHDLC

CopyrightDMCA © 2018-2024 - All Rights Reserved - www.programmersought.comUser Notice

Top
ESP8266 for HDLC decoding, AX.25, APRS (2024)

FAQs

What is the ax 25 protocol? ›

AX. 25 is a protocol originally developed for amateur radio in the late 1970's and standardized on in 1984 with the release of the v2. 0 specification. Amateur radio enthusiasts quickly developed many diverse network architectures using AX.

What is the protocol of packet radio? ›

Packet radio uses a packet switching protocol as opposed to circuit switching or message switching protocols to transmit digital data via a radio communication link. Packet radio is frequently used by amateur radio operators.

What is kiss protocol? ›

KISS (Keep It Simple, Stupid) is a protocol for communicating with a serial terminal node controller (TNC) device used for amateur radio.

What is the APRS frequency? ›

The national APRS frequency is 144. 390MHz. If you tune any 2 meter radio to this frequency you will, eventually, hear what sounds like an old dial-up modem. Those are APRS packets.

What is APRS in HAM radio? ›

APRS (Automatic Packet Reporting System), is a digital communications protocol for exchanging information among a large number of stations covering a large (local) area, often referred to as "IP-ers". As a multi-user data network, it is quite different from conventional packet radio.

How does radio over IP work? ›

RoIP solutions work by converting radio signals into digital packets, which are then transmitted over the IP network. The packets are then decoded and converted back into radio signals at the receiving end.

References

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6270

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.