In this post I’ll demonstrate how to build and run rtl_433 on Windows using the Windows Subsytem for Linux as a reasonably quick & dirty way of getting this software going without needing a native Windows build.
PS This has been updated in May of 2023 for later versions of WSL which no longer supported USBIP in Windows 10.
What is rtl_433?
rtl_433 is a popular open source decoder of data devices which use the ISM (Industrial, Scientific, Medical) wavebands to broadcast data wirelessly — things like wireless weather stations, wireless thermostats, wireless alarm sensors etc. rtl_433 allows anyone with a cheap SDR (software defined radio) to decode these signals and show their content.
You can get rtl_433 at the author’s github page here: GitHub — merbanan/rtl_433: Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
However, the default build is best done on Linux and although there are build instructions for Windows, frankly they are a bit of a pain compared to the *nix builds.
WSL to the Rescue
Fortunately these days we have the wonderful Windows Subsystem for Linux which allows us to run a full blown Linux distro on Windows desktop through the power of virtualization. I’m going to briefly demonstrate how you can use WSL to build and run rtl_433, and connect to your USB SDR using a tool called usbpid_win.
In this example I’m going to be using the ubiquitous rtl_sdr USB SDR dongle, beware of imitations!
First, Installing and Configuring WSL
Installing WSL is really straightforward. Follow the instructions here to kick of the WSL install process: Install WSL | Microsoft Docs
It takes a while, and there are some setting up questions asking the name of the main account you want to create etc, but at the end of it you will have an Ubuntu distribution installed and ready to run on your desktop. Go to the Search bar and type in “Ubuntu” and you’ll see a new icon which allows you to start it:
At this point you can start to focus on getting the rtl_433 code and building it. But before you do that it’s worth updating the Ubuntu installation to make sure you have all the latest tools and libraries. The two commands needed for this are below. The first command updates the list of packages to find what the latest versions are, the second one actually upgrades packages. You don’t strictly need to do a full upgrade, but you definitely need to do the update before doing the rtl_433 build.
# sudo apt-get update
# sudo apt-get upgrade
Once this is done, you can download the rtl_433 code and build it.
Create a new directory where you want the code to go, cd into it and then run the git clone command as shown below to download the code:
# mkdir rtl
# cd rtl
# git clone https://github.com/merbanan/rtl_433.git
This downloads the code directly from the github repository where it’s stored, into a directory called rtl_433.
Once the code is downloaded the next stage is to install the Linux dependency packages, and once that’s complete use cmake & make to build and install the code.
NOTE: these instructions work for the Ubuntu 20.04 version of WSL on Windows 10, but there could be added complications as the versions change in the future.
# sudo apt-get install libtool libusb-dev librtlsdr-dev rtl-sdr build-essential cmake pkg-config[...packages will install...] # cd rtl_433/
# mkdir build
# cd build
# cmake ..[...cmake will configure the build, there maybe some warnings here which you can ignore...]# make
# sudo make install
The full explanation of these instructions can be found in the Linux / debian build guide here: rtl_433/BUILDING.md at master · merbanan/rtl_433 · GitHub
Installing Windows USB Device support
Once the make install step is complete, you are ready to use the software. However, here is where there is some additional config needed.
If you plug in your RTL-SDR dongle try and start rtl_433 now you’ll get a “No Supported Devices Found” error message because the Ubuntu instance can’t “see” USB devices plugged into the machine. So we have to add USB device support to WSL, and bind the RTL-SDR device to the running instance.
Step 1: open a Powershell window in elevated mode — ie search for the Powershell tool in the Start menu, right-click on the icon and choose “Run as Administrator”
Step 2: In the powershell window, use the winget command to install the tooling:
winget install dorssel.usbipd-win -i -e
Answer Y[es] to the questions and the installer will kick off. Just take the default arguments and let it complete.
NOTE: You should close this Powershell window, and then open a new one in administrator mode for later commands. This ensures it picks up the newly installed usb tools.
Step 3: Now we need to install supporting libraries in our Ubuntu environment as well.
NOTE: as of May 2023 the original instuctions no longer work in Windows 10 due to changes in WSL so this next section has been updated as you now need to build a USBIP enabled kernel.
To create the USBIP enabled kernel go to: WSL support · dorssel/usbipd-win Wiki · GitHub and follow the instructions entitled “Building your own USB/IP enabled WSL 2 kernel”.
Once the above is complete, restart the WSL instance and in the Ubuntu terminal we type:
# sudo apt install linux-tools-generic hwdata
# sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/*-generic/usbip 20
(PS if you didn’t do the package update at the beginning of these instructions, these last commands my fail).
If you have any issues following the above, check the install documentation here which has alternative steps in case of problems: Connect USB devices | Microsoft Docs
Attaching the RTL-SDR USB Device to Ubuntu
Now the USB libraries and tools are in place, we can “bind” the RTL-SDR device to the Ubuntu instance so it can be seen by rtl_433.
First, we need to find out which USB device the RTL-SDR is on the Windows machine. In the previous Powershell window run this command to list the devices:
usbipd list
This will show a list of USB devices attached:
In my case, the RTL-SDR device is BUSID 1–1, “Bulk-In, Interface”. If you can’t identify your device, try running this again with it unplugged to see which device disappears!
Now, we can attach this device to Ubuntu. We use the usbipd wsl attach command for this, passing the BUSID of the RTL-SDR device:
usbipd wsl attach --busid 1-1
And There it Is! Almost!
With the USB device attached, rtl_433 can now detect it and run without any problems. Except! That I found that the program required elevated permissions to access the newly attached device.
No problem, using the sudo command, rtl_433 runs without any issues. e.g.
# sudo rtl_433
And the result is, a running rtl_433, on WSL, using a USB attached SDR dongle:
For full instructions on the many useful configurations you can apply to rtl_433, see the github repository for the docs.
Oh, and One Last Thing
There is one disadvantage to this approach and that is that while your RTL-SDR is “attached” to the running Ubuntu instance, it can’t be used by Windows programs e.g. SDR#Sharp etc.
If you want to release the SDR dongle so you can use it again on Windows, you just need to run the usbipd-win wsl detach command to release the device back again. i.e. in the Powershell window you would run:
usbipd wsl detach --busid 1-1
And so the process of swapping between using the SDR on Ubuntu or on Windows itself means you have to go through and attach or detach as needed.