Octoprint Plugin to print to tty ACM devices on Android through libusb in Termux. It uses libusb and a cdc-acm-driver written in Python.
This als ALPHA!
usblib.py is taken from GitHub - Querela/termux-usb-python: USB access with Python on Termux (Android)
- https://play.google.com/store/apps/details?id=com.termux
- https://play.google.com/store/apps/details?id=com.termux.api
You might want to set up a ssh server to have an easier time typing all that stuff via a remote shell on your computer ( https://wiki.termux.com/wiki/Remote_Access#Using_the_SSH_server ), but you can also punch it into your phone:
pkg update
pkg install python termux-api libusb clang git libexpat
pip install octoprint pyusb pyftdi
termux-usb -l
should show something like /dev/bus/usb/001/011
when the printer is connected (usually via an USB-OTG adapter)
first you can check your current ip using
ip addr
then start octoprint like this.
octoprint serve
If octoprint works correctly on http://<ip-addr>:5000
, complete the setup dialog. Then stop it again with Ctrl+C
cd ~/.octoprint/plugins
git clone https://github.com/schuhumi/Termux_CDC_ACM/
octoprint serve
You should now see an entry similar to /dev/bus/usb/001/011
in the serialport dropdown menu in Octoprint's webinterface. Choose it and also choose the correct baudrate, then click connect. Now a popup should appear on your Android device asking for Termux's permission to access the usb device, choose yes. Octoprint should now connect to your printer.