laamaa / m8c

Cross-platform M8 tracker headless client
Other
420 stars 87 forks source link

m8c the answer is Abort #22

Closed decadenet closed 3 years ago

decadenet commented 3 years ago

Hello, m8c seems not working. After running m8c the response is Abort.

pi@raspberrypi:~ $ m8c /dev/ttyAMC0 INFO: Looking for USB serial devices. INFO: Found M8 in /dev/ttyACM0. INFO: Opening port. Abandon pi@raspberrypi:~ $

laamaa commented 3 years ago

Your user probably does not have the proper rights to use the port, or there is some other problem with libserialport. Please try running the program with 'LIBSERIALPORT_DEBUG=1 m8c' and paste the full log here.

defensem3ch commented 3 years ago

I'm having the same issue so I hope it's ok if I leave my own comment on this issue. I tried runing with sudo and mine failed also so I'm not sure it's a permissions issue. Here's the log (running on Linux Mint 20.2):

❯ sudo LIBSERIALPORT_DEBUG=1 ./m8c
INFO: Looking for USB serial devices.
sp: sp_list_ports(0x7ffe76601fd0) called.
sp: Enumerating ports.
sp: Enumerating tty devices.
sp: Iterating over results.
sp: Found device /dev/ttyS15.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS6.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS23.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS13.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS31.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS4.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS21.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS11.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS2.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS28.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS0.
sp: Found port /dev/ttyS0.
sp: sp_get_port_by_name(/dev/ttyS0, 0x55eafb3542d0) called.
sp: Building structure for port /dev/ttyS0.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name returning SP_OK.
sp: Found device /dev/ttyS18.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS9.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS26.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS16.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyACM0.
sp: Found port /dev/ttyACM0.
sp: sp_get_port_by_name(/dev/ttyACM0, 0x55eafb3542d8) called.
sp: Building structure for port /dev/ttyACM0.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name returning SP_OK.
sp: Found device /dev/ttyS7.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS24.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS14.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS5.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS22.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS12.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS30.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS3.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS20.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS10.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS29.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS1.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS19.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS27.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS17.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS8.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: Found device /dev/ttyS25.
sp: serial8250 device, attempting to open.
sp: Port type is unknown, skipping.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_transport(0x55eafb3548e0) called.
sp: sp_get_port_transport returning 0.
sp: sp_get_port_transport(0x55eafb354980) called.
sp: sp_get_port_transport returning 1.
sp: sp_get_port_usb_vid_pid(0x55eafb354980) called.
sp: sp_get_port_usb_vid_pid returning SP_OK.
sp: sp_get_port_name(0x55eafb354980) called.
sp: sp_get_port_name returning /dev/ttyACM0.
INFO: Found M8 in /dev/ttyACM0.
sp: sp_copy_port(0x55eafb354980, 0x7ffe76601fc8) called.
sp: Copying port structure.
sp: sp_get_port_by_name(/dev/ttyACM0, 0x7ffe76601fc8) called.
sp: Building structure for port /dev/ttyACM0.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name returning SP_OK.
sp: sp_copy_port returning 0.
sp: sp_free_port_list(0x55eafb3542d0) called.
sp: Freeing port list.
sp: sp_free_port(0x55eafb3548e0) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port(0x55eafb354980) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port_list returning.
INFO: Opening port.
sp: sp_open(0x55eafb354a80, 0x3) called.
sp: Opening port /dev/ttyACM0.
sp: get_config(0x55eafb354a80, 0x7ffe76601f30, 0x7ffe76601f00) called.
sp: Getting configuration for port /dev/ttyACM0.
sp: get_flow(3, 0x7ffe76601f30) called.
sp: Getting advanced flow control.
sp: sp_last_error_message() called.
sp: sp_last_error_message returning Inappropriate ioctl for device.
sp: get_flow returning SP_ERR_FAIL: Getting termiox failed: Inappropriate ioctl for device.
sp: sp_free_error_message(Inappropriate ioctl for device) called.
sp: sp_free_error_message returning.
sp: get_config returning SP_ERR_FAIL.
sp: sp_close(0x55eafb354a80) called.
sp: Closing port /dev/ttyACM0.
sp: sp_close returning SP_OK.
sp: sp_open returning SP_ERR_FAIL.
sp: sp_last_error_message() called.
sp: sp_last_error_message returning Inappropriate ioctl for device.
sp: sp_free_error_message(Inappropriate ioctl for device) called.
sp: sp_free_error_message returning.
[2]    1870809 abort      sudo LIBSERIALPORT_DEBUG=1 ./m8c
defensem3ch commented 3 years ago

OK I talked to jefftheworld and apparently the issue is that the libserialport shipped with my distro has a bug. He advised compiling those libs and rebuilding m8c, which I will do

defensem3ch commented 3 years ago

OK I followed the instructions in https://github.com/laamaa/m8c/issues/20 but am now getting this error:

❯ ./m8c
./m8c: error while loading shared libraries: libserialport.so.0: cannot open shared object file: No such file or directory
defensem3ch commented 3 years ago

OK I got it. Just had to run

❯ sudo ln -s /usr/local/lib/libserialport.so.0.1.0 /usr/lib/libserialport.so.0.1.0
❯ sudo ln -s /usr/local/lib/libserialport.so.0 /usr/lib/libserialport.so.0
❯ ./m8c

and then it worked!

laamaa commented 3 years ago

Glad to hear you got it to work. Doing make clean && make in m8c code directory after installing the new lib should theoretically take care of referencing the correct files, but good that you found a workaround anyway. :)

laamaa commented 3 years ago

@decadenet Could you please try the same thing as @defensem3ch did and see if that solves the issue.

JeffAlyanak commented 3 years ago

@laamaa Not all distros are configured to load libraries from /usr/local/lib/ where the libserialport makefile puts them.

laamaa commented 3 years ago

I'm closing this issue as it is very likely a duplicate of https://github.com/laamaa/m8c/issues/20.

@decadenet please comment if the problem persists even after building libserialport from sources.