google / aiyprojects-raspbian

API libraries, samples, and system images for AIY Projects (Voice Kit and Vision Kit)
https://aiyprojects.withgoogle.com/
Apache License 2.0
1.63k stars 694 forks source link

Joy_Detection_Service Fails to start #574

Open Espanta opened 5 years ago

Espanta commented 5 years ago

Hi, After following several thread here about camera issue, I found that there is a dependency which fails when trying to load Joy_Detection_service. Here is more details:

sudo systemctl status joy_detection_demo.service and below is errors I get

Dependency failed for AIY Joy Detection Demo. Feb 02 11:46:06 raspberrypi systemd[1]: joy_detection_demo.service: Job joy_detection_demo.service/start failed with result 'dependency'. Feb 02 11:53:47 raspberrypi systemd[1]: Dependency failed for AIY Joy Detection Demo. Feb 02 11:53:47 raspberrypi systemd[1]: joy_detection_demo.service: Job joy_detection_demo.service/start failed with result 'dependency'. Feb 02 12:11:29 raspberrypi systemd[1]: Dependency failed for AIY Joy Detection Demo. Feb 02 12:11:29 raspberrypi systemd[1]: joy_detection_demo.service: Job joy_detection_demo.service/start failed with result 'dependency'.

sudo systemctl start joy_detection_demo.service

-- The start-up result is done. Feb 02 12:18:44 raspberrypi systemd[1]: dev-vision_spicomm.device: Job dev-vision_spicomm.device/start timed out. Feb 02 12:18:44 raspberrypi systemd[1]: Timed out waiting for device dev-vision_spicomm.device. -- Subject: Unit dev-vision_spicomm.device has failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- Unit dev-vision_spicomm.device has failed. -- -- The result is timeout. Feb 02 12:18:44 raspberrypi systemd[1]: Dependency failed for AIY Joy Detection Demo. -- Subject: Unit joy_detection_demo.service has failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- Unit joy_detection_demo.service has failed. -- -- The result is dependency. Feb 02 12:18:44 raspberrypi systemd[1]: joy_detection_demo.service: Job joy_detection_demo.service/start failed with result 'dependency'. Feb 02 12:18:44 raspberrypi sudo[1286]: pam_unix(sudo:session): session closed for user root Feb 02 12:18:44 raspberrypi systemd[1]: dev-vision_spicomm.device: Job dev-vision_spicomm.device/start failed with result 'timeout'. lines 1931-1952/1952 (END)

Appreciate any help!

Espanta commented 5 years ago

I did flash the SD card again and this time, I did not allow update and things are now working. Maybe you would like to consider this as an opportunity to refine guide.

dmitriykovalev commented 5 years ago

Thanks for reporting this, yes, there are some issues, we'll try to update the guide soon. Let's keep this issue open for now.

PinkFreud commented 5 years ago

I ran into the same issue when I set up my Vision V2 a few days ago - the joy demo initially worked, and after updating, it stopped working. I'm seeing the same errors reported above.

I see that the 2018-11-16 image has kernel 4.14.71, with a driver from staging/myriad: /lib/modules # find | grep vision ./4.14.71-v7+/kernel/drivers/staging/myriad/aiy-vision.ko ./4.14.71-v7+/kernel/drivers/media/usb/usbvision ./4.14.71-v7+/kernel/drivers/media/usb/usbvision/usbvision.ko ./4.14.71+/kernel/drivers/staging/myriad/aiy-vision.ko ./4.14.71+/kernel/drivers/media/usb/usbvision ./4.14.71+/kernel/drivers/media/usb/usbvision/usbvision.ko

The current raspbian release installs kernel 4.14.98, and lacks the aiy-vision module from staging/myriad: /lib/modules # find | grep vision ./4.14.98-v7+/kernel/drivers/media/usb/usbvision ./4.14.98-v7+/kernel/drivers/media/usb/usbvision/usbvision.ko ./4.14.98+/kernel/drivers/media/usb/usbvision ./4.14.98+/kernel/drivers/media/usb/usbvision/usbvision.ko

Perhaps it would be best to not pull in kernel updates until we have a reliable way to rebuild the affected module against a new kernel (would dkms work here? I haven't played with the RasPi's kernel much).

edit Whoops, there's a dkms package already installed for this. I'm not sure why it's not being run already - I'll try triggering a manual build.

PinkFreud commented 5 years ago

It looks like dkms did the trick here. For some reason, dkms didn't have any of the dkms modules set up - I had to dkms add each individual package (aiy/1.1, aiy-vision/1.1, aiy-voicebonnect-soundcard/1.0 leds-ktd202x/1.1, pwm-soft/1.1), then dkms autoinstall to build and install everything. A quick reboot later, and this works on the new kernel!