feelfreelinux / octo4a

Use your old Android device as an OctoPrint server.
GNU Affero General Public License v3.0
1.5k stars 139 forks source link

/dev Permission error #439

Open Madcamper opened 10 months ago

Madcamper commented 10 months ago

I've been getting this spam error in my octo4a logs for a while, it stops after I've made a successful connection to the printer though. Today, I am having some weird issues with octo4a where it crashes when trying to connect or detection serial connection times out after about 30 seconds, camera server stops running randomly. This all happened out of no where, it worked fine last night, I woke up this morning and tried to connect to octoprint and it doesn't work. I am using octoprint fine on another printer with the same phone.

image

Sc0r commented 10 months ago

Same issue. It's because android doesn't recognise the printer as a USB device, because octo4a lacks permissions to access the dev area Funny enough, I got mine rooted but octo4a doesn't even ask for permissions, it just continously tries with standard access. The magic trick cmod 666 /dev/tty? didn't work for me either. The following is something else Ill try tomorrow. For reference, I use octo4a with nvidia SHIELD and a skr mini e3.0 v3 Board on an ender 3v2. Apparently that board utilizes the CDC driver. If it loads properly that is. FINAL SOLUTION

Madcamper commented 10 months ago

My phone is not rooted but ssh'ing into the phone via enabling it in octoprint, I don't have a "udev" folder under \etc\ - not sure if this is because octoprint is creating the SSH connection or what. I also tried changing the permissions on the \dev folder and it acts like it takes it but then when I try to list the contents of "\dev" I get access denied. My guess is this is also because it's octoprint making the SSH connection or dev is locked down by default. The type of phone I am using is a TracFone Blu View 2 - https://www.amazon.com/gp/product/B08J4JYD47/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

image

Sc0r commented 10 months ago

ultimately switched back to a different system, where I encountered the same (or similar) error. after hours of googling, trial and error, I found a solution. It might work for you as well: https://github.com/MarlinFirmware/Configurations/issues/535 How it works:

after doing this, it instantly worked for me

good luck!

Madcamper commented 10 months ago

Unfortunately I'm on a prusa and don't use custom firmware with it but hopefully this information will be helpful for anyone coming along and/or the dev to maybe pinpoint somewhere in the octo4a code to remediate it.

Pyenb commented 8 months ago

Anyone got something new? I am stuck on the same problem on my old Oneplus 6. I already tried every chmod method, adding groups, trying out sudo, editing the octoprint user, etc...

Tought about either hardcoding the devices in the comm-fix.py or trying to ask for root access. I will try to build the app and test it out locally

mattmon commented 6 months ago

I got it working by setting SELinux to permissive:

"setenforce 0" in android shell

to make it permanent, repack your boot.img with "androidboot.selinux=permissive" in kernel cmdline

yep, ugly and insecure; but for a single purpose device that has no outside network access, you'll probably survive ;-)

Pyenb commented 6 months ago

"setenforce 0" in android shell

Thanks @mattmon, will definitly try that out later. I tried rebuilding the app with it asking for root access, by editing the said comm-fix.py, but couldn't get it to compile.

Just to make sure, did you set it it inside octo4a or on the host phone?

mattmon commented 6 months ago

"setenforce 0" in android shell

Thanks @mattmon, will definitly try that out later. I tried rebuilding the app with it asking for root access, by editing the said comm-fix.py, but couldn't get it to compile.

Just to make sure, did you set it it inside octo4a or on the host phone?

You need to set SELinux to permissive for android's kernel.

"adb shell su setenforce 0" is ephemeral

repacking the boot.img is permanent

Pyenb commented 6 months ago

"adb shell su setenforce 0" is ephemeral

Ok, thank you very much