by mewse · 6y ago · 0 comments
I have a surprising number of RPis around the apartment now; a PiZero with the HQ camera module is serving as a webcam for my desktop machine, and another one is acting as an “on air” indicator to let folks know when a microphone is hot in the room (typically working-from-home zoom meetings). And another zero is controlling a set of “presence” indicator lights, watching bluetooth to determine who is in the apartment at any given time. That makes it so that if one of us is leaving the apartment, we can easily tell whether we need to lock the door on our way out, without needing to go searching through the apartment to check whether another flatmate is home or not. (I found that for us, testing bluetooth was far faster and more reliable than testing arp, wifi, bonjour, geofencing, or etc)
... and I’ve just ordered a moderately large e-paper display which is destined to be mounted with a zero inside a picture frame and hung from the wall like a photo. Haven’t decided exactly what to show on it yet; probably will show a weather forecast and how long until the next tram will arrive at the stop outside our building. That kind of thing.
Plus, of course, the pi 4 that I just use as a generic linux box for my own amusement. These little projects have been such fun little creative outlets; I’ve very much enjoyed coming up with and implementing them over the past few years!
My uses are all brutally utilitarian.
One pi 4 is openhab, grafana, mqtt broker etc., and the other is doing all the network gumph - vpns, qos, Wi-Fi ap, Bluetooth presence, LoRa. One zero is a controller in a micro hydro system I’m building, the other runs a couple of remote cameras.
The arduinos are being used in a lora sensor network, using dinky batteries and solar panels - they’re so low power it’s ridiculous - most of them using ultrasonic rangefinders to measure depth in tanks (water, gasoline) and monitor river levels here and upstream - we live in a mill, so being able to see the delta-h will hopefully save us from a surprise flood this winter. The government operated river gauges were all destroyed in the floods last year, and haven’t yet been replaced. I’m managing to build serviceable river gauges for under €100 a pop - I might have to see if they’re interested, as I think their issue is money - they use these big mechanical gauges that I can’t see being cheap.
Another arduino is a weather station, and the last one for now is controlling a valve way, way uphill that I got bored of walking to.
Over the winter I intend to build out a heap of arduino/lora irrigation control valves, and am toying with sapping a tiny amount of energy from the water with an impeller to power the things - my ultimate aim here is to automate everything that reasonably can be, so we have more time to do the things that can’t be.
Also, damn, it’s fun to be tinkering again - 15 years of working in tech kinda killed my passion for playing with tech, but it turns out it’s still there.
1) I don’t want the water feed to the irrigation on when the sprinklers are not supposed to be running, and
2) I want a daily report on how many gallons went out that pipe to detect if something has changed.
The issue I’m running into is all the motorized ball valves or solenoids for 3/4” water pipes seam to be total junk.
Any suggestion for sourcing a decent motorized valve?
Flow meters I can’t yet comment on - haven’t yet played around with anything - although it’s easy enough to take lps data and integrate that in grafana or whatever for reporting - I’m currently doing so for our PV system, watts in and out etc.
How did you achieve this? I'd be very interested in setting something like this up for myself... Thanks.
It just so happens that the computer being used for the Zoom calls is a Mac, so I just wrote a program that runs in the background on the Mac and asks the OS about whether any microphone devices are in use by any programs, and then sends a message to the Pi, which really is only turning a hat of LEDs on/off based on UDP packets it receives. It could be turning the indicator on/off for anything that somebody else told it to do it for.
(Originally, I was using an Arduino Nano and a USB serial interface for communication, but my flatmate rewrote it to go over UDP to a Pi Zero W, as he wanted to use a particular RPi hat as the indicator lights)
Detecting the microphone on/off status on OS X was shamelessly ripped off from the answer to this StackExchange question: https://stackoverflow.com/questions/37470201/how-can-i-tell-.... I don’t know if there’s a similar approach that would work for Windows or other OSes.
Which display, if you don’t mind me asking? I’ve had a similar idea for a while, but haven’t seen a display that felt reasonably sized or priced for a hobby project
https://www.waveshare.com/product/raspberry-pi/displays/e-pa...
It’s the same size as the screen on most Kindle devices; 12cm by 9cm.
So it’s not large except in comparison to most e-paper displays out there, which seem to most often come in at 6cm by 3cm or smaller. And it’s not exactly cheap by any stretch of the imagination, but for me it was at the ‘sweet spot’ between size and cost, as stuff bigger than this gets expensive fast.
Note that I haven’t actually received the display yet and can’t vouch for its quality or usability. But for what it’s worth, that’s the one I ordered.
Alternately, there are some other shelves of a more normal height that I could just set it on top of; the power cable would be much less visible that way.
But I do like the idea of having it on a wall. As you say, the trick is going to be working out how to camouflage the cable.
We need super-long-life batteries. One day ...
How did you set that up? I wanted to do that for some time now
https://github.com/showmewebcam/showmewebcam
It boots up much faster and mounts the filesystem read-only so you don’t have to worry about unplugging the pi and accidentally corrupting the file system or anything like that. I’m currently using this one.
I keep bouncing off Arduino stuff just because I find their IDE to be astonishingly awful (at least on Linux, running inside a dwm window manager)
I’d be 100% on board if I could write the code in vim and ideally compile/upload from the command line. Maybe a nice makefile. And I did set that up for a few arduino devices in the past, but it was just too much jumping through hoops for me to really bother with longterm. Much easier to just grab a RPi Zero and install a compiler or python on it and then just code directly on the device, over ssh.
If there’s a better approach to handle the coding side of things than the standard Arduino IDE, I’d be super interested to learn about it!
Please check out platformio. It made a whole world of difference to me.
Documentation for getting it up and running can be found here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
I even submitted a PR to fix one of the areas that caused me a lot of headache (it had to do with an assumption about the Python environment), and it was rejected because the ESP-IDF is meant to be opinionated about its choices.
What's even worse is Amazon's ESP32 FreeRTOS distribution. Stay away from that with a 10ft pole. Sure, it sounds nice to have some integration with AWS (GreenGrass, IoT Core, OTA via MQTT via AWS, etc), but half the ESP32 won't work (eg multicore) and modules that you find for ESP-IDF are not inherently cross compatible.
By the way if you are looking for something like Arduino but less awful, Mbed is the most promising option. Their boards and API have been far superior for years, but unfortunately they relied on a mediocre online IDE. However they have finally seen the error of their ways and have a proper offline IDE, based on Theia, which is based on VSCode.
* Official Espressif SDKs (C): https://github.com/espressif
* NodeMCU (Lua): https://nodemcu.readthedocs.io/en/release/
* MicroPython: http://docs.micropython.org/en/latest/esp32/quickref.html
I haven't used the official SDK in several years and frankly the current state of their Github org confuses me (why are there so many options now?), so I won't say much about that. They do have a large library of examples however.
NodeMCU is a Lua firmware that abstracts away much of the ugliness you'll encounter trying to learn the C SDK. After the initial Lua learning curve and figuring out what it means to build and flash firmware, it's quite pleasant to use. I find the development iteration cycle much quicker than with the C SDK.
MicroPython is of course a Python firmware along those same lines. I personally haven't had much success with this one, and NodeMCU worked well enough that I didn't try much harder.
I too would like to see a nice straightforward solution to BYO editor to the Arduino IDE, everything I've looked at has been a set of strange hacks. (EDIT: I now see the link to vim-arduino, thanks mollusk)
Back in the day (about four years ago) I used a similar setup with with Sublime Text and an Arduino plugin.
For a more official alternative there's also the new (electron based) Arduino Pro IDE: https://www.arduino.cc/pro/arduino-pro-ide
Yes. The ESP8266 is too. I drive several of both chips through Arduino or ESPHome. I’m no programmer but have been very pleased by what I could achieve through the Arduino IDE (on a Mac).
Arduino is both a cpp framework AND a really bad IDE. Using tools like PlatformIO or just your favorite toolchain, you can still use the Arduino libraries and skip their IDE.
With the ESP8622/ESP32 you can also skip arduino and use MicroPython, or push c/cpp code.
Being able to drop into REPL and rewrite it is a super power. And while MicroPython doesn't tend to come with every library that Python does, you can generally install them via pip.
Or you could try other boards such as STM32.