Changes

Jump to navigation Jump to search
no edit summary
The following install guide details the steps from a fresh Ubuntu 20.04 install to a fully running GNU Radio + USRP B200 , HackRF and RTL-SDR frequency hopping spread spectrum setup needed to capture smart meter data. The guide will be updated <youtube width="320" height="240">fUK8tcFQwpo</broken out as additional SDR's like the HackRF and RTL-SDR are added.youtube>
==Install Ubuntu 20.04==
===Install dependencies===
The block at the top is standard from the GNU Radio install guide. The two additional below are vim so you get nice colors in your editor and liborc which is needed for the additional GNU Radio blocks that will be installed.<syntaxhighlight lang="bash">
sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0xterm</syntaxhighlight><code>sudo apt install liborc-0.4-dev vimlibsndfile1-dev graphviz curl</code>
==Install GNU Radio 3.89==
This guide and the blocks used here are all dependent on GNU Radio 3.8. As 3.9 has been released for a while more blocks and packages are getting support so this guide may be updated in the future to support 3.9.<syntaxhighlight lang="bash">
sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.89
sudo apt update
sudo apt -get install gnuradiopython3-packaging
</syntaxhighlight>
sudo ldconfig
</syntaxhighlight>
===Install gr-osmosdr for GNU Radio support===
<syntaxhighlight lang="bash">
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
git checkout gr3mastermkdir buildcd build/cmake .8./makesudo make installsudo ldconfig</syntaxhighlight> ==For AirSpy Support== ===Install necessary packages===<syntaxhighlight lang="bash">sudo apt install libairspy0 libairspy-dev</syntaxhighlight> ===Install gr-osmosdr===<syntaxhighlight lang="bash">git clone git://git.osmocom.org/gr-osmosdrcd gr-osmosdr/git checkout master
mkdir build
cd build/
</syntaxhighlight>
==For RTL-SDR Support==
===Install RTL-SDR drivers===Follow procedure to install RTL-SDR drivers: https://www.rtl-sdr.com/rtl-sdr-quick-start-guide/Section: Getting Started on Linux===Install gr-osmosdr===<syntaxhighlight lang="bash">git clone git://git.osmocom.org/gr-osmosdrcd gr-osmosdr/git checkout mastermkdir buildcd build/cmake ../makesudo make installsudo ldconfig<br /syntaxhighlight
==Install Frequency Hopping Utilities==
If you already have GNU Radio and your SDR setup you should start here to install the Sandia Laboratories out of tree (OOT) modules. Four different OOT modules are needed.
git clone https://github.com/sandialabs/gr-pdu_utils.git
cd gr-pdu_utils/
git checkout maint-3.89
mkdir build
cd build
sudo make install
sudo ldconfig
cd ../..
</syntaxhighlight>
git clone https://github.com/sandialabs/gr-fhss_utils.git
cd gr-fhss_utils/
git checkout maint-3.8master
mkdir build
cd build/
sudo make install
sudo ldconfig
cd ../..
</syntaxhighlight>
git clone https://github.com/sandialabs/gr-timing_utils.git
cd gr-timing_utils/
git checkout maint-3.8master
mkdir build
cd build
sudo make install
sudo ldconfig
cd ../..
</syntaxhighlight>
===Install Sandia Utilities(Possibly not needed for GR-3.9)===
<syntaxhighlight lang="bash">
git clone https://github.com/sandialabs/gr-sandia_utils.git
cd gr-sandia_utils/
git checkout maint-3.8master
mkdir build
cd build/
sudo make install
sudo ldconfig
cd ../..
</syntaxhighlight>
Add the following to the end of your .bashrc if there is no PYTHONPATH variable.
<code>export PYTHONPATH=/usr/local/lib/python3.8/dist-packages/</code>
====Finish up====
Close all open terminal windows and then open a new one.
==Setup gr-smart_meters==This contains the GridStream block that will be used to decode Landis+Gyr Smart Meter data along with pre-configured flowgraphs for USRP B200, HackRF and RTL-SDR and a script to decode GPS data transmitted in some cases. ===Python 2.7 dependencies===Current version of script which does GPS coordinates extraction requires Python 2.7 and numpy library installed.<syntaxhighlight lang="bash">sudo apt-get install python2curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.pysudo python2 get-pip.pysudo pip2 install numpy</syntaxhighlight>===Install gr-smart_meters===<syntaxhighlight lang="bash">git clone https://github.com/BitBangingBytes/gr-smart_meters.gitcd gr-smart_meters/git checkout mastermkdir buildcd build/cmake ..make -j8sudo make installsudo ldconfig</syntaxhighlight>===Start GNU Radio from a terminal window===<code>gnuradio-companion</code>   If you get an error when you start GNU Radio "The xterm executable 'x-terminal-emulator' is missing, edit the following file:<syntaxhighlight lang="bash">sudo nano /etc/gnuradio/conf.d/grc.conf</syntaxhighlight>Edit the line to read 'xterm_executable = /usr/bin/gnome-terminal"===Open flowgraph for your SDR===In GNU Radio open a flowgraph and open FHSS Flowgraphnavigate to the gr-smart_meters/examples folder. If you have installed everything above you should be able to run it and see smart meter data!==Determining your power providers CRC==CRC check is set to false in the sample flowgraphs so you will see data but can't be sure there aren't any errors. Every power provider is assigned a unique CRC so neighboring smart meter systems do not interfere with each other. To determine this you need to capture at least 4 good packets and use reveng to reverse the CRC.===Install reveng===ToDoIt's on sourceforge: https://reveng.sourceforge.io/Documentation is at: https://reveng.sourceforge.io/readme.htmDownload the .zip in the latest releases folder: https: //sourceforge.net/projects/reveng/files/2.1.1/Follow instructions to make===Provide reveng four good packets===I find the easiest way to do this is to limit the '''Packet Type''' to 0x55 and '''Packet Length''' to 0x23. Edit the GridStream block and make those changes then run the flowgraph making sure '''CRC Enable''' is set to False.  You will get data that looks like this below. <code>00FF2A55002330FFFFFFFFFFFF50CF5DD9E2C0B80065F5D1A483F0FBBC6F01001E6C043B517E90B286</code> You need to remove the first 6 bytes and provide the rest as inputs to reveng, CRC isn't calculated on those bytes. <code>00FF2A550023 <-- Discard | 30FFFFFFFFFFFF50CF5DD9E2C0B80065F5D1A483F0FBBC6F01001E6C043B517E90B286</code> Now provide four samples to reveng <code>./reveng -w 16 -s 30FFFFFFFFFFFF50CF5DD9E2C0B80065F5D1A483F0FBBC6F01001E6C043B517E90B286 30FFFFFFFFFFFF50CF2DD9E560560065F5D5A483F0C000650100176C033FF77E901766 30FFFFFFFFFFFF50CF95D9E5E01A0065F5D9A483F0515A0201001E6C042A177E90BDA4 30FFFFFFFFFFFF50CF8DD9E6A0F00065F5EBA483F0EBFD4A0100206C0433A97E90B04C</code> You should get the following output below if you used this data to test <code>width=16 poly=0x1021 init=0x5fd6 refin=false refout=false xorout=0x0000 check=0x139e residue=0x0000 name=(none)</code> The init value is what you enter into the GridStream block, you can now enable the CRC and know you have correct data!
*Add details here on where flowgraph is stored (FHSS Examples Folder)*Add information on what settings need to be changed to target smart meter data{{#widget:CRCprefix}}

Navigation menu