The TNC-PI is discontinued.
Support for TNC-PI is no longer expected to work on Raspberry PIs set up for TARPNs.
The TARPN project created the NinoTNC as a replacement for the TNC-PI. NinoTNC is easier to build (as a kit), more powerful, easier to configure, easier to operate. I'm leaving these TNC-PI pages intact, but the tools and commands referenced here only exist because they didn't get in the way, much. Some elements will disappear from the TARPN tools over the next several years. Please check out the NinoTNC at TARPN hardware projects documentation. |
See also TNC‑PI General Info, and Ribbon Cable
See also TNC and Radio Adjust and Test
See also Debug a poor link
The first thing that must be done with each TNC-PI is to set it's address. This process is the next step after TNC-PI assembly and must be performed in order to use a TNC-PI with the TARPN installation.
|
Important note: The Raspberry PI cannot talk to the TNC-PI at all if there are more than one TNC-PI with the same address on the I2C bus. (bus means ribbon cable)
The I2C addresses are very easy to inspect and to assign. You can quite easily re‑assign the I2C addresses as you assemble a multi‑port node using tarpn i2c‑set (see below). I recommend that you always assign the first, left or top, TNC‑PI to the lowest I2C address which is 3, and then proceed up in addresses as you go down or to the right in your system. While the I2C numbers can range from 3 to 119 decimal, which is 03hex to 77hex, it is easiest to deal with addresses of 9 and under. Higher numbers are represented differently in hexadecimal vs decimal displays. (see Hexidecimal)
If you have a TNC‑PI you suspect is not assigned an I2C address, or which is unresponsive to the i2c commands, you may need to move it back to I2C from async.
The procedure to do this is here: Async to I2C
Once you have set up the parameters and the I2C addresses, you can do I2C commands to each to make sure they are talking.
Once they are all moved to I2C and configured, run the tarpn test
command and start the G8BPQ node. See the TARPN Command List.
The TNC‑PI has non‑volatile variables that set some features. For TARPN purposes these have known and fixed values but each TNC needs to be configured for these values. The configurables include: | |
TxDelay |
Note that TXDELAY is set by using potentiometer R6 on the TNC‑PI.
However, the TNC‑PI may be configured in the i2c settings to set the TxDelay via i2c.
At this time we are recommending that TxDelay be controlled via R6 and not via i2c.
TXDELAY should be addressed any time you associate the TNC‑PI with a different radio, and possibly with a different link neighbor. TXDELAY is how long after the transmitter is keyed the TNC will wait before sending data. This variable tells the TNC‑PI what TXDELAY value to use, unless this variable is 0 in which case it tells the TNC‑PI to read the value of R6:TXDELAY potentiometer and use that. The software TARPN uses to run the nodes will instruct the TNC‑PI to use 0, and will refresh this 0 value periodically, forcing the use of the potentiometer. This means that any setting on the TNC‑PI non‑volatile variable will only be used intermittently. For your sanity you should probably set this to 0 during initial configuration. |
Persistance | Controls what chance out of 255 that this TNC select to transmit in a slot. For a dedicated link, we set this to 215. Since all of our ports are dedicated links, set this to 215. (why not 255? Because once in a while both ends of the link want to transmit and would keep sending at exactly the same time, colliding over and over. Setting to 215 gives it a 1 in 5 chance of NOT transmitting immediately). |
Slot Time | Sets how long a slot is. This is the amount of time where we can’t know if a station that could go into transmit and collide with us has actually gone into transmit. It is roughly equivalent to the worst TxDelay for any TNC on the channel. This value is used in calculations for channel sharing. The TNC will decide to wait some number of slots as calculated using the Persistance value. Lacking information on the radio performance as I type this, 15 is probably fine. That's about 150mS or 1/7th of a second. |
TXTail | How long after the packet message is completed before the TNC unkeys the transmitter, in milliseconds. For 1200 baud packet we set this to a very low value, like 1. |
I2C Address |
This value is 0 if the TNC is to use the tty‑async‑serial port to talk to the Raspberry PI.
This value is from 3 to 119 decimal to specify an address on the I2C bus.
Note that in some places the i2c address is shown using Hexadecimal Numbers. Also note that the TNC-PI will continue to use its old I2C address until it is power cycled or reboot. Use tarpn i2c-set addr 15 2 (register 15, write to 2) to instruct the TNC-PI to reboot. |
Coastal Chipworks' tnc‑x.com: TNC PI assembly instructions and Operating Tips
Note: Due to a feature and a bug in the i2c architecture, this command may fail to read the data from the TNC‑PI and will instead produce suspiciously correct looking results.
The dead give‑away that the data you are reading is garbage is that the I2C address figure will be incorrect.
Simply run the command over and over until the data looks correct.
Rumor has it that this is made worse if the TNC‑PI involved is receiving data from the radio.
Try unplugging the TNC from the radio and then unplugging and replugging the ribbon cable.
pi@nathan ~ $ tarpn i2c‑get 4
#### =TARPN v127 =
Getting TNC‑PI registers at address 4
01 TXDelay ‑ Zero means use ADC 00
02 Persistance 215
03 Slottime (in 10 mS) 15
04 TXTail 0
05 Full Duplex ‑ Not used 0
06 Our Channel (Hex) 00
07 I2C Address (0 = async) Hex 04
ADC Value 29
8 3 28 0 a 0 0 0 4 1d 70 c0 sum 0
done
pi@nathan ~ $
Notice that register 7 shows the i2c address for the TNC‑PI. Setting register 7 (using tarpn i2c‑set) will allow you to change the i2c address. If you set it to 0, the TNC‑PI will no longer respond to I2C at all and will now respond to async bus commands including the i2c‑assign command. If you change the I2C address you will have to power cycle the TNC‑PI or give it the register 15 reset command. See below.
Note: Due to an implementation issue outside of our control, any command may fail to write or read‑back the data from the TNC‑PI and will instead produce suspiciously correct looking results.
The dead give‑away that the data you are reading is garbage is that the I2C address figure will be incorrect.
You may repeat the command indefinitely until you get back good looking data.
Unplugging the radio from the TNC and then resetting the TNC‑PI by unplugging and replugging the ribbon cable may fix the problem.
Below are procedures for
pi@smithnode ~ $ tarpn i2c #### =TARPN v117 = Scanning for attached TNC‑PIs note: Addresses found are shown in HEXADECIMAL. 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: 03 04 -- 06 -- -- -- 0A -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- |
Note: If you have more TNCs connected than are showing on the attached TNC‑PI table, unplug all but one TNC from te ribbon and run the command again. Repeat for each TNC. It is possible you have more than one TNC assigned to the same I2C address. If that is the case, use the commands tarpn i2c‑get and tarpn i2c‑set to change its address. See this link: Change I2C Address of TNC‑PI for details.
tarpn i2c‑set 3 1 0
Use tarpn i2c‑set to set the Persistance value in register number 2 to 215. This tells the TNC that most any time the channel is clear it is ok to transmit.
tarpn i2c‑set 3 2 215
Set Slottime to 15, TXTAIL to 1.
tarpn i2c‑set 3 3 15 tarpn i2c‑set 3 4 1
![]() |
||
![]() |
Register 01 TXDelay should be set to 0.
The Persistence should be set to 215. The Slottime should be 15. The TXTail should be 1. Full Duplex should be 0. Our Channel should be 0. I2C Address is the address you wrote to the TNC and it will match the I2C address you used for the command however it is displayed here in hexadecimal. |
Next step: TNC and Radio adjust and test