A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => The Cubie Board => Topic started by: TomW on December 06, 2016, 12:40:27 PM

Title: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on December 06, 2016, 12:40:27 PM
Since we just finished our 7.7KW Grid Tie install, I have interest in using these cool USB dongle Software Defined Radios to monitor our spanking new Smart Meter the utility installed.

I have made no real progress so far but have been busy on other stuff. I installed the Skywave Linux distribution in VirtualBox on my Macbook Pro and it works sort of kinda.  The dongle definitely works but I don't understand how to use it so far. It doesn't do what I want at all plus it is GUI driven. I was hoping to use it with the command line to snoop my meter values.

Typically, all the easy stuff uses Mickey Soft. Not going there.

Cubietruck is a bit wimpy to use a GUI, IMHO so Skywave is no help for my needs.


Anyone used one of these guys?

https://www.amazon.com/gp/product/B0129EBDS2/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B0129EBDS2/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1) << Amazon out of stock listing.


http://skywavelinux.com/ (http://skywavelinux.com/) <<The home page.

Supposedly these things can mimic pretty much any RF reciever once configured.

Anyone with actual experience, I would appreciate a clue hammer blow.

Thanks.

Tom



Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on December 06, 2016, 01:23:43 PM
yeah Tom,
I have used the SDR usb dongles.
I have an older one than what you linked but it works fine with the SDR Sharp software.
I haven't played with it too recently but I have gotten it to work with other programs so used to decode APRS packets and also got it working with software to decode the local highway department that had moved over to digital system. Most of the Wisconsin State Patrol is also now on digital I believe.

So you should be able to decode your meter if someone has already figured out how to do that.
The SDR that you linked is better than mine because it has an SMA antenna jack which is more common than the kind that I have. But mine came with a small mag mount antenna so I just desoldered the tiny coax from that and soldered that end on another connector that I could use with existing antennas .

If you haven't been on SDR Sharp website that is the place to go do some reading. I am pretty sure you don't use Windows so not sure how you would do it on linux or mac but on my Windows 10 I used a program that makes a virtual audio cable so you can route the audio from SDR to another program running on the computer to use.

I just bought a kit off ebay that takes a SDR ( included) and you solder on on a board with some other components that will allow it to tune down below 28 MHz limit into the HF bands. I haven't had a chance to put it together yet though.

Keep us posted on  your progress with this . I see Amazon is out of stock on the one you listed but you might try Nooelec for omparable models. http://stores.ebay.com/nooelec/


Larry
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: paul alting on December 13, 2016, 06:57:47 PM
Tom,
I haven't any experience with SDR as yet, even though I have a bench full of more traditional amateur radio equipment, which for me has a nice retro essence about it.
But, I have been looking over the past year and I wonder if you have looked into gnuradio, where you essentially develop the complete software processing section?
The link is http://gnuradio.squarespace.com/about/ (http://gnuradio.squarespace.com/about/).

Have a read and you will see it is quite comprehensive and capable.
I'm not sure if it will work with the particular SDR dongle you have and I know nothing about smart meter and what modulation methods they use for data transmission.

I'm sure there will be others that will have tinkered with trying to do the same.

Paul
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on December 14, 2016, 11:11:08 AM
Paul;

I do have GnuRadio installed in a Virtual Machine running Ubuntu. I find it way too hard to use and I don't have the patience to dig into the typical GNU cryptic documentation.

Thanks for pointing it out as an option, however.

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on December 24, 2016, 08:27:14 PM
Tom,
Did you get your SDR  yet ?
This looks interesting and you can get an SDR as part of their kit.
https://outernet.is/
https://youtu.be/24HBmRKHULs

Larry
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on December 25, 2016, 10:39:56 AM
Quote from: ClassicCrazy on December 24, 2016, 08:27:14 PM
Tom,
Did you get your SDR  yet ?
This looks interesting and you can get an SDR as part of their kit.
https://outernet.is/
https://youtu.be/24HBmRKHULs

Larry

Larry;

Yeah, already have it, one of those impulse buys before I researched and discovered it is yet another of those M$ only supported devices.  :'( Sadly, it was probably actually developed on Linux or other open source systems but only supported for Mickey$oft.

end rant. ;D

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on December 25, 2016, 11:50:12 AM
I am not a linux guy but it looks like there is linux support for SDR
http://www.rtl-sdr.com/skywave-linux-new-linux-ubuntu-distribution-made-for-software-defined-radio/
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on December 25, 2016, 01:01:41 PM
CC;

Got Skywave installed in a virtual machine on my macbook pro. It works but nothing for reading a smart meter I have found for it, yet. Missed the other 2 rtl distros so grabbing them now. 

Rather not run a GUI on the Cubie with its limited resources plus it is headless.

Appreciate the heads up.

I want a simple command line crond script or whatever to simply poll the meter every X hours or something. A few years ago I probably would sort out how to do it in Perl or Python but I just don't have what it takes to do that stuff these days. Bad case of CRS (Can't Remember $#!+).

Still too stubborn to give up just yet.

Thanks again.

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on December 25, 2016, 02:03:00 PM
Have you seen this - lots of links but not sure if they will help you
http://hackaday.com/2014/02/25/using-sdr-to-read-your-smart-meter/

http://bemasher.net/rtlamr/
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on December 29, 2016, 08:07:26 AM
CC;

Well, making progress (of sorts), got it  running in tcp mode on one of the cubietrucks running Debian Sid. Can access it from other devices over the network with graphical tools. Still a ways to go before it does what I want.

Just a heads up.

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on January 13, 2017, 11:50:50 PM
Well, after some false starts and lots of research, I found something that actually works as an arm binary for Linux.

It works with rtl_tcp to snag the data from our meter. Nothing fancy but moving forward. It is called rtlamr by a guy called bemasher and a google search should kick up a link.

rtl_tcp is available as a Debian package and the rtlamr is available as a binary.

Biggest problem finding good info on these radios, especially for reading meters is that damn near every thread on "how" diverts to a bunch of political BS about privacy and all that brings. So, the tech stuff gets buried by those who just want to @&%@ about the possibility of abusing it.

Still got some learning curve to climb but at least making forward progress.

Supposedly, we have the only smart meter in this burg so I can't really abuse it here.  :o

It is kind of interesting once you get it rolling along. Puts out this info to a log file:
  Time                                      Meter type   ID#             value
{Time:2017-01-13T22:27:20.656 8 SCM:{ID:51417813 201.58  KWH out
{Time:2017-01-13T22:28:03.997 8 SCM:{ID:51417812 877.16  KWH in
{Time:2017-01-13T22:28:28.068 8 SCM:{ID:51417814 675.59  KWH net

Meter type 8 is an electric meter each meter value has a specific ID# and all output values are 100th of a KWH (divide by 100 to get the KWH) I run it with the infinite loop option enabled so it just dumps to a file whenever the meter broadcasts it's info.

Hopefully this helps cut through the frustrating search for how this can be done.

It works  ;D ;D ;D

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: Westbranch on January 14, 2017, 12:03:23 PM
Tom are you able to access a couple of the previous owner bills  for comparing your total consumption to?  would let you know if the meter is working correctly...
FYI  there was a bad batch of meters up here that had to be replaced within months...
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on January 14, 2017, 12:27:41 PM
Quote from: Westbranch on January 14, 2017, 12:03:23 PM
Tom are you able to access a couple of the previous owner bills  for comparing your total consumption to?  would let you know if the meter is working correctly...
FYI  there was a bad batch of meters up here that had to be replaced within months...

I can get the utility usage going back before we got the place. We recently switched from a tank type gas water heater to  a demand electric water heater so that will skew any historic usage figures.  from July 2015 to July 2016 we averaged 16 KWH / day. Since we commissioned the SMA we have had generally had overcast, clouds and precipitation and no impressive full sun days and we have only used a net of 15.5 KWH/day which is less than what we used before the electric water heater for that year we averaged usage for.

So far the meter values appear to be accurate from direct observation and the radio  telemetry matches the display values.

One reason I want to keep electronic records is to be able to identify issues with metering.

All part of the fun being the first to do it on this utility.

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on January 14, 2017, 01:34:38 PM
What frequency do you receive that at ?

Larry
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: TomW on January 14, 2017, 03:27:14 PM
Quote from: ClassicCrazy on January 14, 2017, 01:34:38 PM
What frequency do you receive that at ?

Larry

Here is the info it pushes when you start rtlamr:

16:10:01.687832 decode.go:82: CenterFreq: 912600155
16:10:01.691712 decode.go:83: SampleRate: 2359296
16:10:01.692078 decode.go:84: DataRate: 32768
16:10:01.692200 decode.go:85: SymbolLength: 72
16:10:01.692302 decode.go:86: PreambleSymbols: 21
16:10:01.692501 decode.go:87: PreambleLength: 3024
16:10:01.692617 decode.go:88: PacketSymbols: 96
16:10:01.692719 decode.go:89: PacketLength: 13824

Thats all I know. Looks like 912 Mhz? All the docs I looked at showed the meter radios using the 900Mhz band.

rtl_tcp identifies the dongle as:

Using device 0: Generic RTL2832U OEM

I got this dongle on an Amazon lightning deal for $12 delivered. Should have got 3 or 4 but wasn't sure on support in Linux

https://www.amazon.com/gp/product/B0129EBDS2/ref=oh_aui_search_detailpage?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B0129EBDS2/ref=oh_aui_search_detailpage?ie=UTF8&psc=1)


I had some unused wireless IP camera antennas and used one for the dongle which comes with no antenna.

Tom
Title: Re: Use Cubietruck and Software defined Radio [RTL-SDR] to read smart meter.
Post by: ClassicCrazy on January 14, 2017, 08:00:06 PM
12 bucks was a good deal . I would have gotten one for that price.
I have an older SDR but it doesn't have the SMA connector - has a different smaller one - but wasn't too much problem because I just removed the supplied antenna and used the coax on there to make my own adapter.

I recently got an HF SDR kit .  Got it all put together except for the last two connnections - tiny wires from that were wound around a ferrite  about the size of a hair that needed to be soldered onto two pins of a surface mount chip that were so close together . I tried everything in my resources - doubled magnifying glasses but just could not get it . Even have a very fine pointed solder iron but my magnifiers were so close I couldn't get the solder iron in there and hold the wire at the same time. So I just shipped it off to a friend who has better skills and a nice stereo magnifying scope.

Larry