I'm honestly still stuck on getting the serial to work.
I do have a favor to ask though
Can you please post the output of tsu --version
If its not the latest version I can try to build an earlier version and install that.
Then maybe if it works I can be of further assistance
I used apk extractor to create an apk from it but it wouldn't install on my phone. Probably better off with the one you have from the archive. I only installed Termux from the play store last week though, if you can find an Android 6.0.1 cyanogenmod rom and install Termux from the play store you should end up with the same version. It's working well enough for now, internal memory has a few GB spare so I'll probably leave the set up as is for now.
The only requirements are having a phone with at least Android lollipop and otg usb cable. Your phone doesn't need to be rooted.
It's def not finished, some stuff like automatic baudrate detection might be buggy, but it should print just fine
Message me on discord if anyone wants to help out with the project ( Filip#9731).
Thank you for app, installed correctly but I can't connect to my printer throught octoprint interface. In your android app I see Printer is connected but I'm unable to connect to the printer throught octoprint server.
Any advice? I'm using auto port and baud rate set to 115200,my printer is ender 3.
Try setting the port manually - maybe auto detect does not work? Also make sure that the custom plugin (I can't remember the name, something like Octo4A) is enabled too.
Thank you for reply. Setting port manually didnt help - I dont see any port in drop down list, I was also trying to add it manualy throught setting. In this time I'm printing but I will check serial log tommorow.
I was also trying to install your app on another 2 devices (both rooted) but in both cases I got error - app stopped working after I hit install Octoprint button in the app.
I have a tx6 android tv box with real USB ports. I installed everything and tried connecting to the printer (lk4pro) but I see no printer
Where do I find it? Under /dev/what ?
Termux-usb -l shows no devices
I built the app on my laptop and have installed it on an old phone. It starts the octoserver, it sees the connected printer, but octoprint doesn't see the serial port. I think it is a rights issue, could it be that the child process doesn't get the permission to access the serial devices ?
Hi, I want to use my Android phone as print-server too, but sadly @Filip 's .apk crashed while installing octoprint. My phone in question is an ancient Galaxy S2 (almost 10 years old by now...), but it still gets unofficial LinageOS updates. Thing is the kernel doesn't supply a driver for /dev/ttyACM* devices, and I'm to lazy to recompile it. But thanks to a couple helpful pointers in here I came up with another solution:
I made an Octoprint plugin that uses termux-usb and libusb to talk to CDC-ACM usb-serial devices. I tested this on my Galaxy S2 with LineageOS 17.1 (=Android 10) and an Ender 3 with a SKR-Mini E3 board. It is a bit flaky, also when while printing the printer stutters because something is still not fast enough, and also after like a minute of printing the phone crashes But it works up to that point
It's not exactly elegant, because it seems like you can only get the file descriptor for the usb device by running termux-usb -r -e myprogram.py /dev/bus/usb/001/011. So this Plugin opens a subprocess that starts the so called "cdcDaemon" with termux-usb. That Daemon uses the usb-fd to talk to the printer. The Daemon and Octoprint in turn are talking through two sockets (one for each direction).
Fixed a couple bugs and remembered I had a HTC 10 laying around as well -> Got my first smooth print off of an Android phone! https://imgur.com/a/qw9E5Q3
This method should work with most devices as it neither needs root nor the dcd-acm driver in the kernel enabled.
Octoprint sees the port, but connections with 250000 baud rate failsl. 250000 is default for my printer, and I could communicate with it using other serial port connection apps. But here it fails:
2021-01-11 12:42:08,479 - octoprint.util.comm - ERROR - Unexpected error while connecting to serial port /dev/bus/usb/001/002, baudrate 250000 from hook Termux_CDC_ACM: timeout: 'timed out' @ comm.py:_open_serial:3666
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/octoprint/util/comm.py", line 3666, in _open_serial
serial_obj = factory(
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/octoprint/util/__init__.py", line 1890, in wrapper
return f(*args, **kwargs)
File "/data/data/com.termux/files/home/.octoprint/plugins/Termux_CDC_ACM/__init__.py", line 95, in serial_printer_factory
serial_obj = serial_printer(
File "/data/data/com.termux/files/home/.octoprint/plugins/Termux_CDC_ACM/__init__.py", line 38, in __init__
self.OOPIconn = self.OOPIlistener.accept()
File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/connection.py", line 468, in accept
c = self._listener.accept()
File "/data/data/com.termux/files/usr/lib/python3.9/multiprocessing/connection.py", line 614, in accept
s, self._last_accepted = self._socket.accept()
File "/data/data/com.termux/files/usr/lib/python3.9/socket.py", line 293, in accept
fd, addr = self._accept()
socket.timeout: timed out