Activity

Alec

Logging, button actions

The logging feature now reads from the logs.txt file in the user’s home folder. I’ve integrated my scripts with this log such that any fail or success will write to this log. It’s drawn dynamically on the display. I’ve also implemented button actions - holding any button will trigger code. For example, holding key 3 will actually turn the device off, holding key 2 will wipe the logs, and holding key 1 will refresh information. Holding the sleep button won’t cause an infinite sleep/awake loop. I’m extremely close to finishing this project and all that’s remaining is the simple autostart of this program and the implementation of the overview page (which should be easy enough). Expect a demo video and ship later this weekend! :D

Attachment
0
Alec

Menu switching

I’ve integrated menus. You can now select between all three menus using the 3 right buttons. It also works perfectly with sleep mode - clicking on any menu while in sleep will wake the screen and take you to the proper menu. The layout is finished so now I’ve got to fill in the content (logs & states) to make it actually useful. I’ve still got to figure out how to make hold actions like to clear the logs or to power off the device, but I wont worry about that right now. I realized while planning these menus that the joystick is kind of useless and is only currently used for sleeping the device. Maybe I’ll find another use for the three right side buttons (actions?) and turn the joystick into menu movement (with animations??) but I’ll leave that to another ship.

0
Alec

Working on integrating the buttons with the program. Clicking the joystick down will turn off the display entirely. The goal is to draw near zero power to the HAT when in sleep so that I can leave the display off (and ensure the device/display longevity) when I’m not using it. It took a lot of tinkering around to get the sleep and backlight to work properly but I’m proud of how fast it can sleep & wake up. In the video you’ll see that the backlight (right underneath that screen but above the HAT pcb) can also be toggled for near zero power draw. Also you’ll notice that I redesigned the overview page - I figured out how to change the background color (it’s really jank, will probably have to do more touch ups on the drawing backend). Will focus on getting the rest of the pages complete.

0
Alec

The demo program is an absolute mess. I’m new to C but even I can tell bad code apart. Although it was pretty well documented, it was clearly made with low effort. So, of course - I had to clean it up and refactor most of it. The result is another (smaller) mess and my first prototype stats page. Still have to find a way to fill in the info and make the background color actually work. This is the heart of the project right here and I’ll be putting my best foot forward to making this experience and UI super polished, even when I’m not given the prettiest of tools (if you care to take a look at the code (this is my first C project) you’ll know what I mean). Anyways, feeling pretty good about the future of this project and hopefully I’m able to now dedicate some more time to making this thing actually work.

Attachment
1

Comments

Divyanshu Dhruv

DAMN

Alec

GPIO buttons now work!! Had to fiddle around with the config.txt of the Pi and got lost with dtb stuff but all is now working. Lots of progress made towards the display application side of things and I’m now modifying the original demo program to provide a solid foundation for my system management program. Honestly the lack of documentation is really rough since it feels like the Pi Zero 2W just isn’t as supported on NixOS or even in the kernel as the Pi 4 or Pi 5. I have all these hacky dtb overlays in my Nix config which is really annoying. I’m trying to clean the system up and remove things that won’t break the screen but the lack of self-rebuilding is making the process very painful. I made a quick devshell which has a program to automatically deploy the built binary to the device so hopefully I can develop faster. Enjoy this quick video of me using the demo program to showcase the now working buttons!

0
Alec

Finally got the proper i2c/gpio dts for the Pi Zero 2W working and now I have a fully working display on NixOS!!!! (first image is the demo program, second image is fastfetch on the Pi on NixOS!!)
The buttons still don’t work yet (I honestly dont know why) so that’ll be what I focus on next, and then I can go on to actually making the program for the display.

Attachment
Attachment
1

Comments

chefpenguino
chefpenguino 6 days ago

W nixos

Alec

So I went ahead and tried running the example code for this Waveshare display on NixOS and to nobody’s surprise: it didn’t work. So many errors and issues. I don’t even know where to start with fixing it. I installed Raspbian and ran the test program and it worked, so at least I can’t attribute it to my faulty soldering job (I soldered the header on before starting Flavortown). I’m going to investigate this further and try to get the display working on NixOS so I can use my flake.
I found a Nix flake for Pi hardware support so I tried giving that a go but I realized it doesn’t support the wireless Zero 2 model so I might just steal the flake expressions instead. Also I got the Spotify download script working so my music backup service works now.

Attachment
Attachment
0
Alec

I cleaned up the flake but ended up deleting the wireless firmware by accident. I had to reinstall the flake but I ended up with a much smaller & optimized system. My focus is getting the two backup scripts and webserver services working flawlessly. I’ve successfully managed to get the Github backup service working with my Github PAT (I came up with a really clever solution to store my keys that don’t require local key protecting rebuilds - I just store the file and call that file directly from the code rather than pulling from an environment variable) so all my Git repositories are pulled and saved on the USB drive and accessible through the NAS. Attached screenshot is the terminal running the git fetch scripts which dynamically includes my private repos as well
I tried to get the Spotify download service running but it seems like Spotify has recently implemented aggressive rate limiting policies which break spotdl. They even block new developer apps so its impossible to use authentication to get better rate limits. For now, I’ll just focus on getting the webserver service running reliably (it seems to crash or stop responding and its service breaks on restart)
I’ve also been preparing the Pi’s config for spi & i2c control so that I can properly interface with my display HAT. I haven’t yet tested the display so that’ll probably be my next task.

Attachment
0
Alec

I’ve implemented complete drive automounting with Nix. Unplugging/plugging in a new drive will make the drive available on the Samba NAS share (top right of the screenshot). Scripts and the webserver will not run if there is no drive attached (because thats where the database and stuff is stored)
I’ll begin working on making the Github and Spotify backups work with the automounted drive. My hope is to make them all available through the NAS drive hosted by the Pi.

Attachment
0
Alec

I’ve rebuilt the image twice because I forgot to set a password within the flake. Second time I corrupted the image but the third time’s the charm and now I’ve got a fully working Zero 2W flake. SSH works so I’ll be using the device headless from now on. I’ve also made some documentation updates.
First image is working flake + SSH, second image is the fastfetch and 3rd image is the corrupted image.

Attachment
Attachment
Attachment
4

Comments

101zh
101zh 15 days ago

Let’s goooooo! ᕙ(⇀‸↼‶)ᕗ

Alec
Alec 15 days ago

hi hunter!!!!

Alec
Alec 15 days ago

oh btw funny thing this is the same Pi kit that I got from daydream seattle!!! do u remember the labryinth game 101zh?

101zh
101zh 15 days ago

Yep, I remember it! I’m glad that you’re putting the kit to use. I can’t wait to see where you go from here.

Alec

Hackatime will be tracking just the flake/software side of this project. However, I’ve spent hours already designing and modeling a case for my Raspberry Pi (see image) and getting the Nova PM sensor working. I’m using a Pi Zero 2W kit I got as a prize from Daydream Seattle. I also have a Waveshare display HAT I got a few years back (never ended up using it). I’ve configured the basics of the Nix flake and as I’m writing this I’m building the custom NixOS ISO image to flash to the SD card. This image will allow me to boot NixOS on the Pi and rebuild it from my main laptop.

Attachment
Attachment
Attachment
0
Alec

Currently working on a large-scale Minecraft survival server themed around a snowy tundra. I’ve recently hit a few milestones in its development - from finishing the building and raiding system to the custom block system. This is what I have so far (this entire structure was built with a building tool and blocks were crafted from a custom UI - more about this soon!)

Attachment
0