💾 Archived View for alaskalinuxuser.ddns.net › 2023-12-01.gmi captured on 2024-09-29 at 00:22:28. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

tnc1-python-config

">

50w, https://alaskalinuxuser3.ddns.net/wp-content/uploads/2023/11/

arduinotncconfig-300x237.png 300w" sizes="(max-width: 650px) 100vw, 650px" /

While trying to troubleshoot my Winlink packet connections with my home-brewed,

slightly modified Arduino-TNC, I found that mobilinkd has made a GUI tool in

python that allows you to adjust the settings. The only problem was following

the instructions to install it!

First, you can download this great tool here:

https://github.com/mobilinkd/tnc1-python-config

I used the traditional git clone method.

$ git clone https://github.com/mobilinkd/tnc1-python-config.git\n$ cd tnc1-

python-config

Once inside, I attempted to follow the instructions:

This was built/tested with Python 3.6, pyserial-3.1.1 and pygobject-

3.28.3\n\npython3-3.6.6-1.fc28.x86_64 python3-pyserial-3.1.1-6.fc28.noarch

python3-gobject-3.28.3-1.fc28.x86_64\n\n./setup.py bdist_rpm\n\nWill build an

RPM that can be installed.

Of course, I don’t need an rpm, but the script has options for build, which

just builds the executable.

But, it gave me these weird errors:

./setup.py build\n/usr/bin/env: ‘python2.7\\r’: No such file or directory

Turns out, after some research, that the file has the carriage return in it,

and you need to specify that it is being used on Linux, so don’t take the

carriage return literally as a backslash r. Fortunately, this guy made a write

up on how to do that with vim (don’t try with vi, didn’t work for me, had to

use vim).

https://stackoverflow.com/questions/19425857/env-python-r-no-such-file-or-

directory

With that fixed, I went back to trying the build.

Traceback (most recent call last):\n File "./setup.py", line 10, in

<module>\n from setuptools import setup\nImportError: No module named

setuptools\n

Okay, so I install setup tools….

$ sudo apt install python-setuptools

Alright, made it through that hurdle.

$ ./setup.py build\n/usr/lib/python2.7/distutils/dist.py:267: UserWarning:

Unknown distribution option: 'executables'\n warnings.warn(msg)\nrunning

build\nrunning build_py\ncreating build/lib.linux-x86_64-2.7\ncopying Avr109.py

-> build/lib.linux-x86_64-2.7\ncopying BootLoader.py -> build/lib.linux-x86_64-

2.7\ncopying IntelHexRecord.py -> build/lib.linux-x86_64-2.7\ncopying

TncModel.py -> build/lib.linux-x86_64-2.7\nrunning build_scripts\ncreating

build/scripts-2.7\ncopying and adjusting TncConfigApp.py -> build/scripts-

2.7\nchanging mode of build/scripts-2.7/TncConfigApp.py from 664 to 775

And when I tried to run it:

$ cd build/scripts-2.7/\n$ python2.7 ./TncConfigApp.py \nTraceback (most recent

call last):\n File "./TncConfigApp.py", line 20, in <module>\n import

serial.tools.list_ports\nImportError: No module named serial.tools.list_ports

Uhhhg! But I didn’t want to build with python 2.7, I wanted to build with

python 3. So, a little research revealed that I need to specify which python

while building:

$ python3 ./setup.py build\nWarning: 'platforms' should be a list, got type

'tuple'\nWarning: 'keywords' should be a list, got type 'tuple'\n/usr/lib/

python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option:

'executables'\n warnings.warn(msg)\nrunning build\nrunning build_py\ncreating

build/lib\ncopying Avr109.py -> build/lib\ncopying BootLoader.py -> build/

lib\ncopying IntelHexRecord.py -> build/lib\ncopying TncModel.py -> build/

lib\nrunning build_scripts\ncreating build/scripts-3.8\ncopying and adjusting

TncConfigApp.py -> build/scripts-3.8\nchanging mode of build/scripts-3.8/

TncConfigApp.py from 664 to 775

Great! Now let’s try that one….

$ cd build/scripts-3.8/\n$ python3 ./TncConfigApp.py \nTraceback (most recent

call last):\n File "./TncConfigApp.py", line 22, in <module>\n from

TncModel import TncModel\nModuleNotFoundError: No module named 'TncModel'

Are you kidding me!

So then I downloaded the prebuilt RPM release and used alien to convert it to a

deb and tried that, but it didn’t work either.

Finally, after more digging, I found this issue post where they tell you what

you need to do:

https://github.com/mobilinkd/tnc1-python-config/issues/2#issuecomment-

1405453827

And what you need to do is: don’t build it, just run the source code with

python!

~/installed/tnc1-python-config$ python3 ./TncConfigApp.py

And then it worked! How frustrating to do all that work, spend about an hour

trying everything to figure it out, only to find out that all I had to do was

NOT FOLLOW THE INSTRUCTIONS THAT CAME WITH THE SOURCE CODE, and run the source

code with python3 directly!

Well, at least after all that, it did work, and it works really well! I hooked

right up to my Arduino-TNC, it recognized it immediately, and I could adjust

the settings!

Linux – keep it simple.