Camera in Map - opencardev/crankshaft GitHub Wiki

This is based on the work from Everlanders (https://gist.github.com/Everlanders) and adapted to my specific needs - so very big thank you to Everlands and of course this project.

It will allow you to have camera in maps. I have not worked on video recording etc... this is not something I require, but please feel free to add in (or add this function to the main app)

Prereq

  • Android Auto in Dev mode with 720p enabled
  • 720 set in Cranshaft settings
  • Pi camera DISABLED in Crankshaft
  • X11 Enabled (EGL makes the map flicker every second)
  • SSH Access to the device
  • A press button connected to a GPIO (take a note of which one it is)
  • Reboot the machine once you are sure all the settings are as above

How to

SSH into the pi and log on. Unlock the system OS

crankshaft system unlock

Run the setup program

sudo raspi-config

enable the camera under the interfaces and save

Test the camera by running this

raspivid -t 0 -vf -h 480 -w 800

IF you have errors (and no picture) - resolve these errors prior to continuing

Adding the script Unlock the boot partition 'crankshaft boot unlock' browse into the correct folder 'cd /boot/crankshaft' create the file using this command 'sudo nano camera.py'

Paste the code from https://gist.github.com/Beebock/fe722044e5098906e406b14aa286dd84 (my fork of the main code) As you an see from the code, it is also able to control the brightness - this I have not documented / used, however you will just need to add a button to the GPIO as declared at the front of the script.

Add the script to the startup.

Edit the startup file.

sudo nano startup.py

Add this line import camera

save and exit nano, reboot the pi.

If everything worked correctly, you should now be able to hit the button and see a picture. There are 3 settings you can circulate through.

  • picture in picture
  • Full screen transparent
  • Full screen
  • off