dsTNCv2 aka dsTNC on steroids
5 years after publishing the dsTNC modem, I finally found a moment to develop the project further. Please forgive the modest documentation page, but I'm still working on the project and splitting my time between professional duties, family and hobby. So please bear with me. The dsTNCv2 project had its premiere at the APRS enthusiasts meeting - Tama 2017. Here you can take a look at the presentation. Artur SP3VSS recorded my presentation at Tama APRS 2017. I'm not particularly happy with how the presentation turned out; I had a cold and was presenting with a fever :-(
Why? I wanted to have a TNC/iGate that simultaneously supports 1200 and 9600 (of course when connected to an appropriate radio with a so-called "flat audio" output), which would allow a slow migration and operation in 2 systems simultaneously. As a bonus, I made it easier to chase weather sondes, since I always have the radio and dsTNC with a Bluetooth interface in my car and I only need to change the VFO frequency to decode the sonde position in real time during the chase. For Android users I recommend the APRSDroid app. Instead of a Bluetooth interface, you can solder in a pre-programmed ESP01 module and you have a fully autonomous iGate - all you need is a WiFi network and a radio with an antenna :-)
Current project status
- KISS and TNC2 (text) protocols via serial port or Bluetooth
- AFSK 1200 modulation/demodulation (1005 frames from the WA8LMF test track - frame list)
- GMFSK 9600 modulation/demodulation (AX.25)
- GMFSK 4800 demodulation (Vaisala RS41) - outputs sonde object
- FEC ReedSolomon 1/2 decoder + deinterleaver (d-star)
- All above demodulators run simultaneously!
- IGate (using ESP01 module and firmware by Krzysiek SP9SKP)
- IGate on ESP-igate (XIAO ESP32-C6: WiFi + KISS over BLE, also for iPhone)
- FX.25 (Reed-Solomon FEC for AX.25) on receive (all 11 tags) and transmit - compatible with Dire Wolf
- Meteomodem M20 radiosonde decoding - APRS object M20-xxx, same as for RS41
- New 1200 and 9600 receive path: Gardner clock recovery, several decision thresholds at once, level normalisation and repair of a single corrupted symbol in a frame
- KISS ports: a frame from port 0 goes on air as 1200, from port 1 as 9600; received frames carry the channel number (0 - 1200, 1 - 9600, 2 - APRSng, 3 - RS41, 4 - M20)
- Modem configuration over KISS (SetHardware) plus TXDELAY and TXtail commands - from the app, no console cable needed
- 1200 and 9600 over one cable: with the output on the radio's 9600 data port, the modem does the 1200 pre-emphasis, deviation limiting and ~3 kHz band filtering itself (see FAQ)
TODO
Publish documentation :-)- Bootloader
Configuration :-)DONE! (see FAQ, SV1 connector description)GMFSK modulator filters- Pilotsonde GRAW demodulation
- Rebuild AX25 network stack (buffers/queues)
- New APRS DIGI
Automatic Bluetooth HC-05 module configurationDONE! Only requires a piece of kynar wire Applies to PCB REV1Improve GMFSK mode compatibility with various radiosDONE!Automatic signal normalization and automatic phase detection (if necessary).DONE! Additionally, you must replace C10 and C11 with 2.2 uF Applies to PCB REV1
Documentation
- schematic [PDF]
- schematic [eagle]
- Bill of materials [html]
- PCB [pdf]
- PCB [eagle]
- PCB [gerber]
- firmware 2017-06-29
- ESP01 firmware (iGate) (c) Krzysztof Parma SP9SKP (version 1.01) (flashing under Linux: esptool.py write_flash 0 ESP4dsTNC.ino.generic.bin)
- dsTNCv2 + ESP01 firmware from 2017-12-01 You must flash both!
- dsTNCv2 + ESP01 firmware from 2018-03-26 You must flash both!
- dsTNCv2 firmware from 2020-05-03 1k2 and 9k6 TX (config $3)
- dsTNCv2 firmware from 2026-03-15 code optimization, migration to new compiler, rewritten ESP4DSTNC - message routing, bidir igate
- dsTNCv2 firmware from 2026-11-19 FX.25, M20 radiosondes, new receive path, KISS ports 1200/9600, configuration over KISS, 1200 and 9600 transmit shaping for the radio's data port, new compiler * LATEST *
- Schematic rev2 [pdf]
- Schematic rev2 [eagle pcb]
- PCB rev2 [eagle pcb]
- PCB rev2 [gerber]
- Component layout top [PDF]
- Component layout bottom [PDF]
Configuration register list
- $0 - callsign configuration (tracker, APRSNG and radiosonde object source) - in CALLSIGN-SSID format. If the callsign should have no SSID, enter CALLSIGN-0
- $1 - radiosonde object transmission rate limiting - value in seconds defines the time between consecutive frames pushed to igate. 0 - every frame is transmitted
- $2 - radiosonde object transmission rate limiting to iGate
- $3 - Modulation 0 = 1k2 AFSK, 1 = 9k6 GMFSK
- $4 - dump of received frames to the console: 1 = on, 0 = off
- $5 - FX.25 on transmit: 0 = off, 1 = automatic, 16/32/64 = number of parity bytes
- $6 - TX delay for 1200 in ms (10..1000, default 200); the KISS TXDELAY command changes it until restart
- $7 - KISS ports: 0 = as before (everything on port 0, speed from $3), 1 = port 0 transmits 1200, port 1 transmits 9600, received frames carry the channel number
- $T - TX tail for 1200 in ms (10..1000, default 50); the KISS TXtail command changes it until restart
- $P - where the modem output goes: 0 = radio microphone input (1200 as in previous versions), 1 = 9600 data port (the modem does the 1200 pre-emphasis, limiter and band filter)
- $L - 1200 level with $P=1: amplitude of the 2200 Hz tone in % of DAC full scale (1..100, default 25)
- $E - 1200 pre-emphasis with $P=1: how many dB the 2200 Hz tone is louder than 1200 Hz (-6..9, default 5)
- $H - 9600 level in % of DAC full scale (1..100, default 61)
- $G - 9600 pulse shape: 0 = Gaussian (as before), 1 = raised cosine (narrower spectrum, but a smaller eye)
- $X=Hz[,s] - test tone for s seconds (default 5) through the 1200 path, for deviation calibration; stores nothing
- $8=1 - receive interrupt time and lost sample blocks (diagnostics)
- $9=s - dump of receive path samples for s seconds at 2 Mbit/s (diagnostics)
- $? - all registers and received frame counters
Registers $0..$7, $T, $P, $L, $E, $H, $G and $X can also be set over KISS with the SetHardware command: the same text as on the console, just without the $ (e.g. P=1), answered with OK P=1. A bare ? returns all settings.
FAQ
What programmer do I need?
Unfortunately, programmers for more advanced PICs are not that popular. To program the processor you will need a Microchip programmer (or a Chinese clone): PICKIT2, PICKIT3 or ICD3.
Applies to PCB REV1:
Please note the programming connector pinout - you need an adapter (pinout here). Sorry about that, but I made a cable and got so used to it that I can't part with it. I promise that in the next PCB version the connector will be compatible with the PICKIT series ;-)
How do I connect this gadget to a radio?
I thought it was obvious from the schematic ;-) The connector is designed so that dsTNCv2 can be used interchangeably with TinyTrak. DB9 connector pins:
pin 1 - radio input mic or 9600 pin 3 PTT - open drain pin 5 - radio output flat audio pin 6 ground pin 7 optional power supply from the radio side
How do I transmit 1200 and 9600 over one cable?
9600 only passes through the flat modulator input - the radio's data port, usually labelled PACKET 9600 or DATA 9600. Behind that input the radio no longer does pre-emphasis, deviation limiting or band filtering, and 1200 needs all of that. Since the 2026-11-19 version the modem does it: set $P=1, and if the app should choose the speed by KISS port number, also $7=1. 1200 is then generated with pre-emphasis ($E), a limiter and a ~3 kHz band filter, as if it had passed through the radio's microphone path, and it is clean above 4 kHz.
Levels are set once per radio, because data port sensitivity varies. $X=2200 transmits a clean 2200 Hz tone for 5 s: measure the deviation (deviation meter, SDR) and pick $L so that it comes out at about ±3 kHz. $X=1200 shows the tilt - the 2200 Hz tone should have about 5 dB more deviation than 1200 Hz, and $E corrects it. Set $H the same way with a 9600 frame. On my ID-8800 it came out as $L=70, $E=6, $H=61, and above about 70% of full scale the path was already starting to saturate - don't overdo it.
If the modem output goes into the radio's microphone input (1200 only), keep $P=0: 1200 is then transmitted exactly as in previous versions.
9600 and RS41 decoding doesn't work - what should I do?!
For decoding to work properly, dsTNCv2 must be connected to the "flat audio" output of the radio. This port is most commonly labeled PACKET 9600. A standard audio output (like the headphone jack on a Baofeng) is not suitable for this purpose - the received signal is cut off by the de-emphasis filter, which makes it impossible to reconstruct its original shape.
What is the SV1 connector for?
It's a diagnostic RS232C port (CMOS level) 1-RX, 2-GND, 3-TX. You can connect a USB to RS232 cable (3v3 level!!!), configure a terminal program to work at 115200 bit/s and monitor received frames. You can also configure the modem:
$0=SP9UOB-0 [$0] My callsign set to: SP9UOB-0 $1=15 [$1] RS41 rate limited to 15 secs
Can I use WiFi and Bluetooth simultaneously?
No. You must choose which connectivity you want to use with the modem and install the appropriate module.
What do the LEDs mean?
- LED5 - Power
- LED4 - DCD
- LED3 - heartbeat
- LED2 - TX
- LED1 - unused (any ideas? :) )
- LED7 - Bluetooth
- LED6 - Bluetooth connection
What is the WiFi password and how do I set it up?
After programming the ESP01 module, it starts in configuration mode. It broadcasts an SSID:dsTNC network with the password 123456789. The module defaults to address 10.0.0.1 and that's the address you should enter in your web browser. Connect to the above network and configure the module for your own WiFi network (SSID, password). Note! Currently you cannot use spaces in the network name (Krzysiek will probably fix this). Additionally, you must statically configure the IP address, Gateway and DNS - at this point the module does not support a DHCP client. Version ESP4dsTNC_1.01.bin includes a DHCP client. Of course, you can still statically assign an address to the device.
How do I connect via Bluetooth?
dsTNCv2 configures the Bluetooth module to broadcast with the name dsTNC. The default HC-05 module pairing PIN is 1234. dsTNC does not change the PIN, so if you set a non-default one - that's the one you'll need for pairing.
Why does the voltage regulator get so hot?
Because when powering the modem from 12V, the regulator has to dissipate almost 1.5 watts of power. To simplify the design, I chose an LDO regulator instead of a switching converter. The device will not be damaged when powered from 12V, but powering it from 5V is recommended.
If you are interested in a PCB or a pre-programmed processor - please contact me as well.