Open nunoms86 opened 10 months ago
I'm not sure about this. From what I can tell "/dev/usb/lp0" is a printer device (not a true serial/tty device), and the error code 25 at the indicated line corresponds to the Linux error ENOTTY. So perhaps the underlying device driver for talking to this device emulates TTY better on some devices than on others (or the driver is different between the systems you are seeing where it works vs. where it doesn't). In either case, this doesn't seem like something I can do anything about from the library side of things.
In the same system we can open the port for read/write with no error using our native code 🤔
Our C code (JNI) that works:
open( "/dev/usb/lp0", O_RDWR | O_NOCTTY);
Can I obtain more info about the reason for the following error? lastErrorCode:25 lastErrorLocation:758
This code is working in systems with apparently the same specs/OS, I'm lost on why is not woking on the others...
Code:
Output: Printer.init openPort failed: comPort:/dev/usb/lp0 lastErrorCode:25 lastErrorLocation:758
Host/OS info: Raspberry 4 JDK 1.8 and version 2.10.4 of the library.
root@rpi4:~# cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
root@rpi4:~# uname -a Linux rpi4 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux