My very first Hackster project was a Raspberry Pi 3 project and that was the one with the most respects and thousands of views.
In my last project, I shared a video that I was contemplating using to prank unsuspecting Wi-Fi users. To be clear, I don’t think climate change is a trivial issue, I just think we will nuke ourselves out of existence way before pollution, robots, or AI can get to us. Case in point, the movie Idiocracy. When it came out in 2006, it was a dark comedy, but now it looks more like a documentary.
The internet is full of indications of the inevitable human devolution. In this project we will use a disposable video brochure (how ironic) to display videos from TikTok without having to login or create API key. If we would do this process manually, we would go to the website to get a link to the video, go to a different website to download the video, and then change video orientation, The video brochure has about 100MB of storage space which is around 10 minutes worth of mp4 garbage.
HardwareSeeed Studio Fusion kindly sent me a Raspberry Pi 4 to play with. The first hardware challenge was getting a power supply capable of delivering 5V/3A per Raspberry Pi 4 requirements. Fortunately, I had an old laptop power supply, and I didn't have to buy a new one.
The next challenge was finding a micro-HDMI cable. In order to avoid buying a new cable, we used Raspberry Pi 4 in headless mode.
The second piece of this project is a gift I received from a local wind tunnel (indoor skydiving) which plays a short promotional video when the cover is opened.
The video brochure has two modes of operation as explained in this video:
https://thevideocards.com/how-to-upload-video-to-video-brochures/
The default mode is mass storage device and once ejected it plays the videos stored on the device.
The display is connected to a Printed Circuit Board (PCB) and that in turn is connected to a speaker, a USB port, a magnetic switch, and a battery.
To simplify the project, we removed the battery and replaced the switch with a jumper wire.
We also replaced the USB port and glued everything on an old gift card. It's a ghetto Hardware Attached on Top (HAT) for Raspberry Pi 4 that does not plug into GPIO pins.
Our first software challenge came from Python
Starting with the October 10, 2023 Bookworm release of the Raspberry Pi OS, the use of Python Virtual Environments (venv) when pip installing packages is required. No more sudo pip.
Here is a great long explanation of what's going on:
https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi?view=all
We ended up taking the risk and removed EXTERNALLY-MANAGED file to be able to use PIP.
We wrote a Python script to automate the download and rotation of the videos, and we wrote another Python script to copy the video in batches that can fit on the video brochure. Each script has an infinite loop to perform the task continuously.
The first Python script uses Selenium to simulate user opening the page, scrolling down, and clicking to continue as a guest. The script also uses Requests to download video files.
The second Python script controls the USB connection status to switch between modes.
Finally, here is a link to explain how to setup autostart to run Python scripts as soon as the Raspberry Pi 4 is powered on:
https://learn.sparkfun.com/tutorials/how-to-run-a-raspberry-pi-program-on-startup/method-2-autostart
You can also make the OS read-only to avoid micro-SD card corruption due to improper shutdown using instructions here:
https://learn.adafruit.com/read-only-raspberry-pi/overview
Further DevelopmentI tend to focus more on Microcontroller projects than Single Board Computer (SBC) projects because most of my use cases can be handled with less power.
ElectronZ80 claims to be the operating system for the video brochure made by mayways. Found that out while searching for the USB description of the device "Actions Semiconductor Co., Ltd D-Wave 2GB MP4 Player / AK1025 MP3/MP4 Player". Serval attempts have been made to "hack" this device, and maybe this is your opportunity to shine.
In case you are still wondering who is the intended audience of such a project...
This demo includes the Raspberry Pi 4 side only to preserve our sanity. The video speed is 16X and it shows Download folder being auto populated while external storage is connected to load video files then disconnected to display them.
Comments
Please log in or sign up to comment.