Re: TNC-PI Checksum error


John G8BPQ
 

Steve,

Something odd going on..

I get
    TNC Software Version           3
01 TXDelay - Zero means use ADC  50
02 Persistance                   64
03 Slottime (in 10 mS)           10
04 TXTail                         3
05 Full Duplex - Not used         0
06 Our Channel (Hex)             00
07 I2C Address (0 = async) Hex   00
   ADC Value                     34
8 3 32 40 a 3 0 0 0 22 52 c0 sum 0

As you can see, there is one more byte, the checksum, before the c0. For some reason your TNC isn't sending the checksum, so the final sum is non-zero.

I suppose as it seems be working perhaps it isn't worth worrying about, but it would be nice to know what is happening. Do you get the same problem if you change some of the registers?

73,
John



On 07/04/2018 14:35, Steve Jones via Groups.Io wrote:
Sorry if this is a double post - but my previous reply appears to have gone into the ether.

Thanks John for your update.  The new version does print PIC version (1), but still pesky checksum error. Always '0xe' from what I am seeing.
           I believe the version of pitnc_get/set that I was using was pointed to by the TNC-PI assembly manual online?
                            I have tried to get the correct versions, so I am not clear what happened there.


Note that when I manually do the xor checksum on the data examples below, I also get a '0xe' as the result:
               8 xor 1 xor 14 xor 40 xor a xor 0 xor 0 xor 0 xor 0 xor 59 = 0xe
               8 xor 1 xor 00 xor 40 xor a xor 0 xor 0 xor 0 xor 0 xor 4d = 0xe

I tried both 'get' and 'set' and through in a reset "15 2", for good luck.
After all these, the checksum error remained. 

EXAMPLE #1 *****************************************

pi@raspberrypi:~ $ ./pitnc_setparams 0 0 1 20

   PIC Software Version           1
01 TXDelay - Zero means use ADC  20
02 Persistance                   64
03 Slottime (in 10 mS)           10
04 TXTail                         0
05 Full Duplex - Not used         0
06 Our Channel (Hex)             00
07 I2C Address (0 = async) Hex   00
   ADC Value                     89
8 1 14 40 a 0 0 0 0 59 c0 sum e
** Checksum Error - Sum = e Should be Zero

EXAMPLE #2 *****************************************

pi@raspberrypi:~ $ ./pitnc_getparams 0 0

Using Serial port /dev/ttyAMA0

   TNC Software Version           1
01 TXDelay - Zero means use ADC   0
02 Persistance                   64
03 Slottime (in 10 mS)           10
04 TXTail                         0
05 Full Duplex - Not used         0
06 Our Channel (Hex)             00
07 I2C Address (0 = async) Hex   00
   ADC Value                     77
8 1 0 40 a 0 0 0 0 4d c0 sum e
** Checksum Error - Sum = e Should be Zero

EXAMPLE #3 *****************************************

pi@raspberrypi:~ $ ./pitnc_setparams 0 0 15 2

pi@raspberrypi:~ $ ./pitnc_getparams 0 0

Using Serial port /dev/ttyAMA0

   TNC Software Version           1
01 TXDelay - Zero means use ADC   0
02 Persistance                   64
03 Slottime (in 10 mS)           10
04 TXTail                         0
05 Full Duplex - Not used         0
06 Our Channel (Hex)             00
07 I2C Address (0 = async) Hex   00
   ADC Value                     77
8 1 0 40 a 0 0 0 0 4d c0 sum e
** Checksum Error - Sum = e Should be Zero

Any suggestions? 
Quite willing to look at code if that might help.  I tried compiling the sources that were in the zip, but I am getting an 'undefined error: FIONBIO'.
               I will continue to look at that.

--
Steve Jones
KA6PRW

Join RaspberryPi-4-HamRadio@groups.io to automatically receive all group messages.