// Networking stuff //
The Raspberry Pi gets an internet connection via my phone's hotspot. Although it is easy to access website in this way it turned out to be quite complicated to actually host a website over a cellular network. The problem lies in the fact that the cellular network doesn't have a static IP address which is needed to point a domain to. To solve this problem I'm using a VPS that does have a static IP and I'm using a SSH-tunnel to route all requests on port 443 (https) and 80 (http) to the Raspberry Pi. Jeff Geerling wrote a very comprehensive guide on how to accomplish this --> link to Jeff Geerlings guide. This worked almost 100% for me but I noticed that it would sometimes have trouble starting the tunnel. One of the problems was that the SSH-tunnel would occasionally be binded to the wrong IP address. The Raspberry Pi apparently has more than one IP addresses sometimes. To mediate this problem I added "-b " to the SSH_OPTIONS. Another problem was that the SSH tunnel would try to connect to my VPS over IPv6 which it does not reliably support for some reason. Adding -4 to the SSH_OPTIONS solved this problem since it forces IPv4.
Using my phone's hotspot works but I'm quite limited by the amount of data that I have available per month. I wanted the Raspberry Pi to use as little data as possible serving the website and sending all the pictures over the cellular network every time the website would be loaded would be a bad idea. Therefor I'm using the webspace from my other website jellereith.nl to store all the images. When the button to take an image is pushed/clicked the Raspberry Pi send's that image to that webspace, after the file has been successfully uploaded it tells the client to load the image from the webspace by proving a link to the image.
The images that the Raspberry Pi makes are 16mp (the camera could do 64mp but the rolling shutter is too bad in most cases so I reduced it to 16mp). The JPG files are about 2.2 mb in size. Using images of this size on the website would make it very slow to load and it would use too much of my phone's data bundle so I'm scaling them down to 200x160 pixels with a file size of about 25kb . It is however possible to access the full resolution image by paying me 1 euro via the PayPal link. When a payment has been made the high resolution file is uploaded to my server and is available to everyone to see. By paying for a photo you're supporting me on my trip around the world.
After fiddling a lot with the ssh-tunnel to make it more reliable I switched over to tailscale. I'm using a nginx server configured as a reverse proxy on my VPS and it's rerouting all data from port 443 to the tailscale ip from the Raspberry Pi on my bike. The nginx server is also forcing https and providing a valid ssl certificate.
// Hardware stuff //
The Raspberry Pi is mounted in a project box made by Altinkaya. I cut a hole in the plastic lid and mounted an old GoPro glass lens in there because the plastic lid is easy to get scratched. A 3D printed piece is used to attach the lens and Raspberry Pi to the enclosure. Power comes in to the box using a watertight usb-c pass-through. I also installed a small watertight button that I can program to do various things. Right now it is configured to take an image using the arducam camera.
The Pi is equipped with a sense HAT. I programmed it to flash a few times before taking a picture so that I dont't accidentally turn it off when someone is visiting the website.
// Geo Tagging //
The images the Pi takes are also geotagged. This is accomplished using the geo-cordinates from my phone. I'm using the app GyrOSC to send my phones geo location to the Pi using OSC. A python script on the Pi is listening for the messages and is modifiing the picture's EXIFusing exiftool.
// Future plans //
Attach a small mirror to the front of my bike so that I can see the LED's of the Raspberry Pi, and that you can see me on the pictures
Neat project! Would love to hear about how you chose the Auducam camera module. I've tried to mount a few to my bicycle ( Pi V1, V2, the camera built into Luxonis' first Oak-D), and encountered issues with rolling shutter, etc...
When you pass cars and take photos, are license plates sharp and readable? What's it like on a bumpy road?
I haven't touched my project in a while, but you can see the issues I had with rolling shutter here:
https://www.hotelexistence.ca/bicycle-dashcam-part-3-more-field-testing/
My goal was to add car license plate recognition, but rarely could I get a usable photo - I am sure an issue with both the sensor and lens.