Can Android on touchscreen be more open?

Anyone has an idea if it is feasible to get the touchscreen open enough to install an apk? Just watched this: How to run OctoPrint on your phone! - YouTube - that would be just great if we could put this on the touchscreen…

Nothing that’s I know. I must-have admitted I haven’t tied yet. Bütgenbach as for as I understood, the device also doesn’t identify as a USB devices when connected to a computer. The issues for opening the source for the HMI are still open…

@Hauke android itself was designed with the intention of being open source. But Snapmaker has refused to release the source code despite that fact. It is possible to do it on the touchscreen but I’ve never done an android and would not know how to advise on doing it.

Well, while Android is open source, it’s also designed to be used in an closed source setting. Especially apps are very rarely open source, including apps from Google is creator (mostly) of Android itself.

IMO that doesn’t really matter and Snapmaker could (and should) releasethe source code anyway, but that’s independent of the underlying system.

It’s not so easy. Even if the source code were open source, the only way to install software on the touchscreen AFAICT is the update process, which installs a regular Android app update. Android only allows updates if the new app is signed with the same certificate as the older version, so without Snapmaker’s help we can’t install software there.

(You could try to disassemble the module and see if there are any debugging ports on the board, but in contrast to the other modules there does not seem to be a reasonable non-destructive way to open it.)

@zauguin I did say I’ve never done an android, android was designed to be open source but being closed source as well kind of goes without saying, there are already plenty of items out there that are built upon android and are closed source. Don’t mistake my comment to mean that it would be simple, I never stated anything of the sort. Just because I’ve never done an android doesn’t mean I don’t know how it works. The fact that I said “but Snapmaker has refused to release the source code” was me implying Snapmaker’s help would be needed. The touchscreen isn’t even needed to run the machine either so…

The touch screen just runs an apk file, it’s delivered in the firmware updates.

Unfortunately, since it’s just an update, and not an uninstall/reinstall, there’s no way to change the code even after you decompile it (we’ll, you could play with the xml files maybe, but messing with the layout isn’t exactly useful).

One thing I did see I think, is that the apk actually has another apk inside it. The inner apk is simply a bootstrap updater app, and it seems it’ll actually be installed when an update to the main app fails. You could probably get the machine to fail to update, and then it’d install the inner apk, so you could swap that out for something like a normal launcher, and have the outer app as just a normal app. But, this could probably also easily “brick” the machine, since that process is supposed to be the fallback mechanism. I’m not sure if there’s another way to “hard reset” back to factory settings, you’d probably need to find some jtag somewhere like suggested above.

i have done this. the octoprint for android runs slowly on this device lol

do you still have these files?

Cool, you got OctoPrint running on the SM2 touchscreen? I like! From the hardware spec’s it is indeed not the most powerful device ever…

I am just wondering, also taking your other post Printer malfunction and exploring touch screen android into account, if you could reverse the game and replace the tocuscreen with a used, more powerful smartphone and put Snapmaker’s apk’s on that one… Of course it would be necessary to reverse-engineer the USB-C-wiring, but my guess would be that this is basically just power and USB OTG. I suppose that on the main SM2 Controller there’s just an USB hub which exposes the USB-A port and also has an USB-to-UART bridge built-in.

It seems I was wrong here. Just unscrewed my “spare” SM2 controller - the USB-A-port is directly wired to the USB-C-port. And I cannot find any chip that identifies as USB hub. The MCU is a GD32F305VG, an ARM Cortex-M4 @120MHz (so quite a powerful thing for a CNC controller), which has USB-OTG on board, and as far as I could trace it, this connects also to the USB-C-plug (to be taken with a grain of salt - difficult to be sure with multi-layer PCBs and just a multimeter at hand). Which would mean that the touchscreen controller has an USB hub or actually 2 exposed USB ports. This would the replacement with a standard Smartphone a tad more complicated, as they usually only expose one USB-OTG.

@jbot - thank you very much for win+N !!!

I’m able to pair a Bluetooth keyboard to it and install https://f-droid.org/ trying to extract already installed APK from the HMI.
Will post the USB-C cable pinout soon and instructions on how to get into android system on your HMI.
@Hauke can you post the pics? It would help engage more people…

I will post a detailed instruction about my findings.

Sure! Here we go…

Underside of bottom PCB - it is difficult to see, but the PCB routes from the D+/D- lines of the USB-A socket go to the through-connections near the USB-C. I do not have a USB-C plug at hand that allows me to measure with a multimeter, so some uncertainty remains.

None of the chips visible qualify as USB-Hub.

The Top PCB - checked with multimeter that the USB D+/D- lines of the ARM go to the connector to the bottom PCB - where I failed to properly trace them, but I find it likely that they go to the USB-C connector. Again, no chip seems to be an USB hub.

EDIT: According to this page the HMI (= Touchscreen) connects directly to the USB-A, and the connection to the ARM is UART… The ARM datasheet states that pin 69/70 (plus surrounding) can also be configured as UART - so potentially it is not USB OTG. This would make replacing the touchscreen with a Smartphone even more difficult (but not impossible :slight_smile: )

EDIT EDIT: My analysis was sloppy! A) it would be pin 70/71 to be USB D+/D-, and B) while pin 69 and 70 go to the two indicated connector pins, these both go to GND - so neither UART nor USB. Which means that they definitely do not use USB to connect to the HMI, but some other UART. So to connect a Smartphone, you’d need to add another UART-to-USB bridge.

1 Like

The silkscreen labels are very nice! Didn’t expect this, voltages, ground points, amazing…

Here is a screen recording of the system menu.
I have the apk file for the actual snapmaker UI. Not sure if it is working yet. Will try to install it on my phone.
the app called FAB :slight_smile:

We are going to be able to mark this thread as solved today =)

I don’t have it on me, but the file is inside the update.bin from the firmware updates

IIRC, not every update will have updated apks in it, so you need to find one where they updated the UI.

Go check the firmware updates thread on the forums here for a history of update bins.

Oh wait, the bin files are the APK files lol. Just downloaded https://s3.us-west-2.amazonaws.com/snapmaker.com/download/firmware/J1_V2.7.1_20240108.bin, and rename it to .zip. When you open it, you can see that it’s an APK file (so probably just rename it to APK and you can install it on your “rooted” j1.

2 Likes

Heh, access to the launch screen is great, but I already had the code for the FAB.

It is talking over serial to the machine (over the USB cable). I suppose we could reverse engineer and build a new dummy FAB app, but we’re not getting exactly the source code like I was hoping for.

Huh, where did you get this? And is it possible to share?

We won’t, I think it might be something developed by 3rd party.
There is another app called HID that allows to send an HID command to a BD device. But it is probably about bluetooth.

I installed the FAB launcher on a phone but it crashes :frowning:
Here is the link for the FAB apk from latest Snapmaker 2.0 firmware - I pulled this directly from LCD.

Also - uploaded the pinout for 2.0 LCD - GitHub - shurushetr/awesome-snapmaker: Curated list of things that help you make something awesome with Snapmaker machines.

2 Likes