5

Can't find a way on how to take a single picture from the camera.

While using image reader and sending capture request with TEMPLATE_STILL_CAPTURE, app just stops at this place and nothing more happens.

Tried with my code, thought problem was there. But after trying with the Doorbell tutorial, the same happened. What just I got is last log message: "Session initialized". After pressing button once more in 15 min.: "CAMERA_ERROR (3): waitUntilIdle:777: Camera 0: Error waiting to drain: Connection timed out (-110)".

Has anyone faced this issue? And is it fixable? Or just need to wait for next releases of android-things

PS: when preview camera to surface view, everything worked correctly, so it shouldn't be the problem with a camera

1 Answers1

0

This is not a proper answer but I had the same issue as you did. I also used the Doorbell tutorial you are referring to and got the same error message "CAMERA_ERROR (3): waitUntilIdle:777: Camera 0: Error waiting to drain: Connection timed out (-110)".

I wish I could tell you what I did but I eventually got it to work without touching the code, Android Studio or anything like that. This is what I did:

1) Physically removed the camera. The "wire" connected to the camera came from factory so that is was badly clamped (crooked). I removed it and clamped more carefully. I highly doubt that this helped anything because I didn't have hardware issues.

2) Uninstalled the app (and all other apps) from Android Things. In Windows you can list and delete the apps in CMD by changing directory (cd) to the folder containing your adb and then typing: "adb shell pm list packages -3" and "adb shell pm uninstall

3) Turned the Raspberry on and off by pulling the power cord

4) Gave permissions to use camera both in Manifest and manually through adb. The latter you can do again in CMD: CMD: cd adb shell pm grant android.permission.CAMERA

5) I repeated 2-4 a couple of times and the camera started working. So I can confirm that the Doorbell tutorial and the Raspberry Camera 2 work "straight out of the box" at least 18 June 2018.

I have noticed that for me (someone not at all familiar with Rasp and Android Things) it is necessary to uninstall and reinstall, unplug and plug the thing and grant permissions sometimes several times for everything to work.

Crebit
  • 367
  • 1
  • 4
  • 14