sbts-aru
KaithemAutomation
sbts-aru | KaithemAutomation | |
---|---|---|
23 | 17 | |
94 | 45 | |
- | - | |
9.4 | 9.8 | |
3 months ago | 7 days ago | |
Shell | Python | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sbts-aru
-
Going in circles without a real-time clock
Unfortunately a Raspberry Pi is a bit ill suited for production environments. Id recommend an RTC module. Otherwise this might be helpful: https://github.com/hcfman/sbts-aru
-
Running a Raspberry Pi with a read-only root filesystem
If you install my sbts-aru project
https://github.com/hcfman/sbts-aru
It will shrink your partitions, add news and install one of these and set up a sub micro second system clock and an audio recorder suitable for sound localization with a single install command.
-
2024-03-01 listening in on the neighborhood
I recommend primo EM272 microphone capsules for use with https://github.com/hcfman/sbts-aru. They are high quality, very sensitive with high signal to noise ratio, lauded for nature recording use cases. They can be bought assembled for around 65 euros in the Netherlands. However these capsules are often found in much more expensive equipment.
-
Considerations for a long-running Raspberry Pi
My sound localizing Raspberry Pi installs a resilient base system as part of its install.
https://github.com/hcfman/sbts-aru
https://hackaday.com/2023/12/30/localizing-fireworks-launche...
With one command it for all Pi’s for both Raspbian and bookworm it:
* Shrinks the file system (Gee, how does it do that with just one disk ? ;-) )
-
Colorado wolf reintroduction to move forward as ranchers' legal effort fails
I have a sound localization project that can help with that
https://github.com/hcfman/sbts-aru
You need to be able to hear the sound from three or more recorders. And normally localization is better within the polygon of microphones but there’s an area of better localizability extending outside of a vertex.
-
Acoustic Location and Sound Mirrors
Interesting history!
And while we are in the subject of sound localizing may I take the liberty of introducing my new raspberry pi sound localizing audio recorder.
https://github.com/hcfman/sbts-aru
It installs with one command on all Raspberry Pi versions and synchronizes the system time to less than 1 microsecond of error with a cheap GPS.
With three of these I’ve been able to sound localize the explosions from illegal fireworks to a specific car park from more than 3km away with lots of houses in between.
When I got to the car park I could smell the sulphur from the fireworks.
This will even run on a Raspberry Pi zero running of a battery with a 6 euro neo 7m gps and a 6 euro usb mic.
-
AI tool helps ecologists monitor rare birds through their songs
Very nice tool!
So grab a spare Raspberry Pi, a GPS, a cheap USB sound card and a mic and get recording with this Pi based Acoustic Recording Unit
https://github.com/hcfman/sbts-aru
And while you are at it, install 3x or more and localize where the birds are.
-
Ask HN: Comment here about whatever you're passionate about at the moment
Sound localizing. I was intensely passionate about it when I saw the possibility to do it well on a Raspberry Pi. There were quite a few more problems than so expected which is why it took five months (of weekends) to complete it well.
But I’m super happy with the result and have a bunch of geeks with recording nodes setup a long distance apart. Localizing large explosions show that it’s possible to localize to a carpets even when some of the nodes are almost 5 away.
For those interested, here is the project:
https://github.com/hcfman/sbts-aru
- Localizing sound sources on a Pi anyone?
- Raspberry Pi based sound localizing audio recorder
KaithemAutomation
-
Pi Reliability: Reduce writes to your SD card
My SD protection script, a few months old and may need some updates since a lot seems to have changed in Pi OS:
https://github.com/EternityForest/KaithemAutomation/blob/mas...
Current version doesn't disable swap, that's in a separate optional file, but the next version will.
It can't be done in a one size fits all script unless you're launching chromium the same way, but do something like:
-
Running a Raspberry Pi with a read-only root filesystem
I don't usually do full read only, what I'll do is run a script that turns off stuff that does not need to be writing to the disk all the time.
Unfortunately, some software is database-oriented and likes to write to disk for every tiny thing, so the approach doesn't work with stuff like Home Assistant unless you carefully configure logging.
The basic simple stuff doesn't really cause any user-level noticable changes:
https://github.com/EternityForest/KaithemAutomation/blob/mas...
After that, I disable and mask apt-daily (The Debian auto updater), and purge dphys-swapfile.
My full set of assorted tweaks can be found here, some might not be relevant for you:
https://github.com/EternityForest/KaithemAutomation/blob/mas...
Next, I often run Chromium as a kiosk, and Chromium likes to hammer the SD card, so I set the XDG folder environment variables to make it put it's stuff in RAM. My embedded chrome stuff can be found here:
https://github.com/EternityForest/KaithemAutomation/blob/mas...
- The Chandler Visual Programming Model
- KaithemAutomation v0.7: the SD Friendly automation server that powered my Halloween stuff this year, cleaned up!
-
Raspberry Pi availability is visibly improving after years of shortages
Things like that are easy enough to set up on Raspbian with a script. You also need a bunch of tmpfs mounts, including some in crazy places(Regular Pi has a log file under ~/.cache that can fill disks and crash servers, and if you don't fix it Chromium writes seemingly useless crap constantly. There's auto updates on some systems, which is terrible if you're on a private WiFi, not doing internet stuff.
I'm not using zram at the moment, just getting rid of swap, but my current script to get a Pi ready for embedded projects is here: https://github.com/EternityForest/KaithemAutomation/blob/mas...
-
Ask HN: What have you created that deserves a second chance on HN?
The only FOSS thing I've done that I think is really worth telling people about is KaithemAutomation, a home automation server in pure Python with a bit easier setup than Home Assistant, and some features aimed at commercial installs like room escape control, and some pretty decent network video recorder features.
https://github.com/EternityForest/KaithemAutomation
I put 6 years or so into it, and have used it on plenty of contract projects, but so far I don't think anyone else is interested.
Possibly because it's largely UI and CRUD over existing functionality, and there's not much particularly exciting to the hacker community, few interesting algorithms, it's not minimalist at all, etc.
Plus it has a lot of dependencies that might or might not exist outside of Debian, I've never looked into how it would run on the more DIY distros since I've never used them.
-
Building surveillance system with WebRTC and YOLO
Then after that I square every pixel and square root the mean of the whole image.
I forgot how complicated this was and how many tweaks I added!
Code here: https://github.com/EternityForest/KaithemAutomation/blob/mas...
And for the motion detector specifically:
https://github.com/EternityForest/KaithemAutomation/blob/9db...
- Show HN: KaithemAutomation, the home automation system for coders and artists
-
Ask HN: Practical examples of runtime modified software
pure Python and heavily built around runtime modification(https://github.com/EternityForest/KaithemAutomation), and is designed to run for months, although it's not meant to be modified literally while running production(Not that that stops us from making last minute fixes...).
The big problem with it in Python is state. If you have a reference to something, and that something changes, and you have a reference to the old one, that should be a singleton, you are probably in an unhappy position.
The only way it can work in real life(In Python at least) is if you carefully design for it, and don't pass around objects and callbacks and stuff.
I have gone through several iterations of abstractions trying to make updatable objects and such to hide this from you, and none were very good.
I eventually settled on a message bus, and a data structure I'm calling a Tag Point adapted from the SCADA industry, which is like a variable, but you can subscribe to it, and spy on the value from the web UI, it stays around as long as there is a reference to it, and it's guaranteed that any tags with the same name are the same object, and a bunch of other stuff.
Files of code are essentially meant to be used like stateless microservices if you expect to update one, and if you want to access shared stuff, you make sure to not hold a reference to it.
A lot was(and some still is) based on weak references, and those can trouble and should probably not be relied on for correctness if possible.
They aren't the worst things though. I have code to run a few GC sweeps when a file is deleted, and it is extremely rare that anything stays around when it shouldn't.
Good enough for development, good enough for emergency fixes, not the best for regular updates to running systems, although it's 99.9% fine, and I can't say I really worry about it(But future versions should be more deterministic and more suited for live edits as a regular practice).
Erlang seems to like its functional-ness and I imagine that's a huge asset. Language level support is definitely a good thing.
Random unstructured code doesn't seem to work well with live updates.
If you are working in a general language like Python you really want to have your engine always know exactly what's going on, what subscriptions come from what module and which function is replacing what, etc.
You want to deterministically always be able to list any changes that a module made to anything else(Like subscribing to a function), and undo them.
But... weak refs work well enough.
The classic solution to tech problems is to reboot, live updates are kind of the opposite of that. Your new code has to perfectly pick up with what you keep from the old state, and if the old state is invalid somehow you have to deal with that too.
I've never heard of smalltalk as a live update language(In the Erlang telephone exchange sense), just that you can do interactive development in it, which is a lot easier.
I think if I intended to seriously to true live updates(Like phone exchanges not dropping active calls), I would really appreciate tools made for that.
Kaithem also does have a module with a visual script explicitly meant for changes in production. It's very limited and opinionated, essentially a state machine with event triggered actions attached to states, and variables at the state machine level.
That kind of transition rule system for simple tasks is very easy to live update. State is well separated from rules, and rules are simple and easy to parse programmatically, to do things like clean up after yourself if an event listener needs resources.
But just about any interpreted language works for interactive development.
A lot of people like FORTH for that, which I don't have any interest in learning but some love it.
- KaithemAutomation v0.68.28: Log in with your Linux user account credentials!
What are some alternatives?
al-ahli-hospital-blast
Zoneminder - ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
BirdNET-Pi - A realtime acoustic bird classification system for the Raspberry Pi 4B, 3B+, and 0W2 built on the TFLite version of BirdNET.
splink - Fast, accurate and scalable probabilistic data linkage with support for multiple SQL backends
Bitgrid - Bitgrid - a new model of computation
rosettaboy - A gameboy emulator in several different languages
random-ideas - random ideas
go-astits - Demux and mux MPEG Transport Streams (.ts) natively in GO
logseq-sync - An open-source Logseq Sync backend implementation
scheme-for-max - Max/MSP external for scripting and live coding Max with s7 Scheme Lisp
vimium - The hacker's browser.
hckrweb - Hcker News mobile web app