DIYbanter

DIYbanter (https://www.diybanter.com/)
-   UK diy (https://www.diybanter.com/uk-diy/)
-   -   DIYish. Linux question. (https://www.diybanter.com/uk-diy/639306-diyish-linux-question.html)

Dennis@home August 28th 19 01:28 PM

DIYish. Linux question.
 
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.

Adrian Caspersz August 28th 19 05:46 PM

DIYish. Linux question.
 
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.


"Doctor, Doctor!
My finger hurts when I do this!!"

"Well, don't do that then..."

:-|

--
Adrian C

Richard[_10_] August 28th 19 07:51 PM

DIYish. Linux question.
 
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.


RPi running windows, or other device running windows?

Dennis@home August 28th 19 09:46 PM

DIYish. Linux question.
 
On 28/08/2019 17:46, Adrian Caspersz 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.


"Doctor, Doctor!
My finger hurts when I do this!!"

"Well, don't do that then..."

:-|


I use a remote switch so the RPi has to boot first then it powers up the
printer.


Dennis@home August 28th 19 10:20 PM

DIYish. Linux question.
 
On 28/08/2019 19:51, Richard 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.


RPi running windows, or other device running windows?


Octoprint is an application it runs on either.


mm0fmf[_2_] August 28th 19 11:33 PM

DIYish. Linux question.
 
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)

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

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.

~$ 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.



Dennis@home August 29th 19 02:08 PM

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.


mm0fmf[_2_] August 29th 19 04:50 PM

DIYish. Linux question.
 
On 29/08/2019 14:08, dennis@home wrote:
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.


Well from that it's clear that that's the problem.



All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2014 DIYbanter