I recently bumped into a problem with Hempstick 2.0 development, and have to put in a "sort of" delay. Shouldn't affect the final result timeline too much...
For those who did not read the previous post about the next gen Hempstick, it's a Linux-based panel controller instead of using RPi Pico kind of embedded processor (I might still write that one, if I find the latency of Linux-based Hempstick too slow, and let it handle the low latency "hungry" stick/throttle/rudder, and the 2.0 handles higher latency panels. So, whether there will be Hempstick Pico depends on the results I get from Hempstick 2.0.). This would be a fleet of RPi Zero 2Ws, each has 4 cores, 1GHz, and as much as disk space you want on the SD Cards. It could also be RPi 5 with an NVME drive (but I am not building a Linux distro for RPi5, as there is no point, just use a Ubuntu distro., instead I will build a bunch of Debian .deb files that you can just download and run "apt install *.deb" to install them.). It will feature a custom compiled Linux Kernel, and my own Debian-based Linux OS distro. For the uninitiated, it means, I go grab the Linux Kernel source code, and cross-compile on an AMD64 machine, for Arm64 machines, and then, build an entire OS myself with that custom kernel in it. I get to chose what is included, what is not included. You get a .img file, burn it to an SDCard, boot up, and you have a Hempstick 2.0 running.
I have already proven this concept by
- building the custom Kernel with a Jenkins job (automated),
- build another custom program I wrote with a Jenkins job, from my own git server at home; this is part of the mechanism to turn the Linux OS into an USB HiD Joystick device,
- hand over the kernel, and custom program, to the 3rd Jenkins job to build the entire OS, setup the hostname, IP#, WiFi SSID/password, install the custom program, and OS boot up parameters, and arrange the OS so when boot up will automatically run that custom program.
The custom program and the OS setup will automatically run at boot up, and report to my iMac as a Hempstick HiD joystick. Or, don't plug in the sole USB on RPi Zero 2W at boot up, but later plug it in and the other end the iMac... worked just fine in this scenario too.
What's missing is.... write the daemon program to automatically read sensors.... like buttons, Hall Sensors and form USB HiD reports to be sent to the host. Now, obviously, there will be many version of this daemon program.... because the sensor reading and USB report formatting need to match your hardware and what the USB HiD report description (fed to that custom program; this is configurable. It's just a json file of a specific format so you can write you own.).
That's is where the bump is....
The Debian I based mine on is the newest Trixie distro, aka. Debian 13, as opposed the Bookworm as for Ubuntu 24.04, aka Debian 12. The reason for Trixie is because I need Kernel v. 6.16.0+, as there is a feature I need that was just release in 6.16.0. And, obviously, Bookworm is not exactly tested for this newest Kernel. RPi OS has just released a new version Oct. 2025 that is upgraded to Trixie... but the other software framework I want to use to write the sensor reader daemon program is only expected to upgrade to Trixie in summer next year.
So, I am faced with a dilemma... I can go back to bookworm... and rebuild my distro... continue the development, and have to upgrade to Trixie later... or I can hold off the distro, but do the development of the sensor daemon with an Ubuntu 24.04 on an RPi5..... and wait for the software framework to support Trixie next year.
I chose door #2, continue to develop the sensor daemon on an RPi 5 with Ubuntu 24.04.
I think this is probably a wise decision, because, trust me..., building your own distro is not for the faint hearted. This stuff is glued together a lot of snot... OpenSource snot, changing from Trixie to Bookworm is not trivial.... it's like a box of chocolate... you never know what you gonna get [ Forest Gump ]. And, it doesn't impeded my development works. I am not expecting this stuff to all work before next year anyway. And in the mean time, I could use one of the RPi5s I have lying around for development anyway. Plus, I ain't gonna develop the sensor daemon on an RPi Zero 2W anyway... the SDCard file system is too slow. RPi Zero 2W is only intended as a runtime, not development platform. I will developit on an RPi 5 with an NVMe drive anyway... it's just that now I test it on some RPi5s as well. Instead of sticking an RPi Zero 2W on my own throttle design, I stick an RPi5 on it. I am ok with that, although you might not.
So, development continues, in a different direction. C'est la vie.
Note:
Keep in mind though. The last time I tested Linux Real Time Patch on various RPi platforms, I was getting about 25µs to 35µs interrupt latency (when an event happens until an interrupt handler function was entered, for an RPi 4, which is barely good enough for running LinuxCNC. On an RPi Zero W, I was getting atrocious 250µs, definitely an absolutely no-no for Linux CNC.
However, 250µs was 4 times faster than the 1ms I set for Hempstick v.1 with some Atmel Arm32 MCUs, and it's almost an order of magnitude better than what is really needed (about 8ms). And now we have RPi Zero 2W, and RPi5.... they might actually work as a control stick "controller." Fingers crossed.
Comments
Post a Comment