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

Allow for other user than "pi" #81

Open
hase-berlin opened this issue Dec 17, 2023 · 2 comments
Open

Allow for other user than "pi" #81

hase-berlin opened this issue Dec 17, 2023 · 2 comments

Comments

@hase-berlin
Copy link

The Rasbi-Imager propts for username and password to be baked into the written image. This user then replaces the traditional "pi" user.
When using this, it seems to interfere with the playbook: on a Zero (PiOS Buster 32bit, so as "legacy" as it comes :-)) this results in the playbook terminating.

The simple fix of symlinking /home/pi to /home/hase made the playbook run through just fine.
But the resulting image does not enumerate on USB as the camera (instead it enumerates as Vendor 0000, Device 0002, clearly somethig uninitialized).

I am trying to find out, where in the boot process the multi-gadget.sh and picam shell scripts should be called: it seems that in my broken installation they never are executed at all, leaving the usb gadget functionality disabled.

Manually calling the multi-gadget.sh from command lime makes the Zero enumerate as a USB-Video-Class, but does not work as a camera (maybe again something not called?)

I think I have to reverse-enginner this stuff to learn, what part of the setup does what and what gets called when.
Or maybe watch an instructive Youtube video by that Geerling guy about this?

@nbaldy
Copy link

nbaldy commented Jan 22, 2024

Agree that this should be tied to the hostname configured in the edited "inventory" file.

I might tinker around to change this and put up a PR when I have a bit more time, but I think the fix idea would be

  • Related to step 7 in https://github.com/geerlingguy/pi-webcam#setup-from-another-computer "Update the IP address in inventory to match the IP address or hostname of your Raspberry Pi."
    -> Search for this hostname and set a variable like PI_HOSTNAME=$(grep ansible_user inventory | sed -r 's/^.*ansible_user=(\S*).*$/\1/g')

  • Use this variable in the tasks filepath - probably needs forwarded to the pi somehow?

Short-term solution
Search for all instances of "/home/pi/" in the repo and replace it with "/home//" before running the Ansible playbook

EDIT: The above is not sufficient. The systemd services will be pointing to incorrect locations. Hase-berlin's approach of symlinking is a better solution

I am trying to find out, where in the boot process the multi-gadget.sh and picam shell scripts should be called: it seems that in my broken installation they never are executed at all, leaving the usb gadget functionality disabled.

These are called during the boot by systemd - see the systemd unit file piwebcam.service at /etc/systemd/system/piwebcam.service. This is what calls the script on boot - and you can investigate it via commandline with systemctl

In addition to the symlinking, the service unit file must have its user and group modified

sudo nano uvc-gadget/piwebcam.service

Change the username and group

sudo cp uvc-gadget/piwebcam.service  /etc/systemd/system/piwebcam.service
sudo systemctl daemon-reload
sudo systemctl start piwebcam.service
sudo systemctl status piwebcam.service

Note these are set up during the clone of https://github.com/geerlingguy/uvc-gadget

(Note no success yet, so this may be a path it is very tricky to go down - but the errors I'm seeing look like device errors as opposed to user errors, so that's progress)

@Oceanique
Copy link

Oceanique commented Feb 9, 2024

Hello, I'm replying to this issue because it's likely linked to mine : I could follow the instructions only on Bullseye successfully, but when connected to my laptop, nothing happened. So I connected the RPi4B back to a monitor : it boots, but there's no scripts running, absolutely nothing. I'm a noob in the RPi world, could you tell me what's going on ?

Okay, I've tried to follow all of your tips but as Nbaldy said : "no success yet".

When connected to my laptop, I get the following errors with dmesg -w command :

[24061.017260] usb 2-1: new high-speed USB device number 14 using xhci_hcd
[24066.289255] usb 2-1: device descriptor read/64, error -110
[24081.909205] usb 2-1: device descriptor read/64, error -110
[24082.145194] usb 2-1: new high-speed USB device number 15 using xhci_hcd
[24087.285190] usb 2-1: device descriptor read/64, error -110
[24102.897142] usb 2-1: device descriptor read/64, error -110
[24103.005183] usb usb2-port1: attempt power cycle
[24103.657115] usb 2-1: new high-speed USB device number 16 using xhci_hcd
[24108.913149] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[24114.289135] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[24114.497098] usb 2-1: device not accepting address 16, error -62
[24114.629062] usb 2-1: new high-speed USB device number 17 using xhci_hcd
[24119.665110] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[24125.041093] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[24125.249067] usb 2-1: device not accepting address 17, error -62
[24125.249128] usb usb2-port1: unable to enumerate USB device

The two last lines are a first since days, I never saw them before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants