Friday, April 27, 2018

Installing software onto the Raspberry Pi- Part 2

Finally here's where we install the Linux software for monitoring the Smart Meter!
Based on the previous work done for the testing on a Windows PC, we are going to need:
  • rtl-sdr drivers
  • rtl-tcp server
  • rtlamr decoder
But instead of Windows sources, we are going to need the ones for Raspbian.

RTL-SDR / RTL-TCP

The following post was extremely helpful in setting up the rtlsdr software on the RPi:

  • First we need to install some packages required by the rtl-sdr dongle server:
  • Instead of going to the NooElec website for pre-compiled Windows drivers, we will get the sources from:

    Fortunately 'git' is already included with the installed OS, so we can execute the following directly in /home/pi to get the rtl-sdr code:
(Note that in order for certificates to work for https access, you must have your OS set to the correct date and time !!
  • We can now run the following (note it may take some time to complete):
  • Before we can install the rtl-sdr USB dongle, we need to setup a 'blacklist' file to prevent the standard USB Radio/TV drivers from loading. Create the file 
/etc/modprobe.d/blacklist-rtl.conf
         
         and add the following lines to it: 
  • You can now reboot the RPi, install the rtl-sdr dongle, and run rtl_test  
(use Ctrl+C to exit the test):

RTLAMR

  • Before we can download and build rtlamr, we need to install the go build environment


(since this is for the RPi, we will need to get the version that runs on the ARM processor;  
as of this posting, the latest go release is 1.10):

  • If all has run successfully, you can now check the go version:
  • We can now download and build bemasher's rtlamr from
https://github.com/bemasher/rtlamr

  • You can now start up rtl_tcp in a terminal session:
  • And then start up rtlamr in a different terminal:
Next steps:
  • Configuring the meter reader software

2 comments:

  1. I find I am having problems with rtl_tcp /rtlamr not generating continuous data (scm mode seems to work better than scm+). Need to look at what's different between my PC implemenation and the RPi.

    Also, this posting points out a limit to the sampling rate with the RPi3:

    http://drwxr.org/2017/04/setting-up-rtl-sdr-on-raspberry-pi-3/

    ReplyDelete
  2. If you are having certificate problems because your date and time are wrong, the example bash command to change them is:

    $ sudo date -s "10 MAY 2018 12:42:00"

    ReplyDelete