ConsolePi icon indicating copy to clipboard operation
ConsolePi copied to clipboard

Console-menu issue

Open Izanatos opened this issue 1 year ago • 2 comments

Hi,

Not sure why but today I tried to jump on own of our consolePi box (btw loving it :) ) and got the following error whilst trying to launch console-menu.

Note these box where configure and installed about a month ago.

admin@ConsolePi01:~ $ consolepi-menu Launching ConsolePi Serial Console Menu Traceback (most recent call last): File "/etc/ConsolePi/src/consolepi-menu.py", line 19, in from consolepi.consolepi import ConsolePi # type: ignore # NoQA ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/etc/ConsolePi/src/pypkg/consolepi/init.py", line 137, in config = Config() # NoQA ^^^^^^^^ File "/etc/ConsolePi/src/pypkg/consolepi/config.py", line 57, in init self.ser2net_conf = self.get_ser2netv4() ^^^^^^^^^^^^^^^^^^^^ File "/etc/ConsolePi/src/pypkg/consolepi/config.py", line 520, in get_ser2netv4 raw = self.ser2net_file.read_text() if not file else file.read_text() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/pathlib.py", line 1060, in read_text return f.read() ^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 34: invalid continuation byte

It appears an error occurred in the primary menu

The shell based menu acts as a backup menu in the unlikely event something breaks with the fully functional python based menu.

The shell menu supports connections to locally attached serial adapters only.

Please report the error above @ https://github.com/Pack3tL0ss/ConsolePi

Enter y/yes to launch the backup shell menu, or enter to exit.

Izanatos avatar Jul 01 '24 15:07 Izanatos

@Izanatos Thanks for the heads up. The issue appears to be with your ser2net config file /etc/ser2net.yaml. It puked trying to read in the text from the file (failed to decode). I haven't seen this error before, did you do something custom with the ser2net.yaml config? What's the output of locale ?

You could try replacing the ser2net.yaml with the default to see if that will resolve it. If you have assigned custom names/aliases to any adapters this would remove a portion of that (it would not be able to grab the baud rate, so it would use the default).

Backup the file currently causing the issue: sudo mv /etc/ser2net.yaml /etc/ConsolePi/bak

replace it with the default ConsolePi ser2net.yaml config: sudo cp /etc/ConsolePi/src/ser2net.yaml /etc

If you previously had custom aliases assigned to your adapters you can reset the udev file as well. This will remove all the custom adapter aliases (you could rename them again in the menu). Otherwise you'll have the custom alias, but won't have a corresponding entry in ser2net.yaml (the menu uses the baud rate defined in ser2net.yaml, which is set when you use the rename command in the menu) To reset the udev file:

Backup the existing version sudo mv /etc/udev/rules.d/10-ConsolePi.rules /etc/ConsolePi/bak

replace with the default: sudo cp /etc/ConsolePi/src/10-ConsolePi.rules /etc/udev/rules.d

Then restart/refresh udev with consolepi-resetudev

If you're willing to share the ser2net.yaml file that is causing the issue, I'd be interested in testing with it to see if I can make that part more bullet-proof, but I haven't seen the issue in the past, and I'm not sure what in the file would cause it to puke.

Pack3tL0ss avatar Jul 01 '24 17:07 Pack3tL0ss

Hi,

It looks like the ser2net.yaml is properly garbled but this was only edited via via the console-menu by renaming TTYUSB to router name no other edit were made to the file directly: ser2net.txt

Izanatos avatar Jul 12 '24 11:07 Izanatos