diff --git a/Inc/beacon.h b/Inc/beacon.h index 57b019f..5af12ba 100644 --- a/Inc/beacon.h +++ b/Inc/beacon.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/common.h b/Inc/common.h index 8f309ef..a3aa5d2 100644 --- a/Inc/common.h +++ b/Inc/common.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/config.h b/Inc/config.h index 1dcb11c..07a3f71 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/digipeater.h b/Inc/digipeater.h index d75da18..45a690d 100644 --- a/Inc/digipeater.h +++ b/Inc/digipeater.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/drivers/modem.h b/Inc/drivers/modem.h index 108e286..61b3044 100644 --- a/Inc/drivers/modem.h +++ b/Inc/drivers/modem.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/drivers/systick.h b/Inc/drivers/systick.h index 5367e6e..60c71b7 100644 --- a/Inc/drivers/systick.h +++ b/Inc/drivers/systick.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/drivers/uart.h b/Inc/drivers/uart.h index 9be04ab..d700057 100644 --- a/Inc/drivers/uart.h +++ b/Inc/drivers/uart.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/drivers/watchdog.h b/Inc/drivers/watchdog.h index fb4be59..ac02141 100644 --- a/Inc/drivers/watchdog.h +++ b/Inc/drivers/watchdog.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/fx25.h b/Inc/fx25.h index d747c3f..b043b96 100644 --- a/Inc/fx25.h +++ b/Inc/fx25.h @@ -1,3 +1,22 @@ +/* +Copyright 2020-2023 Piotr Wilkon + +This file is part of VP-Digi. + +VP-Digi is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +VP-Digi is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with VP-Digi. If not, see . +*/ + #ifndef FX25_H_ #define FX25_H_ diff --git a/Inc/main.h b/Inc/main.h index 2b36bf2..464983f 100644 --- a/Inc/main.h +++ b/Inc/main.h @@ -19,6 +19,7 @@ */ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Inc/terminal.h b/Inc/terminal.h index 001e36a..bbddc6b 100644 --- a/Inc/terminal.h +++ b/Inc/terminal.h @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/README.md b/README.md index 2f467cc..2abb5ad 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,51 @@ # VP-Digi -VP-Digi is a functional, cheap, easy to assemble and configure STM32-based APRS digipeater controller with built-in KISS modem. +VP-Digi is a functional, cheap, easy to assemble and configure STM32-based APRS digipeater controller with built-in KISS modem.\ +Full documentation can be found [here](doc/manual.md).\ +Dokumentacja po polsku dostępna jest [tutaj](doc/manual_pl.md). -* 1200 Bd Bell 202 modem (VHF APRS standard) -* R2R or PWM signal generation +* Multiple modems: + * 1200 Bd AFSK Bell 202 (VHF standard) + * 300 Bd AFSK Bell 103 (HF standard) + * 9600 Bd GFSK G3RUH (UHF standard) + * 1200 Bd AFSK V.23 +* PWM (or deprecated R2R) signal generation * Analog-digital busy channel detection (data carrier detection) -* AX.25 coder/decoder designed for APRS frames -* digipeater: 4 settable n-N aliases, 4 simple aliases, viscous delay (known from aprx) or direct only, black and white list +* AX.25 coder/decoder +* FX.25 (AX.25 with error correction) coder/decoder, fully compatible with [Direwolf](https://github.com/wb2osz/direwolf) and [UZ7HO Soundmodem](http://uz7.ho.ua/packetradio.htm) +* Digipeater: 4 settable n-N aliases, 4 simple aliases, viscous delay (known from aprx) or direct only, black and white list * 8 independent beacons -* KISS mode (can be used as an ordinary modem with UI-View, APRSIS32, XASTIR etc.) +* KISS mode (can be used as an ordinary Packet Radio, Winlink, APRS etc. modem) * USB and 2 UARTs: independent, running in KISS, monitor or configuration mode +## Updating to 2.0.0+ on older hardware +Since version 2.0.0 the component values have changed to provide support for faster modulations (9600 Bd). If you want to use these some components must be replaced. For more informations refer to the [manual](doc/manual.md) ([polska wersja](doc/manual_pl.md)). + ## Description, schematic, instructions -If you are not interested in source code, this repository is not for you. You can find full project description, schematics, compiled firmware and instructions [on my website](https://sq8l.pzk.pl/index.php/vp-digi-cheap-and-functional-aprs-digipeater-controller-with-kiss-modem/). +The user manual and technical description is available [here](doc/manual.md) ([polska wersja](doc/manual_pl.md)). -## Source code usage -The firmware was written using System Workbench for STM32 (SW4STM32) and you should be able to import this repository directly to the IDE. The source code is publicly available since version 1.3.0. +## Source code +The firmware was written using System Workbench for STM32 (SW4STM32) and you should be able to import this repository directly to the IDE. You can get the source code using: +```bash +git clone https://github.com/sq8vps/vp-digi.git +``` +Since version 2.0.0 you will also need to get appropriate submodule ([LwFEC](https://github.com/sq8vps/lwfec) for Reed-Solomon FEC): +```bash +git submodule init +git submodule update +``` +Since version 2.0.0 there is also a possibility to build the firmware with or without FX.25 protocol support. The ```ENABLE_FX25``` symbol must be defined to enable FX.25 support. On SW4STM32 (and STM32CubeIDE probably) this can be done under *Project->Properties->C/C++ Build->Settings->Preprocessor->Defined symbols*. -## Technical description -The project was designed to be running on a Blue Pill board (STM32F103C8T6) with 8MHz crystal. The firmware was written using only register operations (with ST headers) and CMSIS libraries. The HAL is there only for USB. The code is (quite) extensively commented where needed, so it shouldn't be very hard to understand. - -### Demodulator -There are two demodulators (and decoders) running in parallel to provide better efficiency. The signal is sampled at 38400Hz (32 samples per symbol) by DMA. The interrupt is generated after receiving 4 samples and the samples are decimated. Then they are passed through a preemphasis/deemphasis filter (if enabled) which equalizes tone amplitudes. Filtered samples are multiplied by locally generated mark and space tones (their I and Q parts - cosine and sine). This gives a correlation factor between the input signal and each tone. In the meanwhile an unfiltered symbol is produced to drive the data carrier detection PLL. The difference of correlation factors is the new sample and is passed through a low pass filter to eliminate noise. Filtered samples are compared to zero and the demodulated symbol is sent to bit recovery mechanism. -### Bit recovery (and NRZI decoder) -Bit recovery mechanism is based on a digital PLL. The PLL is nominally running at 1200Hz (=1200 Baud). The symbol change should occur near PLL counter zero, so that the counter overflows in the middle of the symbol and the symbol value is sampled. With every symbol change the counter is multiplied by a <1 factor to bring it closer to zero, keeping the PLL and incoming signal in phase. The DCD signal is multiplexed from both modems. Explained more in [modem.c](Src/drivers/modem.c). Sampled symbol is decoded by NRZI decoder and sent to AX.25 layer. -### AX.25 decoding -AX.25 decoder is quite standard. CRC, PID and Control Byte are checked and both modem paths are multiplexed to produce only one output frame. -### Data carrier detection -DCD uses an analog-digital approach: based on PLL, but working on a digital unfiltered symbol stream. The PLL works in the same way as bit recovery PLL, except that there is a special DCD pulse counting mechanism implemented, explained in [modem.c](Src/drivers/modem.c). This approach seems to be far more effective than a typical, digital, AX.25-based detection. -### AX.25 encoding -AX.25 encoder is also quite simple. It can handle multiple frames in a row (limited by buffer length). Every transmission starts with preamble flags, then header flags, actual data, CRC, footer/separating flags, actual data, CRC, footer/separating flags... and tail flags. Raw bits are requested by the modulator. -### Modulator (and NRZI encoder) -The NRZI encoder runs at exactly 1200Hz (=1200 Baud) and requests bits from the AX.25 encoder. Bits are encoded to symbols and the DAC sampling timer interval is set depending on symbol value. Because of that there is only one sine table used. For 1200Hz tone the timer interval is larger than for 2200 Hz tone - the sampling frequency is changed to change the output signal frequency. An array index is always kept so that the output signal phase is continuous. -## Using VP-Digi code in your project -I would love to hear about projects which implement VP-Digi source code. If you are making one, let me know at sq8vps(at)gmail.com. ## References The project took a lot of time to finish, but now it's probably the most effective, publicly available, STM32-based modem and the most customizable microcontroller-based APRS digipeater. I would like to mention some resources I found really useful or inspiring: * [multimon-ng](https://github.com/EliasOenal/multimon-ng) - general demodulator idea (correlation) * [BeRTOS](https://github.com/develersrl/bertos) - AX.25 decoder * [Forum thread by SP8EBC](http://forum.aprs.pl/index.php?topic=2086.0) - inspiration -* [DireWolf](https://github.com/wb2osz/direwolf) - PLL bit recovery idea +* [DireWolf](https://github.com/wb2osz/direwolf) - PLL bit recovery idea, FX.25 references * [A High-Performance Sound-Card AX.25 Modem](https://www.tau.ac.il/~stoledo/Bib/Pubs/QEX-JulAug-2012.pdf) - preemphasis and low pass filtering idea * [UZ7HO Soundmodem](http://uz7.ho.ua/packetradio.htm) - PLL-based DCD idea + ## Contributing -All contributions are appreciated, but please keep the code reasonably clean. Also, please make sure that the firmware is working well before creating a pull request. +All contributions are appreciated. ## License The project is licensed under the GNU GPL v3 license (see [LICENSE](LICENSE)). diff --git a/Src/ax25.c b/Src/ax25.c index fa42507..e18173e 100644 --- a/Src/ax25.c +++ b/Src/ax25.c @@ -539,21 +539,19 @@ void Ax25BitParse(uint8_t bit, uint8_t modem) { if(rx->frameIdx >= 17) //correct frame must be at least 17 bytes long (source+destination+control+CRC) { - uint16_t i = 13; - //start from 13, which is the SSID of source - //end either at the 69th byte, which is the SSID of th 8th digipeater - //or at frame size - 3, which is the last byte before PID/control field - for(; i < ((rx->frameIdx < 73) ? (rx->frameIdx - 3) : 70); i++) //look for path end bit + rx->crc ^= 0xFFFF; + if((rx->frame[rx->frameIdx - 2] == (rx->crc & 0xFF)) && (rx->frame[rx->frameIdx - 1] == ((rx->crc >> 8) & 0xFF))) //check CRC { - if(rx->frame[i] & 1) - break; - } + uint16_t i = 13; + //start from 13, which is the SSID of source + for(; i < (rx->frameIdx - 2); i++) //look for path end bit + { + if(rx->frame[i] & 1) + break; + } - //if non-APRS frames are not allowed, check if this frame has control=0x03 and PID=0xF0 - if(Ax25Config.allowNonAprs || (((rx->frame[i + 1] == 0x03) && (rx->frame[i + 2] == 0xF0)))) - { - rx->crc ^= 0xFFFF; - if((rx->frame[rx->frameIdx - 2] == (rx->crc & 0xFF)) && (rx->frame[rx->frameIdx - 1] == ((rx->crc >> 8) & 0xFF))) //check CRC + //if non-APRS frames are not allowed, check if this frame has control=0x03 and PID=0xF0 + if(Ax25Config.allowNonAprs || (((rx->frame[i + 1] == 0x03) && (rx->frame[i + 2] == 0xF0)))) { rx->frameReceived = 1; rx->frameIdx -= 2; //remove CRC diff --git a/Src/beacon.c b/Src/beacon.c index 1f3a39d..8cfdb50 100644 --- a/Src/beacon.c +++ b/Src/beacon.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/common.c b/Src/common.c index 8e9aaf7..0f1ca0e 100644 --- a/Src/common.c +++ b/Src/common.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/config.c b/Src/config.c index 98c72cc..1477cca 100644 --- a/Src/config.c +++ b/Src/config.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/digipeater.c b/Src/digipeater.c index fcd621b..a36c7e8 100644 --- a/Src/digipeater.c +++ b/Src/digipeater.c @@ -1,5 +1,6 @@ /* -This file is part of VP-DigiConfig. +Copyright 2020-2023 Piotr Wilkon +This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with VP-DigiConfig. If not, see . +along with VP-Digi. If not, see . */ #include "digipeater.h" diff --git a/Src/drivers/modem.c b/Src/drivers/modem.c index 671bda3..133e16c 100644 --- a/Src/drivers/modem.c +++ b/Src/drivers/modem.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/drivers/systick.c b/Src/drivers/systick.c index 64f1b55..ec79a4c 100644 --- a/Src/drivers/systick.c +++ b/Src/drivers/systick.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/drivers/uart.c b/Src/drivers/uart.c index 3ca895e..4b381f6 100644 --- a/Src/drivers/uart.c +++ b/Src/drivers/uart.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/drivers/watchdog.c b/Src/drivers/watchdog.c index 52e2f14..7c1b125 100644 --- a/Src/drivers/watchdog.c +++ b/Src/drivers/watchdog.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/fx25.c b/Src/fx25.c index 305df3e..1305c75 100644 --- a/Src/fx25.c +++ b/Src/fx25.c @@ -1,3 +1,21 @@ +/* +Copyright 2020-2023 Piotr Wilkon + +This file is part of VP-Digi. + +VP-Digi is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +VP-Digi is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with VP-Digi. If not, see . +*/ #ifdef ENABLE_FX25 diff --git a/Src/main.c b/Src/main.c index e9c374c..b01d029 100644 --- a/Src/main.c +++ b/Src/main.c @@ -17,6 +17,7 @@ ****************************************************************************** */ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-Digi. VP-Digi is free software: you can redistribute it and/or modify diff --git a/Src/terminal.c b/Src/terminal.c index b7f8eb2..ce130c6 100644 --- a/Src/terminal.c +++ b/Src/terminal.c @@ -1,4 +1,5 @@ /* +Copyright 2020-2023 Piotr Wilkon This file is part of VP-DigiConfig. VP-Digi is free software: you can redistribute it and/or modify diff --git a/doc/LICENSE_FDL b/doc/LICENSE_FDL new file mode 100644 index 0000000..857214d --- /dev/null +++ b/doc/LICENSE_FDL @@ -0,0 +1,451 @@ + + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +https://www.gnu.org/licenses/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/doc/manual_pl.md b/doc/manual_pl.md new file mode 100644 index 0000000..7747845 --- /dev/null +++ b/doc/manual_pl.md @@ -0,0 +1,324 @@ +# VP-Digi - dokumentacja +Copyright 2023 Piotr Wilkoń\ +Zezwala się na kopiowanie, rozpowszechnianie i/lub modyfikowanie tego dokumentu na warunkach Licencji GNU Wolnej Dokumentacji (GNU Free Documentation License) w wersji 1.3 lub dowolnej nowszej opublikowanej przez Free Software Foundation, +bez żadnych Części nienaruszalnych, bez Tekstów przedniej +lub tylnej strony okładki. Egzemplarz licencji zamieszczono w pliku [LICENSE_FDL](LICENSE_FDL).\ +Rejestr zmian dostępny jest na końcu tego dokumentu. +## Spis treści +- [VP-Digi - dokumentacja](#vp-digi---dokumentacja) + - [Spis treści](#spis-treści) + - [1. Opis funkcjonalny](#1-opis-funkcjonalny) + - [2. Podręcznik użytkownika](#2-podręcznik-użytkownika) + - [2.1. Tryb konfiguracji](#21-tryb-konfiguracji) + - [2.1.1. Polecenia](#211-polecenia) + - [2.1.2. Przykładowe ustawienia](#212-przykładowe-ustawienia) + - [2.2. Tryb monitora](#22-tryb-monitora) + - [2.2.1. Polecenia](#221-polecenia) + - [2.2.2. Widok pakietów odbieranych](#222-widok-pakietów-odbieranych) + - [2.3. Tryb KISS](#23-tryb-kiss) + - [2.4. Kalibracja poziomów sygnału](#24-kalibracja-poziomów-sygnału) + - [2.5. Programowanie](#25-programowanie) + - [2.5.1. Programowanie za pomocą programatora ST-Link](#251-programowanie-za-pomocą-programatora-st-link) + - [2.5.2. Programowanie za pomocą przejściówki USB-UART](#252-programowanie-za-pomocą-przejściówki-usb-uart) + - [2.6. Uruchomienie](#26-uruchomienie) + - [3. Opis techniczny](#3-opis-techniczny) + - [3.1. Sprzęt](#31-sprzęt) + - [3.1.1. Odbiór](#311-odbiór) + - [3.1.2. Nadawanie](#312-nadawanie) + - [3.2. Oprogramowanie](#32-oprogramowanie) + - [3.2.1. Modem](#321-modem) + - [3.2.1.1. Demodulacja](#3211-demodulacja) + - [3.2.1.2. Modulacja](#3212-modulacja) + - [3.2.1.3. Odzyskiwanie bitów](#3213-odzyskiwanie-bitów) + - [3.2.2. Protokoły](#322-protokoły) + - [3.2.2.1. Odbiór](#3221-odbiór) + - [3.2.2.2. Nadawanie](#3222-nadawanie) + - [3.2.3. Digipeater](#323-digipeater) + - [4. Rejestr zmian dokumentacji](#4-rejestr-zmian-dokumentacji) + - [2023/09/06](#20230906) + +## 1. Opis funkcjonalny +VP-Digi jest samodzielnym sterownikiem digipeatera AX.25 (np. APRS) oraz kontrolerem TNC w standardzie KISS.\ +Oprogramowanie wyposażone jest w modemy: +- Bell 202 AFSK 1200 Bd 1200/2200 Hz (standard VHF) +- G3RUH GFSK 9600 Bd (standard UHF) +- Bell 103 AFSK 300 Bd 1600/1800 Hz (standard HF) +- V.23 AFSK 1200 Bd 1300/2100 Hz (alternatywny standard VHF) + +Każdy modem wykorzystuje mechanizm wykrywania nośnej w oparciu o detekcję prawidłowego sygnału modulującego, a nie zdekodowanych danych, dzięki czemu zwiększona jest niezawodność, a ilość kolizji - zmniejszona. + +Ponadto oprogramowanie obsługuje protokoły: +- AX.25 (standard Packet Radio/APRS) +- FX.25 - AX.25 z korekcją błędów, w pełni kompatybilny z AX.25 + +VP-Digi umożliwia konfigurację: +- Własnego znaku, SSID i adresu przeznaczenia +- Parametrów modemu (*TXDelay*, *TXTail*, czasu ciszy, typu DAC, typu odbiornika) +- Prędkości pracy portów szeregowych +- 4 aliasów digipeatera typu *New-N* (np. *WIDEn-N*) +- 4 aliasów prostych digipeatera (np. *MIASTO*) +- Progów ilości skoków dla aliasów typu *New-N* +- Włączenia trasowania każdego aliasu +- Trybu *viscous delay* i tylko bezpośredniego dla każdego aliasu +- Listy filtrującej (wykluczanie lub wyłączność) +- Włączenia odbioru pakietów niebędących pakietami APRS +- Włączenia monitorowania własnych pakietów przez port KISS + +Urządzenie daje do dyspozycji: +- 2 porty szeregowe +- port USB + +z których każdy pracuje niezależnie i może działać w trybie: +- TNC KISS +- monitora ramek +- terminala konfiguracyjnego + +## 2. Podręcznik użytkownika +### 2.1. Tryb konfiguracji +Konfiguracja urządzenia może być dokonana przez dowolny port (USB, UART1, UART2). Przejście do trybu konfiguracji następuje po wydaniu polecenia `config`. +> Uwaga! Jeśli port pracuje w trybie KISS (domyślnym po uruchomieniu), to wpisywane znaki nie będą widoczne. + +> Uwaga! Po zakończeniu konfiguracji należy zapisać ją do pamięci poleceniem `save` + +#### 2.1.1. Polecenia +W trybie konfiguracji dostępne są następujące polecenia: +- `call ZNAK-SSID` - ustawia znak wywoławczy wraz z SSID. Znak wywoławczy musi składać się z maksymalnie 6 znaków A-Z i 0-9. SSID jest opcjonalne. SSID musi zawierać się w zakresie 0-15. +- `dest ADRES` – ustawia adres przeznaczenia. Adres musi składać się z maksymalnie 6 znaków A-Z i 0-9, bez SSID. *APNV01* jest oficjalnym i zalecanym adresem dla VP-Digi. +- `modem <1200/300/9600/1200_V23>` - ustawia typ modemu: *1200* dla modemu 1200 Bd, *300* dla modemu 300 Bd, *9600* dla modemu 9600 Bd lub *1200_V23* dla alternatywnego modemu 1200 Bd. +- `txdelay CZAS` – ustawia długość preambuły do nadania przed ramką. Wartość w milisekundach z zakresu od 30 do 2550 +- `txtail CZAS` – ustawia ogona nadawanego po ramce. Wartość w milisekundach, z zakresu od 10 do 2550. Jeśli nie zachodzi potrzeba, należy ustawić wartość minimalną. +- `quiet CZAS` – ustawia czas, który musi upłynąć pomiędzy zwolnieniem się kanału a włączeniem nadawania. Wartość w milisekundach z zakresu od 100 do 2550. +- `rs1baud PREDKOSC` – ustawia prędkość (*baudrate*) portu UART1. Wartość z zakresu od 1200 do 115200. +- `rs2baud PREDKOSC` – ustawia prędkość (*baudrate*) portu UART2. Wartość z zakresu od 1200 do 115200. +- `pwm ` – ustawia typ DAC. *on*, gdy zainstalowany jest filtr PWM, *off* gdy zainstalowana jest drabinka R2R. Od wersji 2.0.0 zalecane jest użycie wyłącznie PWM. +- `flat ` – konfiguruje modem do użycia z radiem z wyjściem *flat audio*. *on* gdy sygnał podawany jest ze złącza *flat audio*, *off* gdy sygnał podawany jest ze złącza słuchawkowego. Opcja ma wpływ jedynie na modemy 1200 Bd. +- `beacon NUMER ` – *on* włącza, *off* wyłącza beacon o podanym numerze z zakresu od 0 do 7. +- `beacon NUMER iv CZAS` – ustawia interwał nadawania (w minutach) beaconu o numerze z zakresu od 0 do 7. +- `beacon NUMER dl CZAS` – ustawia opóźnienie/przesunięcie nadawania (w minutach) beaconu o numerze z zakresu od 0 do 7. +- `beacon NUMER path SCIEZKAn-N[,SCIEZKAn-N]/none` – ustawia ścieżkę beaconu o numerze z zakresu od 0 do 7. Polecenie przyjmuje jeden (np. *WIDE2-2*) lub dwa (np. *WIDE2-2,SP3-3*) elementy ścieżki albo opcję *none* dla braku ścieżki. +- `beacon NUMER data TRESC` – ustawia treść beaconu o numerze z zakresu od 0 do 7. +- `digi ` – *on* włącza, *off* wyłącza digipeater +- `digi NUMER ` – *on* włącza, *off* wyłącza obsługę aliasu o numerze z zakresu od 0 do 7. +- `digi NUMER alias ALIAS` – ustawia alias o numerze z zakresu od 0 do 7. W przypadku slotów 0-3 (typ *n-N*) przyjmuje do 5 znaków bez SSID, w przypadku slotów 4-7 (aliasy proste) przyjmuje aliasy w formie jak znak wywoławczy wraz z SSID lub bez. +- `digi NUMER max N` – ustawia maksymalne *n* (z zakresu od 1 do 7) dla normalnego powtarzania aliasów typu *n-N* (zakres od 0 do 3). +- `digi NUMER rep N` – ustawia minimalne *n* (z zakresu od 0 do 7), od którego aliasy typu *n-N* (zakres od 0 do 3) będą przetwarzane jak aliasy proste. *N* równe 0 wyłącza tę funkcję. +- `digi NUMER trac ` – ustawia wybrany alias (z zakresu od 0 do 7) jako trasowalny (*on*) lub nietrasowalny (*off*) +- `digi NUMER viscous ` – *on* włącza, *off* wyłącza funkcję *viscous delay* dla aliasu z zakresu od 0 do 7. +- `digi NUMER direct ` – *on* włącza, *off* wyłącza funkcję powtarzania tylko ramek odebranych bezpośrednio dla aliasu z zakresu od 0 do 7. +> Zasadę działania digipeatera opisano w [sekcji 3.2.3](#323-digipeater). +- `digi NUMER filter ` – *on* włącza, *off* wyłącza filtrowanie ramek dla aliasu z zakresu od 0 do 7. +- `digi filter ` – ustawia typ listy filtrującej ramki: *black* (wykluczenie - ramki od znaków z listy nie będą powtarzane) lub *white* (wyłączność – tylko ramki od znaków z listy będą powtarzane). +- `digi dupe CZAS` – ustawia czas bufora filtrującego duplikaty, który zapobiega wielokrotnemu powtarzaniu już powtórzonego pakietu. Czas w sekundach z zakresu od 5 do 255. +- `digi list POZYCJA set ZNAK-SSID` – wpisuje znak na wybraną pozycję (z zakresu od 0 do 19) listy filtrującej. Można używać znaku * do zamaskowania wszystkich liter do końca znaku. *?* maskuje pojedynczą literę w znaku. Do zamaskowania SSID można użyć * lub *?*. +- `digi list POZYCJA remove` – usuwa wybraną pozycję (z zakresu od 0 do 19) z listy filtrującej +- `monkiss ` – *on* włącza, *off* wyłącza wysyłanie własnych i powtórzonych ramek na porty KISS +- `nonaprs ` – *on* włącza, *off* wyłącza odbiór pakietów niebędących pakietami APRS (np. dla Packet Radio) +- `fx25 ` - *on* włącza, *off* wyłącza obsługę protokołu FX.25. Po włączeniu jednocześnie będą odbierane pakiety AX.25 i FX.25. +- `fx25tx ` - *on* włącza, *off* wyłącza nadawanie z użyciem protokołu FX.25. Jeśli obsługa FX.25 jest wyłączona całkowicie (polecenie *fx25 off*), to pakiety zawsze będą nadawane z użyciem AX.25. + +Ponadto dostępne są polecenia kontrolne: +- `print` – pokazuje aktualne ustawienia. +- `list` – pokazuje zawartość listy filtrującej. +- `save` – zapisuje ustawienia do pamięci i restartuje urządzenie. Należy zawsze użyć tej komendy po zakończeniu konfiguracji. W przeciwnym wypadku niezapisana konfiguracja zostanie porzucona. +- `eraseall` – czyści całą konfigurację i restartuje urządzenie. + +Dostępne są także polecenia wspólne: +- `help` – pokazuje stronę pomocy +- `reboot` – restartuje urządzenie +- `version` – pokazuje informacje o wersji oprogramowania +- `monitor` – przełącza port do trybu monitora +- `kiss` – przełącza port do trybu KISS + +#### 2.1.2. Przykładowe ustawienia + +- Beacon\ + Przykład dla beaconu o numerze 0. Dostępne są beacony od 0 do 7. + 1. *beacon 0 data !5002.63N/02157.91E#Digi Rzeszow* – ustawienie danych beaconu w standardzie APRS + 2. *beacon 0 path WIDE2-2,SP2-2* – ustawienie ścieżki + 3. *beacon 0 iv 15* – nadawanie co 15 minut + 4. *beacon 0 dl 5* – beacon będzie nadany po raz pierwszy po 5 minutach od uruchomienia urządzenia + 5. *beacon 0 on* – uruchomienie beaconu +- Digipeater WIDE1-1 (pomocniczy)\ + Przykład dla aliasu o numerze 0. Dostępne są aliasy 0-3. + 1. *digi 0 alias WIDE* – powtarzanie aliasów typu WIDEn-N. Liczby n i N NIE są ustawiane tutaj. + 2. *digi 0 max 1* – powtarzanie ścieżek maksymalnie WIDE1-1 + 3. *digi 0 rep 0* – wyłączenie limitowania i upraszczania ścieżek + 4. *digi 0 trac on* – włączenie trasowania ścieżki (ścieżki typu WIDEn-N są trasowane) + 5. *digi 0 on* – włączenie obsługi danego aliasu + 6. *digi on* – włączenie digipeatera + +- Digipeater pomocniczy *viscous delay* (zalecana konfiguracja)\ + Przykład dla aliasu o numerze 0. Dostępne są aliasy 0-3. + 1. *digi 0 alias WIDE* – powtarzanie aliasów typu WIDEn-N. Liczby n i N NIE są ustawiane tutaj. + 2. *digi 0 max 2* – powtarzanie ścieżek maksymalnie WIDE2-2 + 3. *digi 0 rep 3* – ścieżki WIDE3-3 i dłuższe będą upraszczane przy powtarzaniu + 4. *digi 0 trac on* – włączenie trasowania ścieżki (ścieżki typu WIDEn-N są trasowane) + 5. *digi 0 viscous on* – włącznie trybu *viscous delay* + 6. *digi 0 on* – włączenie obsługi danego aliasu + 7. *digi on* – włączenie digipeatera + +- Digi regionalne WIDEn-N + SPn-N (zalecana konfiguracja)\ + Przykład dla aliasów 0 (dla WIDE) i 1 (dla SP). + 1. *digi 0 alias WIDE* – powtarzanie aliasów typu WIDEn-N. Liczby n i N NIE są ustawiane tutaj. + 2. *digi 0 max 2* – powtarzanie ścieżek maksymalnie WIDE2-2 + 3. *digi 0 rep 3* – ścieżki WIDE3-3 i dłuższe będą upraszczane przy powtarzaniu + 4. *digi 0 trac on* – włączenie trasowania ścieżki (ścieżki typu WIDEn-N są trasowane) + 5. *digi 0 on* – włączenie obsługi danego aliasu + 6. *digi 1 alias SP* – powtarzanie aliasów typu SPn-N. Liczby n i N NIE są ustawiane tutaj. + 7. *digi 1 max 7* – powtarzanie maksymalnie ścieżek SP7-7 + 8. *digi 1 rep 0* – brak limitu dla ścieżki + 9. *digi 1 trac off* – wyłączenie trasowania ścieżki (ścieżki regionalne nie są trasowane) + 10. *digi 1 on* – włączenie obsługi danego aliasu + 11. *digi on* – włączenie digipeatera + +### 2.2. Tryb monitora +Praca urządzenia może być obserwowana przez dowolny port (USB, UART1, UART2). Przejście do trybu monitora następuje po wydaniu polecenia `monitor`. +> Uwaga! Jeśli port pracuje w trybie KISS (domyślnym po uruchomieniu), to wpisywane znaki nie będą widoczne. + +W trybie monitora wyświetlane są pakiety odbierane i nadawane, a ponadto możliwe jest dokonanie kalibracji poziomów sygnału. + +#### 2.2.1. Polecenia +Dostępne są następujące polecenia: +- `beacon NUMER` - nadaje beacon z zakresu 0 do 7, o ile ten beacon jest włączony. +- `cal ` - rozpoczyna lub kończy tryb kalibracji: *low* nadaje niski ton, *high* nadaje wysoki ton, *alt* nadaje bajty zerowe/zmieniające się tony, a *stop* zatrzymuje transmisję. Dla modemu 9600 Bd zawsze nadawane są bajty zerowe. + +Dostępne są także polecenia wspólne: +- `help` – pokazuje stronę pomocy +- `reboot` – restartuje urządzenie +- `version` – pokazuje informacje o wersji oprogramowania +- `config` – przełącza port do trybu konfiguracji +- `kiss` – przełącza port do trybu KISS + +#### 2.2.2. Widok pakietów odbieranych + +Dla każdego odebranego pakietu AX.25 wyświetlany jest nagłówek w następującym formacie: +> Frame received [...], signal level XX% (HH%/LL%) +> +natomiast dla każdego odebranego pakietu FX.25: +> Frame received [...], N bytes fixed, signal level XX% (HH%/LL%) + +Gdzie kolejno: +- *...* określa, które modemy odebrały pakiet i jakiego rodzaju filtr został użyty. Możliwe są następujące statusy: + - *P* - filtr z preemfazą wysokiego tonu + - *D* - filtr z deemfazą wysokiego tonu + - *F* - filtr płaski + - *N* - brak filtra + - *_* - modem nie odebrał ramki\ +Przykładowo status *[_P]* oznacza, że pierwszy modem nie odebrał ramki, a drugi odebrał ramkę i używa filtru z preemfazą. Inny przykładowy status *[N]* oznacza, że dostępny jest tylko jeden modem bez filtra i to on odebrał ramkę. +- *N* określa, ile bajtów zostało naprawionych przez protokół FX.25. Dla pakietów AX.25 pole to nie jest wyświetlane. +- *XX%* określa, jaki jest poziom sygnału, tj. jego amplituda. +- *HH%* określa, jaki jest poziom górnego piku sygnału. +- *LL%* określa, jaki jest poziom dolnego piku sygnału. +> Uwaga! Poziom górnego piku powinien być dodatni, a dolnego ujemny. Ponadto poziomy te powinny być symetryczne względem zera. Duża dysproporcja świadczy o nieprawidłowej polaryzacji wejścia przetwornika ADC. + +### 2.3. Tryb KISS +Tryb KISS służy do pracy jako standardowe TNC KISS, współpracujące z wieloma programami do Packet Radio, APRS i podobnych. W trybie tym nie jest dostępne tzw. echo (odsyłanie wpisywanych znaków). Dostępne są jedynie polecenia przełaczenia trybu: +- `monitor` – przełącza port do trybu monitora +- `config` – przełącza port do trybu konfiguracji + +### 2.4. Kalibracja poziomów sygnału +Po uruchomieniu urządzenia należy przejść do trybu monitora (polecenie `monitor`) i czekać na pojawienie się pakietów. Należy wyregulować poziom sygnału tak, aby większość pakietów miała poziom sygnału ok. 50% (jak opisano w [sekcji 2.2.2](#222-widok-pakietów-odbieranych)) Poziom sygnału odbieranego należy utrzymywać w zakresie 10-90%.\ +Aby zapewnić najlepszą wydajność sieci, poziom sygnału nadawanego powinien być prawidłowo ustawiony. Jest to szczególnie istotne w przypadku modemu 1200 Bd, gdzie sygnał nadawany jest przez standardowe złącze mikrofonowe radiotelefonu FM. Zbyt duży poziom sygnału prowadzi do występowania zniekształceń i dużych dysproporcji amplitud tonów.\ +Do kalibracji potrzebny jest odbiornik FM zestrojony na tę samą częstotliwość, co nadajnik. Należy przejść do trybu monitora (polecenie `monitor`) i właczyć nadawanie tonu wysokiego (polecenie `cal high`). Należy ustawić potencjometr do pozycji minimalnego poziomu wysterowania, a następnie powoli zwiększać poziom, jednocześnie uważnie nasłuchując siły sygnału w odbiorniku, który powinien rosnąć. W pewnym momencie poziom sygnału przestanie się zwiększać. Wówczas należy delikatnie cofnąć potencjometr i wyłączyć tryb kalibracji (polecenie `cal stop`). Po tej operacji nadajnik powinien być poprawnie wysterowany. +> Uwaga! Jeśli nie uda się osiągnąć punktu, w którym poziom sygnału przestanie się zwiększać, to prawdopodobnie wartość rezystancji w torze nadawczym jest zbyt duża. Jeśli poziom sygnału jest wyraźnie zbyt niski, należy zmniejszyć wartość tej rezystancji. W przeciwnym wypadku nie jest konieczne podejmowanie kroków. + +### 2.5. Programowanie +Programowanie (wgranie oprogramowania) można przeprowadzić na dwa sposoby: za pomocą programatora *ST-Link* lub poprzez port szeregowy UART1 (np. za pomocą przejściówki USB-UART).\ +W obydwu sposobach konieczne jest wcześniejsze pobranie oprogramowania VP-Digi (plik HEX). +#### 2.5.1. Programowanie za pomocą programatora ST-Link +1. Pobrać i zainstalować program *ST-Link Utility* wraz z odpowiednimi sterownikami. +2. Podłączyć VP-Digi do programatora. +3. Podłączyć programator do złącza USB. +4. W *ST-Link Utility* przejść do *File->Open file* i wybrać pobrany plik HEX z oprogramowaniem. +5. Przejść do *Target->Program & Verify* i kliknąć *Start*. Po chwili urządzenie się zrestartuje i uruchomi się właściwe oprogramowanie. + +#### 2.5.2. Programowanie za pomocą przejściówki USB-UART +1. Upewnić się, że przejściówka pracuje z poziomami logicznymi 0/3.3V. +2. Jeśli to konieczne, zainstalować sterowniki do przejściówki. +3. Pobrać i zainstalować program *Flasher-STM32*. +4. Na płytce ustawiamy zworkę bliższą przycisku reset na położenie 0, a dalszą na 1. +5. Podłączyć pin *TX* przejściówki do pinu *PA10*, a *RX* do *PA9*. Podłączyć zasilanie (np. z przejściówki). +6. Ustalić pod którym portem COM dostępna jest przejściówka. +7. Uruchomić *Flasher-STM32*, wybrać odpowiedni port COM i kliknąć *Next*. + > Jeżeli ukazał się błąd, należy zresetować mikrokontroler i sprawdzić połączenia oraz ustawienie zworek. +8. W następnym ekranie nacisnąć *Next*. +9. Na kolejnym ekranie wybrać opcję *Download to device* i wybrać pobrany plik HEX. +10. Zaznaczyć opcje *Erase neccesary pages* oraz *Verify after download* i kliknąć *Next*. Po chwili układ powinien być zaprogramowany. Przestawić obydwie zworki z powrotem na położenie 0 i zresetować mikrokontroler, a przejściówkę odłączyć. Powinno uruchomić się właściwe oprogramowanie. +### 2.6. Uruchomienie +Urządzenie należy skonstruować wg. schematu przedstawionego w [sekcji 3.1](#31-sprzęt) i zaprogramować (opis w [sekcji 2.5](#25-programowanie)).\ +Po uruchomieniu wszystkie porty (USB, UART1, UART2) pracują w trybie KISS, a prędkość pracy portów UART1 i UART2 to 9600 Bd (prędkość portu USB nie ma znaczenia).\ +W celu konfiguracji VP-Digi lub monitorowania ramek koniecznie jest połączenie z komputerem przez port USB lub UART i zainstalowanie programu terminalowego (*TeraTerm*, *RealTerm* itp.). Jak wspominano w sekcjach poprzedzających, przejście do tryb konfiguracji i monitora następuje po wprowadzeniu poleceń, odpowiednio, `config` i `monitor` i zatwierdzeniu enterem. +> W trybie KISS odsyłanie wprowadzanych znaków (*echo*) jest wyłączone, zatem nie będzie widać wprowadzanych poleceń. + +Konfigurację urządzenia należy przeprowadzić za pomocą poleceń opisanych w [sekcji 2.1](#21-tryb-konfiguracji). + +## 3. Opis techniczny +### 3.1. Sprzęt +VP-Digi natywnie pracuje na mikrokontrolerze STM32F103C8T6 z częstotliwością rdzenia równą 72 MHz, co wymaga użycia zewnętrznego rezonatora 8 MHz. Do budowy urządzenia zalecane jest użycie płytki znanej jako *STM32 Blue Pill*. + +Budowę VP-Digi w oparciu o płytkę *STM32 Blue Pill* przedstawiono na schemacie: +![VP-Digi schematic](schematic.png) +#### 3.1.1. Odbiór +Sygnał odbierany podawany jest na pin *PA0* z użyciem układu kondensatorów odsprzęgających (*C4*, *C6*) oraz rezystorów polaryzujących (*R6*, *R9*) i ograniczających (*R7*, *R11*). W celu zapewnienia poprawnego odbioru modulacji FSK muszą być zastosowane kondensatory o stosunkowo dużych pojemnościach. Dla zapewnienia poprawnego odbioru napięcie stałe na pinie *PA0* musi być w okolicach połowy napięcia zasilania, tj. 1.65 V. Nieprawidłowa polaryzacja objawia się w postaci asymetrii poziomu sygnału (patrz [sekcja 2.2.2](#222-widok-pakietów-odbieranych)) lub zanikiem odbioru. +W torze odbiorczym zastosowano szeregowy rezystor *R7* mający na celu ograniczenie maksymalnego prądu pinu, aby wykorzystując wbudowane w mikrokontroler diody wykonać ogranicznik napięcia chroniący przetwornik przed uszkodzeniem spowodowanym zbyt dużym poziomem sygnału.\ +Jeśli radiotelefon ma regulowany poziom sygnału wyjściowego, to instalacja elementów *RV2*, *R11* i *C6* nie jest konieczna. +#### 3.1.2. Nadawanie +Sygnał nadawany może zostać generowany z użyciem przetwornika PWM lub R2R (niezalecany od wersji 2.0.0). Przetwornik PWM wykorzystuje sprzętową modulację szerokości impulsów oraz filtr RC drugiego rzędu (*R5*, *C3*, *R3*, *C2*) do odfiltrowania składowych niepożądanych. Filtr zbudowany jest z dwóch filtrów RC pierwszego rzędu o częstotliwości odcięcia ok. 7200 Hz w celu zapewnienia odpowiedniego pasma przenoszenia dla modemu 9600 Bd. Ponadto dla poprawnego nadawania modulacji FSK musi być zastosowany kondensator odsprzęgający *C1* o stosunkowo dużej pojemności. +Rezystor *R2* służy do znacznego zmniejszenia amplitudy sygnału gdy używane jest standardowe wejście mikrofonowe o dużym wzmocnieniu. Wartość tego rezystora należy dobrać indywidualnie. +Radiotelefon przełączany jest w stan nadawania poprzez podanie stanu niskiego przez tranzystor NPN *Q1*. Jeśli radiotelefon ma wejście PTT, to należy połączyć je bezpośrednio do kolektora tranzystora i nie montować rezystora *R1*. Dla standardowych radiotelefonów z wejściem mikrofonowym należy zainstalować rezystor *R1*. + +### 3.2. Oprogramowanie +Oprogramowanie VP-Digi napisane jest w języku C z użyciem standardowych bibliotek CMSIS i nagłówków ST dla mikrokontrolera z użyciem operacji na rejestrach. Biblioteka HAL wykorzystana wyłącznie do obsługi USB oraz konfiguracji sygnałów zegarowych. +#### 3.2.1. Modem +##### 3.2.1.1. Demodulacja +Odbiór ramek rozpoczyna się od próbkowania sygnału wejściowego. Sygnał wejściowy jest nadpróbkowany czterokrotnie, co daje odpowiednio próbkowanie 153600 Hz dla modemu 9600 Bd i 38400 Hz dla pozostałych modemów. Po odebraniu czterech próbek są one decymowane i wysyłane do dalszego przetwarzania (z wynikową częstotliwością, odpowiednio, 38400 Hz i 9600 Hz). Dla modemu 1200 Bd wykorzystywane jest 8 próbek na symbol, dla modemu 300 Bd - 32 próbki na symbol, a dla modemu 9600 Bd - 4 próbki na symbol. Z użyciem mechanizmu podobnego do AGC śledzona jest amplituda sygnału. Jeśli modem posiada filtr wstępny, to próbki są filtrowane. Dla modemów AFSK próbka obecna i poprzednie mnożone są przez sygnały liczbowego generatora o częstotliwościach odpowiadających częstoliwości tzw. *mark* i *space* (liczona jest korelacja, która tutaj odpowiada dyskretnej demodulacji częstotliwości). Wynik mnożenia w każdej ścieżce jest sumowany, a następnie wyniki są od siebie odejmowane, co daje "miękki" symbol. W przypadku modemu (G)FSK omówiony krok nie występuje, gdyż funkcję demodulatora FM (FSK) pełni radiotelefon. Na tym etapie prowadzone jest wykrywanie nośnej, które oparte jest o prostą cyfrową PLL. Pętla ta nominalnie działa z częstotliwością równą prędkości symbolowej sygnału (np. 1200 Hz = 1200 Bd). W momencie zmiany "miękkiego" symbolu odbieranego sprawdzana jest odległość od przejścia licznika PLL przez zero. Jeśli jest ona niewielka, tzn. sygnały te są w fazie, to sygnał wejściowy jest prawdopodobnie prawidłowy. Wówczas zwiększana jest wartość dodatkowego licznika. Jeśli przekroczy ona ustalony próg, to ostatecznie sygnał jest uznawany za prawidłowy. Algorytm działa również w drugą stronę - jeśli sygnały nie są w fazie, to wartość licznika jest zmniejszana. +Sygnał zdemodulowany ("miękki symbol") jest filtrowany przez filtr dolnoprzepustowy (odpowiedni do prędkości symbolowej) w celu usunięcia szumu, a następnie wartość symbolu jest określana i przesyłana do mechanizmu odzyskiwania bitów. +##### 3.2.1.2. Modulacja +Modulator AFSK oparty jest o wystawianie próbek sygnału sinusoidalnego, wygenerowanego w momencie startu urządzenia, na przetwornik cyfrowo-analogowy. W zależności od częstotliwości symbolu zmieniana jest częstotliwość wystawiania próbek, tzn. dla tablicy o długości *N* i częstotliwości sygnału *f* kolejne próbki wystawiane są z częstotliwością *f/N*. W trakcie generowania sygnału zachowywana jest ciągłość indeksów tablicy, co skutkuje zachowaniem fazy sygnału.\ +W przypadku modemu GFSK symbole z warstwy wyższej (sygnał prostokątny) są filtrowane przez filtr dolnoprzepustowy (wspólny dla demodulatora i modulatora) i wystawiane ze stałą częstotliwością 38400 Hz na przetwornik. +##### 3.2.1.3. Odzyskiwanie bitów +Odzyskiwanie bitów prowadzone jest przez modem. Zastosowana jest cyfrowa PLL (podobna jak w przypadku wykrywania nośnej), działająca z częstotliwością równą częstotliwości symbolowej. W momencie każdego pełnego okresu pętli określana jest ostateczna wartość symbolu na podstawie kilku poprzednio odebranych symboli. W tym samym czasie faza pętli dostrajana jest do fazy sygnału, tzn. do momentów zmiany symbolu. W przypadku modemu wykorzystującego mieszanie bitów (*scrambling*, np. modem G3RUH) wykonywany jest *descrambling*. Ostatecznie wykonywane jest dekodowanie NRZI i bity są przekazywane do wyższej warstwy. +#### 3.2.2. Protokoły +##### 3.2.2.1. Odbiór +Protokoły HDLC, AX.25 i w dużej mierze FX.25 obsługiwane są przez jeden moduł będący dość rozbudowaną maszyną stanów. +Odebrane bity są na bieżąco zapisywane w rejestrze przesuwnym. Rejestr ten monitorowany jest pod kątem wystąpenia flagi HDLC w celu wykrycia początku i końca ramki AX.25, ale również synchronizacji bitowej z nadajnikiem (tzn. wyrównania do pełnego bajtu). Gdy włączony jest odbiór FX.25, to równoczeście monitorowane jest wystąpienie któregoś z tagów korelacyjnych, który również pełni funkcję synchronizacyjną i początku ramki, ale tym razem FX.25. Odbierane bity są zapisywane do bufora, a suma kontrolna jest na bieżąco liczona. Istotnym momentem jest odbiór pierwszych ośmiu bajtów danych, podczas których nie wiadomo, czy jest to ramka FX.25, czy nie, więc wówczas dekodery obydwu protokołów pracują równocześnie. Jeśli tag korelacyjny nie pokrywa się z żadnym znanym, to ramka traktowana jest jako pakiet AX.25. Wówczas bity zapisywane są aż do momentu wystąpienia kolejnej flagi. Następnie, jeśli dozwolony jest wyłącznie odbiór pakietów APRS, sprawdzane są pola Control i PID. Ostatecznie sprawdzana jest suma kontrolna. Jeśli jest prawidłowa, to dokonywana jest multipleksacja modemów (w wypadku gdy więcej niż jeden modem odbierze ten sam pakiet). W przypadku, gdy tag korelacyjny jest prawidłowy, to na jego podstawie określana jest oczekiwana długość pakietu i zapisywane są wszystkie bajty aż do osiągnięcia tej długości. Następnie sprawdzana jest poprawność danych i ewentualna naprawa z użyciem algorytmu Reeda-Solomona. Niezależnie od wyniku operacji surowa ramka jest dekodowana jak pakiet AX.25 (usuwane są dodatkowe bity, flagi) i sprawdzana jest suma kontrolna. Jeśli jest prawidłowa, to podobnie dokonywana jest multipleksacja modemów. +##### 3.2.2.2. Nadawanie +Podobnie jak w przypadku odbioru moduł generujący bity do nadania jest maszyną stanów. Początkowo nadawana jest preambuła o zadanej długości. Gdy używany jest protokół AX.25, to nadawana jest określona ilość flag i nadawane są bity informacyjne. Na bieżąco realizowane jest nadziewanie bitami (*bit stuffing*) i liczenie sumy kontrolnej, która jest dołączana po nadaniu całej ramki. Następuje nadanie określonej liczby flag, i jeżeli są kolejne pakiety do nadania, to od razu następuje przejście do nadania właściwych danych. Ostatecznie nadawany jest ogon o zadanej długości i transmisja kończy się.\ +W przypadku FX.25 pakiet wejściowy jest wcześniej kodowany jak pakiet AX.25, tzn. zostają dodane dodatkowe bity i flagi i jest umieszczany w oddzielnym buforze. Dzięki temu odbiorniki nieobsługujące FX.25 nadal będą mogły odebrać ten pakiet. Pozostała część bufora zostaje wypełniona odpowiednimi bajtami. Następnie wykonywane jest kodowanie Reeda-Solomona, które wprowadza do bufora bajty parzystości. Gdy rozpoczyna się transmisja, nadana zostaja preambuła, ale po niej nadawany jest odpowiednio dobrany tag korelacyjny. Wówczas następuje nadanie wcześniej przygotowanej ramki. Jeśli są do nadania kolejne pakiety, to proces się powtarza. Ostatecznie nadawany jest ogon i transmisja kończy się. +#### 3.2.3. Digipeater +Po odebraniu pakietu liczony jest jego hasz (algorytm CRC32). Następnie sprawdzane jest wystąpienie takiego samego haszu w buforze *viscous delay*. Jeśli hasze są takie same, to pakiet jest usuwany z bufora i nie są podejmowane żadne dalsze działania. Podobnie sprawdzane jest wystąpienie takiego samego haszu w buforze filtra duplikatów. Jeśli hasze są takie same, to pakiet jest od razu odrzucany. Następnie w ścieżce wyszukiwany jest *H-bit*, informujący o ostatnim elemencie ścieżki przetworzonym przez inne digipeatery. Jeśli nie ma kolejnego elementu gotowego do przetworzenia, to pakiet jest odrzucany. Jeśli występuje element gotowy do przetworzenia, to podejmowane są kroki: +- element porównywany jest z własnym znakiem (tj. czy własny znak występuje *explicite* w ścieżce). Jeśli porównanie jest pomyślne, to do elementu dodawany jest tylko *H-bit*, np. *SR8XXX* przechodzi w *SR8XXX\**. +- element jest w identyczny sposób porównywany z wszystkimi aliasami prostymi wpisanymi do konfiguracji (o ile są one włączone). Jeśli porównanie jest pomyślne, to: + - jeśli alias jest trasowalny, to zastąpiony zostaje własnym znakiem i dodany zostaje *H-bit* (np. *RZ* zostanie zmienione w *SR8XXX\**) + - jeśli alias nie jest trasowalny, to dodany zostaje tylko *H-bit* (np. *RZ* zostanie zmienione w *RZ\**) + +Pierwsza cześć elementu jest porówywana z wszystkimi aliasami *New-N* (o ile są one włączone). Jeśli porównanie jest pomyślne, to z elementu wyciągana jest liczba zwana *n*, a także zapisywane jest SSID zwane *N* (np. w ścieżce *WIDE2-1* liczba *n*=2, a *N*=1). Początkowo sprawdzane są warunki poprawności ścieżki, tzn. czy 0<*n*<8, czy 0<=*N*<8 oraz czy *N*<=*n*. Jeśli któryś z warunków nie jest spełniony, to pakiet jest odrzucany. Przykłady ścieżek niepoprawnych to: +- *WIDE8-1* +- *WIDE1-2* +- *WIDE0-3* +- *WIDE2-8* +- i wiele innych + +Jednocześnie jeśli w elemencie *N*=0, to ścieżka jest wyczerpana i pakiet jest odrzucany. Potem *n* porównywana jest z zapisaną wartością *max* oraz *rep*. Jeśli *max*<*n*<*rep* (liczba nie zawiera się w żadnym z ustawionych zakresów), to pakiet jest odrzucany. W przypadku, gdy ścieżka jest trasowana, to jeśli: +- *n*<=*max* i *N*>1, np. *WIDE2-2*, to przed elementem dodawany jest znak digipeatera z *H-bitem*, a *N* jest pomniejszane o 1, np. *SR8XXX\*,WIDE2-1* +- *n*<=*max* i *N*=1, np. *WIDE2-1*, to przed elementem dodawany jest znak digipeatera z *H-bitem*, *N* jest pomniejszane o 1 (czyli staje się zerem) i dodawany jest *H-bit*, np. *SR8XXX\*,WIDE2\** +- *n*>=*rep* (o ile *rep*>0), np. *WIDE7-4*, to element zostaje zastąpiony znakiem digipeatera z *H-bitem*, np. *SR8XXX\** (następuje ograniczenie ścieżki). Wartość *N* nie jest brana pod uwagę. + +W przypadku, gdy ścieżka nie jest trasowana, to jeśli: +- *n*<=*max* i 1<*N*<*n*, np. *SP3-2*, to *N* jest pomniejszane o 1, np. *SP3-1* +- *n*<=*max* i *N*=*n* i nie jest to pierwszy element całej ścieżki, np. *...,SP3-3*, to *N* jest pomniejszane o 1, np. *...,SP3-2* (zachowanie identyczne jak wcześniej) +- *n*<=*max* i *N*=*n* i jest to pierwszy element całej ścieżki (jest to pierwszy skok pakietu), np. *SP3-3*, to ścieżka traktowana jest jak trasowalna, tzn. przed elementem dodawany jest znak digipeatera z *H-bitem*, a *N* jest pomniejszane o 1, np. *SR8XXX\*,SP3-2* +- *n*<=*max* i *N*=1, np. *SP3-1*, to *N* jest pomniejszane o 1 (staje się zerem) i dodawany jest *H-bit*, np. *SP3\** +- *n*>=*rep* (o ile *rep*>0), np. *SP7-4*, to element zostaje zastąpiony znakiem digipeatera z *H-bitem*, np. *SR8XXX\** (następuje ograniczenie ścieżki). Wartość *N* nie jest brana pod uwagę. + +> Uwaga! Jeśli wartości *max* i *rep* tworzą zachodzące na siebie przedziały (*max*>=*rep*), to wartość *max* jest traktowana priorytetowo. + +> Uwaga! Jeśli *rep*=0, to funkcjonalność ograniczania ścieżki jest wyłączona. + +Jeśli dla dopasowanego aliasu włączona jest funkcja *direct only* (powtarzania wyłącznie pakietów odebranych bezpośrednio), a element nie jest pierwszym elementem w całej ścieżce lub *N*<*n*, to pakiet jest odrzucany. +Jeśli dla dopasowanego aliasu włączona jest funkcja *viscous delay*, to gotowy pakiet zapisywany jest w buforze, a jego nadanie jest odkładane. Jeśli ten sam pakiet zostanie powtórzony przez inny digipeater w określonym czasie, to zbuforowany pakiet zostanie usunięty (patrz *początek tej sekcji*). Jeśli żadna z tych funkcji nie jest włączona, to do bufora filtra duplikatów zapisywany jest hasz pakietu i pakiet jest wysyłany.\ +Ponadto regularnie odświeżany jest bufor funkcji *viscous delay*. Jeśli minął odpowiedni czas i pakiet nie został usunięty z bufora (patrz *początek tej sekcji*), to jego hasz jest zapisywany do bufora filtra duplikatów, pakiet jest wysyłany i usuwany z bufora *viscous delay*. + +## 4. Rejestr zmian dokumentacji +### 2023/09/06 +- Pierwsza wersja - Piotr Wilkoń \ No newline at end of file diff --git a/doc/schematic.png b/doc/schematic.png new file mode 100644 index 0000000..ccf9d29 Binary files /dev/null and b/doc/schematic.png differ diff --git a/doc/vp-digi.pdf b/doc/vp-digi.pdf deleted file mode 100644 index cb5835c..0000000 Binary files a/doc/vp-digi.pdf and /dev/null differ