octo4a icon indicating copy to clipboard operation
octo4a copied to clipboard

Uploading gcode fails on Samsung Galaxy S5

Open Nyrup opened this issue 2 years ago • 13 comments

Uploading a gcode file generated by Cura in the web interface, fails with this message: octo_upload_fail

Octo4a does have all permissions enabled on the phone - including Storage.

If I "Refresh files" in the web interface, the file does appear and it can be printed. But the error prevents me from doing direct upload from Cure to Octoprint.

Any ideas of what I could try?

Nyrup avatar Feb 14 '22 11:02 Nyrup

Same issue with a Galaxy S6. I get the error, but the file does succeed in uploading.

20220302_error_octoprint.log.txt

My problem matches the error in https://github.com/feelfreelinux/octo4a/issues/34 , so I will reinstall when I can to see if it fixes the issue as it did with this issue.

Sketch56 avatar Mar 02 '22 19:03 Sketch56

I get the same with a Samsung Galaxy S4. Upload failed error, but after a refresh the file is actually there.

TopsideWings avatar Mar 02 '22 22:03 TopsideWings

Anybody found a solution to the error mentioned above? I have the same problem on an old Galaxy S6.... The file does upload but I am annoyed about getting always the error. Also I cannot do "Upload and Print" but only upload. Thanks.

mludu avatar Apr 23 '22 20:04 mludu

Just adding another "me too". Upload failed message to octo4a on Samsung Galaxy S5. And "me too" that if I hit the "refresh" icon, the uploaded gcode file shows properly. Oh, and I'm able to create a folder with no error.

It seems to be a permission error with os.rename() after the file is properly uploaded, as shown in the following snipped from the octoprint.log file. It's not obvious how I might fix this in my user permissions on the S5.

2022-04-24 16:47:51,759 - octoprint.server.util.sockjs - INFO - New connection from client: 192.168.1.101 2022-04-24 16:47:51,850 - octoprint.server.util.flask - INFO - Passively logging in user greg from 192.168.1.101 2022-04-24 16:47:51,854 - octoprint.access.users - INFO - Logged in user: greg 2022-04-24 16:47:54,638 - octoprint.server.util.sockjs - INFO - User greg logged in on the socket from client 192.168.1.101 2022-04-24 16:49:19,943 - octoprint - ERROR - Exception on /api/files/local [POST] Traceback (most recent call last): File "/usr/lib/python3.9/shutil.py", line 806, in move os.rename(src, real_dst) OSError: [Errno 18] Cross-device link: '/tmp/octoprint-file-upload-7uhqmo7i.tmp' -> '/root/.octoprint/uploads/Ender 3 V2 STLs/Default.gcode'

And yet, the Default.gcode file does show up properly in that folder on the S5. (You have to enable "show hidden files" in the Explorer settings to be able to see the hidden .octoprint folder.

gregreid avatar Apr 24 '22 16:04 gregreid

Same issue with Samsung Galaxy A5. Seems to be an issue specific to Samsung phones.

MB-Finski avatar May 14 '22 10:05 MB-Finski

FYI, a quick fix was to install another firmware on the phone. (In my case LineageOS).

MB-Finski avatar May 16 '22 20:05 MB-Finski

Thanks for the LineageOS tip. I'm looking into the installation process now. (Started by installing adb-fastboot on my Ubuntu laptop, and confirming that the Odin downloader is available on my S5-G900V.)

gregreid avatar May 17 '22 10:05 gregreid

@MB-Finski Thanks for the idea 👍 Does LineageOS solve the issue with charging along with OTG controlling the printer? My Galaxy S5 does not seem to be capable of doing both.

Nyrup avatar May 17 '22 11:05 Nyrup

@MB-Finski Thanks for the idea 👍 Does LineageOS solve the issue with charging along with OTG controlling the printer? My Galaxy S5 does not seem to be capable of doing both.

AFAIK, no. You'd probably need a custom kernel which has proper USB-OTG modes enabled (if your hardware supports them). I don't think the LineageOS developers would have deemed it worthwhile to support those rather rare USB modes. BUT I'm not 100% certain either, so be sure to give it a go if you change over to LineageOS.

I already butchered my phone and added a direct charging connection to the battery (voltage regulated, of course).

MB-Finski avatar May 17 '22 12:05 MB-Finski

Well I spent a dozen hours going down a deep Rabbit hole trying to get LineageOS onto my S5, installing adb, fastboot, Odin, and tons of other tools required to flash and/or diagnose the issue. Finally I came across this thread:

https://forum.xda-developers.com/t/2022_vzw_emmc_11_aio_tool-to-root-locked_bootloader-install-rooted_roms-with-safestrap_ll_kk-or-nonrooted-mm-rom-with-safestrap.4182491

That cumbersome procedure would allow me to install a rooted Lollipop OS with Safestrap, or a rooted KitKat OS with Safestrap, or a non-rooted Marshmallow OS with Safestrap. All good things for some, I suppose.

Unfortunately, as the link details, it is impossible to change the bootloader of a Verizon based S5 (G900V). Well, actually, only those models with a "CID" that begins with "11". Some G900V's apparently have a CID that begins with "15", and they are rootable, but I think that these are much more rare. And there's a tool supplied in an apk to let you see your CID. (The things you learn from forums!)

With the CID 11 flavor of hard-wired Verizon bootloader, "You cannot flash asop based roms like Lineage as these require a custom boot image". Dead end here, and I had to bite the bullet and revert to the original Samsung firmware with a factory reset.

Oh!, and then I found out that, on the first bootup after a factory reset, when the Samsung initialization wizard requires you to enter your Samsung account userid/password, it might keep saying "Processing failed" -- and there's no way past that. It's trying to ensure that you're the registered owner of the reset phone. This is due to the "Reactivation lock" setting in the phone -- but of course you can't turn that off at this point. And, even though this S5 is certainly owned by me and was properly registered by me with Samsung, they have some weird account bug that can't find it. (There are tons of others who have complained about this "Processing failed" error, offering lots of "solutions" -- but none of them worked for me.)

You can't proceed with the factory reset/reboot unless you can get past that Samsung account prompt ... so the phone is essentially useless. But I did finally manage to get past it by deleting my Samsung account and then re-creating the account with the same userid/password. That apparently fixes the Samsung account bug (I'll guess due to something cached somewhere on their servers that's cleaned up with the account delete) and allowed me to login on my phone to get past that Reactivation lock screen. And then the first thing that I did was to make sure that I turned OFF the Reactivation lock in the phone's settings. Whew!

So now I'll just re-install octo4a on my non-rooted, stock S5 G900V, and live with the silly "upload failed" message. :-/

gregreid avatar May 19 '22 11:05 gregreid

@MB-Finski Thanks for the idea 👍 Does LineageOS solve the issue with charging along with OTG controlling the printer? My Galaxy S5 does not seem to be capable of doing both.

I "solved" this by hard-wiring a 5VDC power supply directly to the S5's Wireless charging pins. I used to have an OEM wireless charging receiving coil inside the back cover (this one FWIW: https://smile.amazon.com/gp/product/B00K7VOCGA), which would use those same pins to apply its induced power into the phone's charging circuit. Of course I removed that receiving coil before soldering on my 5VDC wires.

Inside the back cover, just to the left of the battery near its top, you'll find several gold-colored contacts. The wireless charging ones are the two bottom-most ones, side by side. The bottom-most one closest to the battery is the negative, and the one just to its left is the positive. I soldered my power supply wires onto those pins, used a strong wide tape to secure the wire from pulling, and replacing the cover offers some more pull security ... but of course avoid yanking too hard.

Anyway, this setup allows me to keep the phone charging (via those wireless charging ports) while using the OTG connection to the printer.

Oh!, and one final tip on this: you'll initially find that when you turn off your printer, its display LCD will still be alive. It's receiving power through the phone's USB connection to the printer! I didn't like this, so found another link somewhere with a picture showing how to put a tiny piece of tape over the OTG's USB output connector's power pin. Kludgy, but it prevents the phone's power from reaching the printer.

gregreid avatar May 19 '22 11:05 gregreid

Couldn't reproduce on Samsung Galaxy S20+ 5G (stock firmware).

alufers avatar Oct 07 '22 12:10 alufers

Well I spent the better part of today trying to replicate my working octo4a setup from an LG G4 to an LG V10 but encountered the issue described above. I haven't had a chance to swap phones out on the printer, so I'm wondering if the gcode files will actually print after they are uploaded despite the errors. I know that the slicer thumbnails aren't loading properly but that isn't the cause of the errors because old gcodes generated without thumbnails have the same issue. octoprint (V10 fresh install).log

One thing I noted while doing the manual ssh octoprint install steps (which I can almost do by muscle memory now) is that unlike the G4, the V10 never successfully installed packages with the freshly generated wheels. I got messages about needing to use the older setup.py process. It is very strange considering how the G4 and V10 are almost the same phone. At first, I thought that the octoprint backups from the G4 were causing the problem when restored to the V10. But after starting over with no backups restored, the same uploading issue occurs.

octoprint-systeminfo-20230129014250.zip

sv0o avatar Jan 29 '23 01:01 sv0o