Currently have a pi zero set setup up for headless operation using the hardware uart and not USB.
I would like to have a USB device attached to the USB port as well as having access to the terminal via the uart port. Currently a soon as a USB device is attached to the USB port on the pi I loose the connection on the uart port likely due to the pi switching from slave to host.
Is there a way to accomplish this?
Re: Headless programming while hosting USB device
I can see no reason for the behavior you describe.
You are using the Linux console that is enabled by standard on the GPIO UART pins ? Or some other configuration ?
Have you loaded any of the USB Gadget kernelmodules so that the device is in "gadget" mode ? If not then the USB should be in "master" mode as always.
What kind of USB device are you connecting ? And what happens if the usb-device is already connected when you boot the Zero ?
You are using the Linux console that is enabled by standard on the GPIO UART pins ? Or some other configuration ?
Have you loaded any of the USB Gadget kernelmodules so that the device is in "gadget" mode ? If not then the USB should be in "master" mode as always.
What kind of USB device are you connecting ? And what happens if the usb-device is already connected when you boot the Zero ?
Re: Headless programming while hosting USB device
(Edit: I was mistaken so I've corrected this post.)
The GPIO UART is now a different one due to one being needed for Bluetooth, but that causes problems because the baud rate changes with the processor clock. The processor clock slows down if the Pi is getting hot and maybe if it isn't heavily loaded.
There are two solutions: either lock the CPU frequency or disable Bluetooth and swap the UARTs back.
See: viewtopic.php?f=63&t=151454#p993901
The GPIO UART is now a different one due to one being needed for Bluetooth, but that causes problems because the baud rate changes with the processor clock. The processor clock slows down if the Pi is getting hot and maybe if it isn't heavily loaded.
There are two solutions: either lock the CPU frequency or disable Bluetooth and swap the UARTs back.
See: viewtopic.php?f=63&t=151454#p993901
Re: Headless programming while hosting USB device
3: or just swap the UARTS (using overlay pi3-miniuart-bt). Don't know how that affects BT, though.rurwin wrote:There are two solutions: either lock the CPU frequency or disable Bluetooth and swap the UARTs back.
Re: Headless programming while hosting USB device
OP have specified that he is using a Pi Zero, is this BT UART stuff even relevant ?
Re: Headless programming while hosting USB device
I don't know.
Does the Pi Zero use the swapped UARTs even though there's no Bluetooth? I hope not, but it might.
Or the OP might have ment that he had a Pi Zero W.
Does the Pi Zero use the swapped UARTs even though there's no Bluetooth? I hope not, but it might.
Or the OP might have ment that he had a Pi Zero W.
- thagrol
- Posts: 4224
- Joined: Fri Jan 13, 2012 4:41 pm
- Location: Darkest Somerset, UK
- Contact: Website
Re: Headless programming while hosting USB device
What USB device are you connecting? Could it be that your psu isn't up to the job and a the extra current draw is causing a brown out on the pi?
Arguing with strangers on the internet since 1993.
All advice given is based on my experience. it worked for me, it may not work for you.
All GPIO pin numbers are BCM numbers.
All advice given is based on my experience. it worked for me, it may not work for you.
All GPIO pin numbers are BCM numbers.
Re: Headless programming while hosting USB device
Got it working. It seems the usb hub i was using to connect the usb device was faulty. Swapping it has solved the problem.