Raspbian Post Tag - TechOpt.io https://www.techopt.io/tag/raspbian Programming, servers, Linux, Windows, macOS & more Tue, 17 Jun 2025 02:37:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://www.techopt.io/wp-content/uploads/2024/07/cropped-logo-1-32x32.png Raspbian Post Tag - TechOpt.io https://www.techopt.io/tag/raspbian 32 32 Reading my Water Meter in Home Assistant with USB SDR https://www.techopt.io/smart-home/reading-my-water-meter-in-home-assistant-with-usb-sdr https://www.techopt.io/smart-home/reading-my-water-meter-in-home-assistant-with-usb-sdr#respond Sat, 29 Mar 2025 22:25:29 +0000 https://www.techopt.io/?p=860 One of the most interesting things I’ve done recently is integrating my residential city water meter into Home Assistant using a USB Software Defined Radio (SDR). I’ve been exploring ways to import utility meter data, like gas, water, and electricity into Home Assistant, and I discovered many of these meters emit signals over radio frequency. […]

The post Reading my Water Meter in Home Assistant with USB SDR appeared first on TechOpt.

]]>
One of the most interesting things I’ve done recently is integrating my residential city water meter into Home Assistant using a USB Software Defined Radio (SDR). I’ve been exploring ways to import utility meter data, like gas, water, and electricity into Home Assistant, and I discovered many of these meters emit signals over radio frequency.

Using RTL-SDR and rtl_433 for Water Meter Home Assistant Integration

After reading success stories online, I picked up the Nooelec RTL-SDR v5 Bundle from Amazon. This little USB SDR dongle can tune from 100kHz to 1.75GHz, which is perfect for picking up utility meter signals.

My first attempt was to plug the SDR into my Raspberry Pi 4 running Home Assistant and use the rtl_433 addon. Unfortunately, I ran into some power issues and weird addon errors, likely due to the antenna drawing too much power with everything else I already had plugged in.

Setting Up a Dedicated SDR Host for Home Assistant

To fix this, I decided to run the SDR on a dedicated Raspberry Pi. I had an old, original Pi 1 Model B lying around. With a decent 2A power supply and a wireless N dongle for network connectivity, I installed Raspbian Lite and the rtl_433 tool.

I experimented with both 433 MHz and 915 MHz frequencies, using the coiled antennas included in the kit. The 900 MHz antenna ended up being the winner. On the 915 MHz band, I finally started seeing data in the logs:

An example of the data I was seeing in the rtl_433 logs

Identifying My Water Meter in Home Assistant Logs

One key data point stood out: a field called Consumption Data showing a value around 168000. After comparing this with the value on my actual Neptune T-10 water meter (used by the City of Ottawa), I realized I was picking up my own water meter’s signal!

I also saw signals from neighboring meters, but by monitoring the data for a few hours, I confirmed which one was mine. The value updated every 15 to 30 minutes.

Fixing USB Stability for Water Meter Data Collection

One hiccup: after several hours, rtl_433 would crash with libusb errors. Unplugging and replugging fixed it temporarily, but the long-term solution was to use a powered USB hub (4A supply) to give the SDR the juice it needed. I also ditched the USB extension cable from the kit and plugged the SDR directly into the hub. That seemed to fix the issue.

The nice thing with this hub is also that I can use it to power the Pi; so I have 1 power cable for the hub, with 1 USB cable running from the hub to the Pi. I have a microUSB cable going from the hub to the Pi for power, and I have the RTL-SDR and Wi-Fi dongle plugged into the USB hub. You can see the final setup up close in the picture below:

My final setup showing the USB hub, radio, Wi-Fi dongle and Pi all connected

Publishing Water Meter Data to Home Assistant via MQTT

With the setup stable, I configured rtl_433 to output data to MQTT. Since I already had the Mosquitto addon running in Home Assistant, I pointed rtl_433 to it and monitored the output using MQTT Explorer. I found the data for my meter which matched up to the logs I was seeing directly on the Pi:

Seeing water meter consumption data in mqtt home assistant

Creating a Systemd Service for Water Meter Integration

To make everything persistent, I created a systemd service at /etc/systemd/system/ha-sdr-915M.service:

[Unit]
Description=rtl_433 on 915M SDR
After=network.target

[Service]
ExecStart=/usr/local/bin/ha-sdr-915M.sh
Restart=unless-stopped
WorkingDirectory=/usr/local/bin

[Install]
WantedBy=multi-user.target

The script at /usr/local/bin/ha-sdr-915M.sh:

#!/bin/bash

source /etc/ha-sdr.env

LOGFILE="/var/log/ha-sdr/ha-sdr-915M.log"

/usr/bin/rtl_433 -f 915M -F mqtt://homeassistant.domain.com:1883,user=$MQTT_USER,pass=$MQTT_PASS -F kv 2>&1 | while IFS= read -r line
do
    echo "$(date '+%Y-%m-%d %H:%M:%S') $line"
done >> "$LOGFILE"

I enabled the service by running systemctl daemon-reload and systemctl enable ha-sdr-915M.service.

Adding a Water Meter MQTT Sensor in Home Assistant

In Home Assistant YAML configuration:

sensor:
  - name: "Water Meter Consumption Data"
    object_id: water_meter_consumption_data
    state_topic: "rtl_433/pisdrfrontoh/devices/ERT-SCM/33391039/consumption_data"
    unit_of_measurement: "gal"
    state_class: total_increasing
    device_class: water

I noticed the values from my meter were in gallons, even though I’m in Canada where cubic meters or litres are common. To convert to litres, I added a template sensor:

sensor:
  - name: "Water Meter Consumption (Litres)"
    state: >
      {{ states('sensor.water_meter_consumption_data') | float * 3.78541178 | round(2) }}
    unit_of_measurement: "L"
    device_class: water

Setting Up a Utility Meter for Daily Water Tracking

Finally, I created a utility meter entity to track daily water usage:

utility_meter:
  daily_water:
    source: sensor.water_meter_consumption_litres
    cycle: daily

This entity allowed me to graph and display daily water usage data directly from my water meter in Home Assistant:

Water meter home assistant usage graph in litres

Final Thoughts on Monitoring My Water Meter with Home Assistant

This project took a few days of tuning and monitoring, but I’m thrilled with the results. For now, I’m only picking up water meter data, but I’m hopeful I’ll find more signals soon.

If you’re thinking about tracking your water meter in Home Assistant, using an SDR like the Nooelec RTL-SDR v5 and rtl_433 software is a great DIY approach. The insight into water usage is already super useful!

The post Reading my Water Meter in Home Assistant with USB SDR appeared first on TechOpt.

]]>
https://www.techopt.io/smart-home/reading-my-water-meter-in-home-assistant-with-usb-sdr/feed 0
Raspberry Pi Model B Original (2012) Uses in 2025 https://www.techopt.io/hardware/raspberry-pi-model-b-original-2012-uses https://www.techopt.io/hardware/raspberry-pi-model-b-original-2012-uses#respond Mon, 02 Dec 2024 23:49:24 +0000 http://localhost:8080/?p=53 It’s hard to believe that the original Raspberry Pi 1 Model B was released 13 years ago in 2012! With a 700 MHz ARM processor, 512 MB of RAM, 2x USB 2.0 ports and 10/100 Ethernet, its hardware is nothing impressive by today’s standards. However, if you’ve got one (or many!) of these kicking around, […]

The post Raspberry Pi Model B Original (2012) Uses in 2025 appeared first on TechOpt.

]]>
It’s hard to believe that the original Raspberry Pi 1 Model B was released 13 years ago in 2012! With a 700 MHz ARM processor, 512 MB of RAM, 2x USB 2.0 ports and 10/100 Ethernet, its hardware is nothing impressive by today’s standards. However, if you’ve got one (or many!) of these kicking around, there are still some viable applications to put it to good use.

The projects in this article are ones that the original Model B actually has adequate power to run without sacrificing usability or performance, not just “will run, but not well” projects.

Similarly, a lot of these should work with the Model A. However, keep in mind that the Model A only has 256 MB of RAM, which limits it further.

1. Raspberry Pi Print Server

Make an old USB printer WiFi and AirPrint compatible using an old Raspberry Pi with Raspbian. By connecting the printer to a USB port on the Pi and installing CUPS, you can share your USB printer with your network to make it wireless.

Additionally, CUPS also now supports broadcasting as AirPrint devices. Once the printer is setup in CUPS, you should be able to print to it from your Apple devices as well.

2. Pi-Based Digital Picture Frame

A digital picture frame is probably one of the lowest resource projects you can do. Therefore, this makes it perfect for the original Raspberry Pi. You’ll simply need an old screen with an HDMI input. You can even use a screen with a composite input, since the original Pi has a composite output!

Choose an OS, put your photos on your SD card or a USB key and install some image slideshow software. Some people even get creative with decorative framing around the screen.

User ShanJones01’s implementation of a Raspberry Pi digital picture frame over on Instructables (Image source)

3. Raspberry Pi Web Server

You can run a lightweight web server such as nginx or lighttpd on your older Raspberry Pi to serve static web pages and basic websites. You can also try Apache, but keep in mind that Apache is not as lightweight as nginx or lighttpd, so your performance probably won’t be as good.

The original Pi Model B definitely isn’t powerful enough to serve a website to hundreds of users, however, for a few users it should be more than adequate.

4. Self-Host Bitwarden

This is one of my personal favourites. Bitwarden is an opensource password manager that you can self-host. It has accompanying desktop apps, mobile apps, and browser extensions.

The original Pi may not be powerful enough to host full Bitwarden, but it will easily run Vaultwarden. Vaultwarden is an alternative implementation of the Bitwarden API written in Rust, which makes it super fast and less resource-intensive than full Bitwarden. You can still use it with the official Bitwarden apps and extensions.

Simply install docker and spin up the Vaultwarden container. Again, it might not work great for hundreds of users, but our Pi 1 Vaultwarden instance is working great for our family of 6!

5. Internet Radio, Bluetooth or AirPlay Receiver

This one is also a personal favourite to modernize an old stereo system. All you need is a stereo system or set of speakers with an AUX port. This way you can connect the headphone jack of the Raspberry Pi right into the stereo system. Alternatively, if the stereo is older and has an RCA input, you can use a 3.5 mm to RCA adapter.

Install an OS and run your favourite music apps to play directly to your speakers. Additionally, you can setup Bluetooth pairing to use it as a Bluetooth speaker. You can also install shairport-sync to support AirPlay from Apple devices.

Conclusion

The Pi has come a long way since it was first introduced. Even though at first glance the original Raspberry Pi 1 Model B looks severely under-powered by today’s standards, it still has some great uses for applications where a lot of processing power isn’t needed.

The post Raspberry Pi Model B Original (2012) Uses in 2025 appeared first on TechOpt.

]]>
https://www.techopt.io/hardware/raspberry-pi-model-b-original-2012-uses/feed 0