Date
1 - 4 of 4
TNC-96K PITNCParamsApr18.zip
I just got a TNC-96K and flashed it.
I am trying to run the makeit so that I can run it from my raspberry pi. However this is the error that I keep getting. pitnc_getparams.c: In function ‘main’:
pitnc_getparams.c:201:13: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
201 | retval = ioctl(fd, I2C_SLAVE, address);
| ^~~~~
pitnc_getparams.c:239:3: warning: implicit declaration of function ‘i2c_smbus_write_byte’ [-Wimplicit-function-declaration]
239 | i2c_smbus_write_byte(fd, FEND);
| ^~~~~~~~~~~~~~~~~~~~
pitnc_getparams.c:271:13: warning: implicit declaration of function ‘i2c_smbus_read_byte’ [-Wimplicit-function-declaration]
271 | retval = i2c_smbus_read_byte(fd);
| ^~~~~~~~~~~~~~~~~~~
pitnc_getparams.c: In function ‘OpenCOMPort’:
pitnc_getparams.c:668:12: error: ‘FIONBIO’ undeclared (first use in this function)
668 | ioctl(fd, FIONBIO, ¶m);
| ^~~~~~~
pitnc_getparams.c:668:12: note: each undeclared identifier is reported only once for each function it appears in
pitnc_setparams.c: In function ‘main’:
pitnc_setparams.c:239:12: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
239 | retval = ioctl(fd, I2C_SLAVE, address);
| ^~~~~
pitnc_setparams.c:279:3: warning: implicit declaration of function ‘i2c_smbus_write_byte’ [-Wimplicit-function-declaration]
279 | i2c_smbus_write_byte(fd, FEND);
| ^~~~~~~~~~~~~~~~~~~~
pitnc_setparams.c:336:13: warning: implicit declaration of function ‘i2c_smbus_read_byte’ [-Wimplicit-function-declaration]
336 | retval = i2c_smbus_read_byte(fd);
| ^~~~~~~~~~~~~~~~~~~
pitnc_setparams.c: In function ‘OpenCOMPort’:
pitnc_setparams.c:706:12: error: ‘FIONBIO’ undeclared (first use in this function)
706 | ioctl(fd, FIONBIO, ¶m);
| ^~~~~~~
pitnc_setparams.c:706:12: note: each undeclared identifier is reported only once for each function it appears in
pitnc_flash.c: In function ‘WaitForResponse’:
pitnc_flash.c:141:17: warning: implicit declaration of function ‘i2c_smbus_read_byte’ [-Wimplicit-function-declaration]
141 | RXBlock[n] = i2c_smbus_read_byte(fd);
| ^~~~~~~~~~~~~~~~~~~
pitnc_flash.c: In function ‘main’:
pitnc_flash.c:392:3: warning: implicit declaration of function ‘i2c_smbus_write_byte’ [-Wimplicit-function-declaration]
392 | i2c_smbus_write_byte(fd, FEND);
| ^~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc3KeZD7.o: in function `WaitForResponse':
pitnc_flash.c:(.text+0x9c): undefined reference to `i2c_smbus_read_byte'
/usr/bin/ld: /tmp/cc3KeZD7.o: in function `main':
pitnc_flash.c:(.text+0xa20): undefined reference to `i2c_smbus_write_byte'
/usr/bin/ld: pitnc_flash.c:(.text+0xa34): undefined reference to `i2c_smbus_write_byte'
/usr/bin/ld: pitnc_flash.c:(.text+0xa48): undefined reference to `i2c_smbus_write_byte'
collect2: error: ld returned 1 exit status
I am running the latest raspberry pi os lite 2022-04-04. I tried with 32 bit and 64 bit. Same error. Anybody else have this problem? Regards, Chris Andrist, KC7WSU
|
|
David Ranch
Hello Chris, The TNCPi 9k6 hardware a little bit of a fringe area here on this Raspberry Pi list but I do know that John Wiseman G8BPQ who maintains the 9k6 firmware and some of these utilities *is* a member of this list. Maybe he will chime in. Anyway, here are my thoughts: - Have you viewed the TNC Pi (k6 resources here? https://www.wvcarc.com/p/tnc-96k-resources.html I don't see any email support lists there other than the very obsolete Yahoo one. I don't know if there is a newer replacement email list - I see you're trying to compile the TNCPi I2C tools. Is there a reason why you are compiling vs. using pre-built binaries? Where did you download the sources from? The true home to these tools is here: https://www.cantab.net/users/john.wiseman/Downloads/ - What version did you download? - In https://www.cantab.net/users/john.wiseman/Downloads/PITNCParamsApr18.zip , there are pre-built versions that should work for your Raspberry Pi Anyway, I was able to reproduce your error and it seems that in each of the .c files, there is the following line that is commented out for some reason: //#include <sys/ioctl.h> //#include <linux/i2c-dev.h> Remove the "//" in the front of that line in each file. Next, it seems that it's now required to ADD the following include line say after the i2c-dev.h line: #include <i2c/smbus.h> Next, make sure you have the required I2C libraries and tools installed: sudo apt install libi2c-dev libi2c0 i2c-tools Now doing all that, it should build but on my Linux machine, I'm still seeing "i2c_smbus_write_byte" compile errors. If you search around on the internet with the term: linux undefined reference to "i2c_smbus_write_byte" there are lots of hits but few conclusive answers. --David
On 04/19/2022 08:49 AM, Chris Andrist
wrote:
I just got a TNC-96K and flashed it.
|
|
Mat Murdock
The utility is pre-compiled and available on this site under the heading TNC-96K Utility Software
http://www.wvcarc.com/p/tnc-96k-resources.html Mat
|
|
Thanks everyone. I was using the pre-compiled, but it wasn't working. I downloaded it again and unzipped it and it worked.
Super weird. Thanks Again! Regards, Chris
|
|