View Single Post
  #7   Report Post  
Posted to uk.d-i-y
Dennis@home Dennis@home is offline
external usenet poster
 
Posts: 2,554
Default DIYish. Linux question.

On 28/08/2019 23:33, mm0fmf wrote:
On 28/08/2019 13:28, dennis@home wrote:
Why does octoprint on a RPi not find the printer if you plug it in
after starting the RPi but works fine if the USB is connected first?

It doesn't do that on windows.


A possible reason is that Octoprint is/has something running that has
checked for USB attached devices before you plug in the USB device. If
this doesn't check for newly attached devices then your printer wont
appear if you plug it in after.

Does it work if you leave for some time? (Say 10mins)



No even if you leave it for days.


You can try and see if you have shut down all of the processes/threads
etc. Octoprint starts before attaching then restart Octoprint.


Restarting octoprint doesn't help.
Restarting the RPi does.


Have you checked that the USB device is visible when plugged in after
booting with something like "lsusb". lsusb will show all the devices and
controllers.


Its visible after a reboot and octoprint works.


~$ lsusb
Bus 002 Device 002: ID 04f2:0963 Chicony Electronics Co., Ltd
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 0bda:0159 Realtek Semiconductor Corp. Digital
Media Card Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
~$

lsusb -D /dev/bus/usb/001/010

~$ lsusb -D /dev/bus/usb/001/010
Device: ID 0bda:0159 Realtek Semiconductor Corp. Digital Media Card Reader
Device Descriptor:
Â* bLengthÂ*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* 18
Â* bDescriptorTypeÂ*Â*Â*Â*Â*Â*Â*Â* 1
Â* bcdUSBÂ*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* 2.00
Â* bDeviceClassÂ*Â*Â*Â*Â*Â*Â*Â*Â*Â*Â* 0 (Defined at Interface level)
Â* bDeviceSubClassÂ*Â*Â*Â*Â*Â*Â*Â* 0
Â* bDeviceProtocolÂ*Â*Â*Â*Â*Â*Â*Â* 0
[many lines snipped]


Try that with a boot with USB attached and without and see if there is a
difference.

Also if you need to boot the Pi before the USB switch works what happens
if you boot the Pi to get the switch to work and then do a sudo reboot?
If you're lucky the switch/printer will stay working across a reboot and
it may be found after the reboot.



Its a wifi switch not USB.
Octoprint can see it and turn the printer on and off.

I may have to bodge it so the printer electronics stays powered up but
the 24V doesn't switch on using a relay.