Topics

TNC-PI Checksum error

Steve Jones
 

Hello all:
First time posting in this group, so please excuse me  if I did not search deep enough for this question - but I did search and found nothing related:

I have a TNC-PI (40 Pin connector version) on a Raspberry PI.  I can communicate to the board via the PI's UART input and, additionally via the i2c addresses if I set up for that.
The issue I am having is that in both cases (UART and I2C connections) I appear to be getting a checksum error for both the 'pitnc_setparams' and the 'pitnc_getparams' commands.

Funny thing is that both of these commands do seem to work correctly - e.g. I can "set and get" parameters correctly but still get the checksum error. 

The following is an example of what I am seeing:
 
pi@raspberrypi:~ $ ./pitnc_getparams 0 0

** Checksum Error - Sum = e Should be Zero

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
 

Does anyone have ANY idea why this may be happening or what to check next?
Additionally, I have tried this on two separate Raspberry Pi's and I get the same response on both.

Thanks!
--
Steve Jones
KA6PRW

John Wiseman
 

Steve,

It looks like you are using an old version of pitnc_getparams (it should display the TNC Software version before the TXDelay line).
You can download the latest from http://www.cantab.net/users/john.wiseman/Downloads/NewPITNCParams.zip. Try that and see if it helps.

73,
John G8BPQ

On 06/04/2018 23:49, Steve Jones via Groups.Io wrote:
Hello all:
First time posting in this group, so please excuse me  if I did not search deep enough for this question - but I did search and found nothing related:

I have a TNC-PI (40 Pin connector version) on a Raspberry PI.  I can communicate to the board via the PI's UART input and, additionally via the i2c addresses if I set up for that.
The issue I am having is that in both cases (UART and I2C connections) I appear to be getting a checksum error for both the 'pitnc_setparams' and the 'pitnc_getparams' commands.

Funny thing is that both of these commands do seem to work correctly - e.g. I can "set and get" parameters correctly but still get the checksum error. 

The following is an example of what I am seeing:
 
pi@raspberrypi:~ $ ./pitnc_getparams 0 0

** Checksum Error - Sum = e Should be Zero

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
 

Does anyone have ANY idea why this may be happening or what to check next?
Additionally, I have tried this on two separate Raspberry Pi's and I get the same response on both.

Thanks!
--
Steve Jones
KA6PRW

Steve Jones
 

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

John Wiseman
 

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

 

I thought I saw a 1 in his PIC firmware version.  Could that be the deal?

Tadd --- Sent from Planet X

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

Steve Jones
 

Yes - the version reports as "1". 
I get the same response (checksum error = 0xe) if I read (all) or write any register.
Steve


On Saturday, April 7, 2018, 9:45:36 AM PDT, ka2dew Tadd <tadd@...> wrote:


I thought I saw a 1 in his PIC firmware version.  Could that be the deal?

Tadd --- Sent from Planet X

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


--
Steve Jones
KA6PRW

John Wiseman
 

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

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


John Wiseman
 

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

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



Steve Jones
 

Yes will test in morning.  
Have been out and about today.
Thanks for the efforts.

Steve KA6PRW

On ‎Saturday‎, ‎April‎ ‎7‎, ‎2018‎ ‎02‎:‎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

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




--
Steve Jones
KA6PRW

Steve Jones
 

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

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




--
Steve Jones
KA6PRW

John Wiseman
 

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

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







John Wiseman
 

Adam,

I’m not sure if you are asking me or John Hansen who supplies the TNC-PI and
maintains the docs, but I don’t maintain a GitHub repository,

73,
John

________________________________________
From: RaspberryPi-4-HamRadio@groups.io
[mailto:RaspberryPi-4-HamRadio@groups.io] On Behalf Of J. Adam Sowers
Sent: 09 April 2018 22:01
To: RaspberryPi-4-HamRadio@groups.io
Subject: Re: [RaspberryPi-4-HamRadio] TNC-PI Checksum error

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