Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 4B incompatibility #5

Open
LinoBarreca opened this issue Jul 11, 2019 · 32 comments · May be fixed by #7
Open

Raspberry Pi 4B incompatibility #5

LinoBarreca opened this issue Jul 11, 2019 · 32 comments · May be fixed by #7
Assignees
Labels
delay fix Wait until I have new hardware

Comments

@LinoBarreca
Copy link

it complains that it isn't installed on a Pi2/3 and doesn't work.

@LinoBarreca
Copy link
Author

LinoBarreca commented Jul 11, 2019

lsusb -t output:
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=ch341, 12M <--------3d printer

@OutsourcedGuru OutsourcedGuru changed the title Pi 4B Raspberry Pi 4B incompatibility Jul 15, 2019
@OutsourcedGuru OutsourcedGuru self-assigned this Jul 15, 2019
@LinoBarreca
Copy link
Author

yes I did

@OutsourcedGuru OutsourcedGuru added the delay fix Wait until I have new hardware label Jul 15, 2019
@OutsourcedGuru
Copy link
Owner

I guess I will need to wait until I myself get a Raspberry Pi 4B so that I can adjust the software. What's sad is that the three versions (1MB, 2MB and 4MB) will each have different IDs, making this problematic.

@LinoBarreca
Copy link
Author

I guess it's just the ram size which is different. what IDs are you talking about? are you using a sort of ID to see if you are running on some PI model?

@OutsourcedGuru
Copy link
Owner

The output of cat /proc/cpuinfo returns a Revision which has an identifier for the board. I've managed to research this for the three new RAM flavors of the Raspi 4B but I still need to have one now so that I can research what type of USB buses they're now using in this. There are smart buses and otherwise. Of the first type, there are ganged and individually-controllable. The recent 3B+ split the bus into two plus two; I'm guessing they did something similar with the 4B.

@mvp
Copy link

mvp commented Jul 23, 2019

You cannot fix this until uhubctl can support it. And that requires updated firmware for 4B, see raspberrypi/linux#3079.

@OutsourcedGuru
Copy link
Owner

Bummer. I've subscribed to your thread to keep an eye on this.

@mvp
Copy link

mvp commented Jan 7, 2020

uhubctl should now support Raspberry Pi 4B (port 4 only) mvp/uhubctl@4aae44ced039.
You may need to update USB firmware to https://www.raspberrypi.org/forums/download/file.php?id=33477
Please give it a try and report back.

@Dracrius
Copy link

Dracrius commented Jan 9, 2020

@OutsourcedGuru Any updates on possible pi 4B support after the uhubctl update? I recently installed a new printer mainboard and setup my 4B for Octoprint with psu control. My Ender 3's stock mainboards usb stopped responding to anything but the 5v line so Im super paranoid that octoprints 5v supply fried something in my stock board. This seems like the best setup for preventing it in the future. If not having a 4B is your main limit Id happly do a veriatey of tests to help using my own. I figure my time is better spent helping you get the pluging as universal as possible then it is spending the time unknowingly trying to make uhubctl work for myself!

@Vuego123
Copy link

Vuego123 commented Feb 8, 2020

I'm using a RPI4 with 2GB and with the following uhubctl command I can toggle all the usb ports on /off:

  • sudo home/pi/uhubctl/uhubctl -l 2 -a off
  • sudo home/pi/uhubctl/uhubctl -l 2 -a on

(don't forget to give sudo rights to the user without password via "sudo visudo" ... )

The plugin could detect the type of RPI (2/3/4) based on the output of cat /proc/cpuinfo
In case it is a RPI4, then the plugin could show 1 toggle to toggle all ports.

Might it be possible to add that logic to the plugin?

@OutsourcedGuru
Copy link
Owner

I might. I've just been busy doing other things lately.

@JHale716
Copy link

JHale716 commented Mar 7, 2020

I have a Pi4-2GB for Octoprint, if I can help, ping me.

@TokugawaHeavyIndustries TokugawaHeavyIndustries linked a pull request Apr 24, 2020 that will close this issue
@TokugawaHeavyIndustries

Just submitted a pull to update for RPi4. Note this is a bigger rewrite that removes the ability to toggle individual ports on RPi3B+, per the latest uhubctl update. This is tested and confirmed working on RPi3B+ and RPi4B boards.

@sr1329
Copy link

sr1329 commented Sep 13, 2020

How do I install your branch?

@nemccarthy
Copy link

@sr1329 if you add a plugin from URL and use https://github.com/TokugawaHeavyIndustries/OctoPrint-USBControl/archive/master.zip it should work on the Pi4

@TokugawaHeavyIndustries thanks for this!!! Have installed on a 4gb Pi 4B and its working great. Can now turn off my printer and screen! Would be great to see this merged into master.

@Coolie1101
Copy link

@sr1329 if you add a plugin from URL and use https://github.com/TokugawaHeavyIndustries/OctoPrint-USBControl/archive/master.zip it should work on the Pi4

@TokugawaHeavyIndustries thanks for this!!! Have installed on a 4gb Pi 4B and its working great. Can now turn off my printer and screen! Would be great to see this merged into master.

Just installed on a Pi 4 B 4GB and toggling the switch doesn't seem to control the power, but "sudo /home/pi/uhubctl/uhubctl -l 1-1 -a 0" works, seems like the switch is executing the wrong command.
2020-10-30 12:08:54,661 - octoprint.plugins.usbcontrol - INFO - usb4 off... 2020-10-30 12:08:54,713 - octoprint.plugins.usbcontrol - INFO - uhubctl failed, throwing error 2020-10-30 12:09:11,373 - octoprint.plugins.usbcontrol - INFO - usb4 on... 2020-10-30 12:09:11,417 - octoprint.plugins.usbcontrol - INFO - uhubctl failed, throwing error

@TokugawaHeavyIndustries

@Coolie1101 Did you install the commit from my pull/branch or did you install the main from OutsourcedGuru?

@mvp
Copy link

mvp commented Oct 30, 2020

@OutsourcedGuru , if you have abandoned this project, perhaps you should pass the helm to @TokugawaHeavyIndustries. I would be happy to update uhubctl readme to point to @TokugawaHeavyIndustries repository instead.

@Coolie1101
Copy link

@Coolie1101 Did you install the commit from my pull/branch or did you install the main from OutsourcedGuru?

Installed via link with "https://github.com/TokugawaHeavyIndustries/OctoPrint-USBControl/archive/master.zip"

@mvp
Copy link

mvp commented Oct 30, 2020

@Coolie1101 , did you upgrade RPI 4 firmware? Also, please show output of sudo uhubctl

@mvp
Copy link

mvp commented Oct 30, 2020

@TokugawaHeavyIndustries , @Coolie1101 , your plugin should be calling uhubctl -l 2 -a 0 (or uhubctl -l 1-1 -a 0. Also, need to make sure to use uhubctl version 2.2.0 or later.

@TokugawaHeavyIndustries

@mvp I just updated my fork to the latest ver of uhubctl. Looks like the I was originally using v2.1.0-38-gb73213dd.

@TokugawaHeavyIndustries

And yes the command for the 4B that the plugin is sending is uhubctl -l 1-1 -p 1-4 -a 0

@mvp
Copy link

mvp commented Oct 30, 2020

Note that -p 1-4 is the same as -p all or not specifying ports at all.

@TokugawaHeavyIndustries

Yeah that was leftover from @OutsourcedGuru 's original work, and I just haven't cleaned it up. 😄

@Coolie1101
Copy link

Coolie1101 commented Oct 30, 2020

did you upgrade RPI 4 firmware?
Yes.

sudo uhubctl
pi@octoprint:~ $ sudo uhubctl Current status for hub 2 [1d6b:0003 Linux 5.4.72-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0, USB 3.00, 4 ports] Port 1: 02a0 power 5gbps Rx.Detect Port 2: 02a0 power 5gbps Rx.Detect Port 3: 02a0 power 5gbps Rx.Detect Port 4: 02a0 power 5gbps Rx.Detect Current status for hub 1-1 [2109:3431 USB2.0 Hub, USB 2.10, 4 ports] Port 1: 0103 power enable connect [1a86:7523 USB Serial] Port 2: 0503 power highspeed enable connect [05a3:9331 HD Web Camera HD Web Camera Ucamera001] Port 3: 0100 power Port 4: 0503 power highspeed enable connect [2ab8:0531 Sonix Technology Co., Ltd. USB 2.0 Camera SN0001] Current status for hub 1 [1d6b:0002 Linux 5.4.72-v7l+ xhci-hcd xHCI Host Controller 0000:01:00.0] Port 1: 0503 power highspeed enable connect [2109:3431 USB2.0 Hub, USB 2.10, 4 ports]

pi@octoprint:~ $ uhubctl --version 2.2.0-13-gdcb1e611

@Coolie1101
Copy link

Coolie1101 commented Oct 30, 2020

Also, is the only way to use the feature is by going to settings>USBControl?

And is there any way to restore the usb camera connection after restoring power?

@mvp
Copy link

mvp commented Oct 30, 2020

@Coolie1101 , USB camera should reconnect after restoring power. If that doesn't work, try adding -R to uhubctl command line - it should force USB bus reset.

@Coolie1101
Copy link

Coolie1101 commented Oct 30, 2020

@mvp, Tx, I tried with "sudo /home/pi/uhubctl/uhubctl -R", but no go.

@mvp
Copy link

mvp commented Oct 30, 2020

@Coolie1101 , I meant adding this flag to other flags. Try this to turn power back on:

sudo uhubctl -l 2 -a 1 -R

@Coolie1101
Copy link

sudo uhubctl -l 2 -a 1 -R

Doesn't seem to work, still no video until a host reboot.

@TokugawaHeavyIndustries

@Coolie1101 Does the plugin work now (at least for turning off the power)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delay fix Wait until I have new hardware
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants