Re: TNC-PI Checksum error


J. Adam Sowers <adam.sowers@...>
 

Hi John,

Is there a repository (GitHub or something like it) where we can keep track of the latest version of the pitnc_[g|s]etparams programs? I had a tough time finding a valid link a month or so ago (the one in the docs didn't work) and I'd love to have one place to go to to get the latest version, add feature requests, etc. 

Thanks,
Adam


On Sun, Apr 8, 2018 at 11:31 AM, John Wiseman <john.wiseman@...> wrote:
Ok, Steve.

Thanks for letting me know.

73,
John

________________________________________
From: RaspberryPi-4-HamRadio@groups.io
[mailto:RaspberryPi-4-HamRadio@groups.io] On Behalf Of Steve Jones via
Groups.Io
Sent: 08 April 2018 14:22
To: RaspberryPi-4-HamRadio@groups.io
Subject: Re: [RaspberryPi-4-HamRadio] TNC-PI Checksum error

I have tried the new version (PITNCParamsApr18) and it looks good.
It now displays version of the pitnc_(g/s)etparams as 0.0.0.5

Below is the output from a couple of my tests:

************************************************************ Output start

pi@raspberrypi:~ $ ./pitnc_getparams 0 0
pitnc_getparams Version 0.0.0.5

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                     14
8 1 0 40 a 0 0 0 0 e 4d c0 sum 0
pi@raspberrypi:~ $ ./pitnc_setparams 0 0 15 2
pitnc_setparams Version 0.0.0.5
pi@raspberrypi:~ $ ./pitnc_setparams 0 0 1 20
pitnc_setparams Version 0.0.0.5

   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                     14
8 1 14 40 a 0 0 0 0 e 59 c0 sum 0
pi@raspberrypi:

************************************************************ Output end


I will be doing more testing and will let you know if I find anything funny.

Thanks for your work and looking forward to moving forward with this!

Let me know if I can help in any way.

Steve KA6PRW






On Saturday, April 7, 2018, 2:12:43 PM PDT, John Wiseman
<john.wiseman@...> wrote:


Steve,

I think this will fix it.

http://www.cantab.net/users/john.wiseman/Downloads/PITNCParamsApr18.zip

Could you test and let me know?

Thanks,
John G8BPQ
On 07/04/2018 18:34, John Wiseman wrote:
I think it is a bug in pitnc_get/set when the checksum (or in fact any other
character) is 0E. That character is used in i2c polling to indicate nothing
available, but is being being incorrectly ignored in get/set. I'll looking
into a fix.

73,
John
On 07/04/2018 17:45, ka2dew Tadd wrote:
I thought I saw a 1 in his PIC firmware version.  Could that be the deal?
Tadd --- Sent from Planet X
http://tarpn.net   

On Apr 7, 2018, at 12:43 PM, John Wiseman <john.wiseman@...> wrote:
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.