Can Android on touchscreen be more open?

Someone mentioned that OctoPrint runs very slow on the not too powerful touchscreen controller.

Thatā€™s likely because they had the touchscreen controller plugged into a USB hub, and itā€™s trying to do serial through the hub.

If you just want to use another Android to run octoprint, thatā€™s simple, just plug the android device into the mini USB port like you would with a raspberry pi (I set this up on a snapmaker original that I gave to my brother and it worked fine).

The nice thing about running octoprint directly on the HMI Android device would be that you wouldnā€™t need to have 2 android devices plugged into the machine.

Of note why the previous poster probably couldnā€™t just have the HMI directly run octoprint: the SerialConnection code in the FAB app looks like the sendGcode method will need to put some correct headers when building the FABPacket, so itā€™s not just a straightforward UART connection between the HMI and the CANhub, you need to speak snapmakers custom packet language.

However, IIUC, this is how luban communicates though, and even USB printing seems to load the gcode into the HMI, and then send it to the machine via SerialConnection.sendGcode, so it should be plenty fast, as long as the octoprint app doesnā€™t kill the CPU on the HMI (which would be weird)

I wonder if they took this code from somewhereā€¦ Luban and Firmware are basically just opensource products cobbled together. What couldā€™ve be in the way to copy the communication protocol.

We can already install apps, without ADB. Just via UI.

Is this the app? GitHub - feelfreelinux/octo4a: Use your old Android device as an OctoPrint server.

you must either install a root checking app or a terminal app. in the terminal simply type su and hit enter to check for root

Yeah, just checked, doesnā€™t look like it is rooted. Iā€™m working on getting it rooted.

Qualcomm MSM8909 Snapdragon 210
Android v7.1.2.01.001

my developer settings are open, theres no adb options. i havent yet found how to enter fastboot or anything. wifi adb apps from fdroid also dont work without root.

I wonder if adding buttons will work lol

1 Like

but does this third mouse have such an excited community as we do? :slight_smile:

1 Like

thats it. it works well enough with maybe 5 plugins max. after it becomes sluggish both during a reload and during the render of the page on the browser. arcwelder is a must have to not have random stalls and stutters during the print. even with arcwelder it runs slowly sometimes but when this happens 8/10 times can click the recent apps button on the android navigation bar and see there are apps open in the background trying to give updates, other apps that seem to be settings and configuration apps. im not 100% sure there isnt someone or something with backdoor access to my printers android at this point. i must go into my hoard to get an old wifi router and create an offline wifi network for further testing

what VNC app did you use?

Ok, stupid idea: since the HMI might not be powerful enough to run octoprint itself, Iā€™m considering continuing with my rpi octoprint instance, but then just installing a browser on the HMI, so I can just control octoprint from the HMI

2 Likes

I mean, why not :slight_smile:
jbot installed VNC app to control touchscreen from his phoneā€¦

Iā€™ve opened up one of my controllers, easy with the right tools.
It has a button on PCB, but I donā€™t know what it is doing. I tried pressing it and holding it while giving power - it doesnā€™t turn on this way.
Pressing it while the system is booted doesnā€™t do anything.

Full resolution - awesome-snapmaker/images/Snapmaker_Parts/SP_2.0/SM_2.0_Touchscreen_PCB.jpg at main Ā· shurushetr/awesome-snapmaker Ā· GitHub

There are some communication points at the top, between the button and the antenna - but an IC is missing, so not sure if these will do anything.

That button looks like itā€™s connected to some sort of communication wire? The traces on one side go to something labeled COM and on the other side it looks like TX RX.

Something interesting, on the bottom there I see SDA/SCL which is for I2C protocol communication.

Iā€™m also curious about that big ribbon connector there, could that be USB? (5v, TXD, RXD, GND)

Iā€™m going to make a better picture. The big white connector is USB-C. The connector under button - says CON1.

Log from unsuccessful installation of the octoprint on SM_2.0 touchscreen

Change extension to HTML to view
bluetooth_content_share.gcode (120.5 KB)

@nivekmai - updated my post with highres.
@Hauke - what do you think about it?

im running octo from it right now, but im using arc welder to make the gcode easier to process. ill also need to find a way to make meatpack run without preventing octoprint being able to connect to the mainboard.

vnc, and usb webcam host all running on the screen at once.

2 Likes

OK, helpful picture, thanks! Here are my thoughts - but just to say it out at the beginning: I guess thereā€™s not too much to learn that we do not already know after all. Here would be my key takeaways:

  • While this is a Android device, there is a ā€œsisterā€ module that runs Linux - maybe some guru/enthusiast could get Linux to run on this device.
  • The UART to the Snapmaker controller is directly built in to the phone module, no USB-to-UART bridge. Meaning that if you want to replace the touchscreen controller with a more powerful Smartphone you need to provide this UART functionality in a different way. As suggested earlier, a USB-Hub/USB-to-UART bridge combo might do the trick.
  • There is some unused functionality in the phone module, which with a combo of hardware tinkering and software might add: keys (volume, power) to use for whatever, cameras (two, MIPI), an SD card (that might be interesting to extend memory!), a motor (vibration) and audio (in and out - for whatever purpose :slight_smile: ). Also, lots of GPIO, IĀ²C, ADC etc. - happy tinkering :slight_smile:

The details:

Overview/Specā€™s of the phone module family: https://www.quectel.com/content/uploads/2024/03/Quectel_SC20_Series_Smart_Module_Specification_V2.1-4.pdf?wpId=114725 - or here: https://www.mouser.com/datasheet/2/1052/Quectel_SC20_LTE_Specification_V1.8-1830326.pdf?srsltid=AfmBOooHNF0Vi8AtRXIw7ttnRAb394X7DqjWc08T6EaR_nJ3PB_m3eew

Found this full datasheet incl. pin diagram on page 17: https://snapeda.s3.amazonaws.com/manufacturer-upload/Quectel/Hardware+Designs/Quectel_SC20-W_Hardware_Design_V1.4.pdf

It has two dedicated UARTs, one is broken out at the top. The not soldered IC may be a logic level converter:

The other UART has such an IC (red arrow) - unfortunately the photo does not allow to read its label. I still would put my bet on a logic level converter - the phone module is rated for 3.8V, 4.2V max, but the connection to the Snapmaker runs on 5V. [EDIT: data sheet even states that UART logic level is 1.8V]
Most likely this then goes to the TXD/RXD pins for the USB-C cable (yellow lines - via 100 Ohm resistors - would need confirmation with a multimeter).

Long story short: I would not be surprised if the UARTs are visible to Android and can be used in OctoPrint - is this already happening? Those of you that run Octorint on the touchscreen - did it detect the controller/UART?

It also has MIPI lines to attach two cameras to them - in theory the device could be used to run a camera to monitor the printer. MIPI lines should not be too long in theory, but with my Raspberry I have had cameras attached with 1m cable length, and I know of people that had 3m cables (unshielded!) - so not uninteresting to place one into the enclosure and connect to the touchscreen. But this would require serious tinkering - most likely using a USB camera is more effective.

Pinout diagram shows the connectors to the SD card reader - that should be relatively straightforward to break out. Page 37-39 of the datasheet describes exactly what is needed. Main caveat: it seems that the lines require a considerable control of impedance and shielding. This is not easy to achieve for a hobbyist.

Interesting is the fact that the line that is named SC_DET in the Wiki is here on the silk screen named LCDDET - if I see it correctly on the photo, this line is just hard pulled down to ground (0 Ohm ā€œresistorā€/bridge):

So assumption here: It is used by the Snapmaker controller to detect if the LCD screen/Touch controller is plugged in, and it is just detected by monitoring a GPIO on the Snapmaker controller for high/low state. This is then easy to ā€œsimulateā€ by just connecting the regarding pin on USB-C plug to ground (to be verified with a multimeter again).

My starting point setup for replacing the touchscreen controller with a Smartphone would be this (but only after verifying the points above with a multimeter!):

TxD and RxD might need swapping. USB_ID should be irrelevant, since it is handled by the USB hub. As the USB lines just go to the USB-A connector on the Snapmaker controller, there is no need to carry USB_ID. USB-A does not have this pin, and does not need it, since USB-A is always a USB client, not a host. The 5V-connections might not be needed, as the Smartphone will have its own power, but maybe they can be used to charge the phone.

3 Likes