Rough draft of Raspberry Pi - AcuLink Bridge Instructions Available

  • 6
  • Idea
  • Updated 4 weeks ago
The instructions are only about half-finished. There's enough code there to extract human-readable weather readings, though. Hopefully the code didn't get munged when I converted it to a web page.

Comments and assistance to add features and improve things welcome.

http://nincehelser.com/ipwx
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes

Posted 5 years ago

  • 6
Photo of Jack Bowman

Jack Bowman

  • 95 Posts
  • 12 Reply Likes
Thank you George! This looks like a great project.
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
Thanks. I'm hoping some other coders will step up and help add some additional functionality. There's too much I'd like to see it do and too little time.

For example, I'd like to see some "diagnostics" that help gauge bridge and sensor performance. For example, it would be interesting to graph the RSSI value of the sensors against the other weather parameters. It might tell us if seasonal things like foliage and heavy rain are having impact on the radio signal. Or maybe it will just help pin down interference that comes and goes.

I'd also like to keep track of the data packets coming from each sensor and send an alert if expected packets are missing from a particular sensor. That could also help pinpoint problems.

It would also be interesting to see if the 3-sensor "limit" for the bridge can be broken. I think it can, but the problem might be figuring out which sensor is which. For example, if you had 5 tower sensors around your property, is there a way to tell them apart in the data? I've no idea right now.

An XML feed is also something I'd like to add. I'm not sure yet what data I should include and how to structure it at the moment. If anyone has ideas, please speak up!
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George......I have recently set up another Pi bridge at my son's cabin in Wyoming, just under 10,000 ft.  His Acurite equipment is of the same vintage as my setup in France.  All is working fine, except the pressure data is off by about 20%, reporting around 800 hPa instead of my expectation of a number around 1000.  The MBW site is reporting a more correct number, 1016 hPa.  I've checked my Python code against your Perl code, as I archived it 11 months ago, and do not find any typo's. 

By the way, my unit in France (just above sea level) is reporting values that match with MBW.  Also I checked here with another Acurite Bridge at lower altitude (7000 ft) and got similar results, off by 20%.

Any ideas?....RDK

(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George.....I posted two different comments to this thread, but the second was just an observation and did not need a reply.  The more important post (above) did not show up in the "recent posting list" when one gets into this forum, and thus was easily missed.  I'm quite interested in your thoughts on the above subject.

Do you have a reference to the algorithm you used in your script for the pressure calculation?

....RDK

Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
Those equations get you the absolute pressure.  In my code I added  a fixed adjustment for my location to adjust to sea level.  You would have to adjust that for each of your locations.  Could that be what is throwing you off?
(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George....thanks for the info. I will take the MBW value and determine the "fudge factor" to correct the cabin numbers. And, thanks for the reference for calculation...RDK
Photo of Bob Paauwe

Bob Paauwe

  • 50 Posts
  • 5 Reply Likes
Great job George!

What you wrote up seems like it would be easy to follow and get something working right away.
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
Thanks!

It should get even easier soon.

Once I finish up with this write-up, I plan to make a working image of the installation available for download. That way you can just copy it to an SD card, boot up your Pi, and you'll be in business. Obviously there will be a few configuration changes to make for Weewx and Wunderground reporting, but they will be minimal...basically location and time zone info and wunderground account information.
Photo of Phil Reese

Phil Reese

  • 3 Posts
  • 0 Reply Likes
George,
I'm not a programmer so can't really help you with all the cool thinks you've outlined that you'd like to do.  Wish I could, as the info would be interesting to explore.

Any update on your 'part 3' or info on the SD card you suggest?

Just hoping to get the rain info to show up in WeatherUnderground.

Thanks for your hard work, it is appreciated!

Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
Wow.  It's been 5 months?  So much for procrastination.

I thought I had published the needed weewx driver file, but it looks like it didn't take.  I'll at least get that part re-published this weekend.
Photo of Phil Reese

Phil Reese

  • 3 Posts
  • 0 Reply Likes
That would really make my rainy California weekend!
Thanks!
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
OK.  The new "simulator.py" code is up there.  Basically that replaces the existing "simulator.py" code in the weewx distribution.  

Now I just need to describe the details of getting the listener and parser going at startup, then starting weewx.  I'll try to do that this week.

Most of the rest is just standard weewx operation.  You can refer to the standard weewx docs for setting up reporting to various services like wunderground, but eventually I'll write some instructions for that, too.
Photo of Phil Reese

Phil Reese

  • 3 Posts
  • 0 Reply Likes
George,

Success!  I've got it working in my test setup at home and will go live with it tomorrow at the office.

I didn't appreciate that 'listener' and 'parser' would be so fundamental.

Thanks very much for responding over the weekend!




Photo of Brock Nanson

Brock Nanson

  • 20 Posts
  • 6 Reply Likes
I stumbled on this thread while looking for an answer to why my rainfall rate is always showing zero (1055 system with Acu-Link).  I learned there are a whole pile of reasons, none of which seem to be technical obstacles, but obstacles of will.  Clearly if I want useful information from my system, I'll have to go to a solution such as what you've built and described here!  Building crude IDF curves for example requires solid information as to how long a storm lasted and how hard it rained.

I'm not a programmer, but pretty comfortable working in the Linux environment, especially server CLI.  This project looks like it would be fun to try!  However, before ordering up a Raspberry Pi, it occurred to me that the Western Digital MyBookWorld I hacked to allow root access a few years back might also serve the purpose.  The trick is likely sniffing the data with the software bridge you configured.  Whether I can get a USB dongle to play nicely will be the critical trick.  I might play with that a little first.

It also made me ponder whether something like DD-WRT (wireless router firmware replacements) might allow a router to be be used as the sniffing bridge, and also allow more convenient placement of the Acu-Link Internet Bridge by virtue of the wireless capability.  But there isn't much ability for those things to store data and hacking them to share the data would be more of a challenge.  So given my technical level, the Western Digital NAS device might be the right place for me to start.

Your comment about XML is also interesting and might be the start of something useful too... I run my own webserver remotely and XML could have some uses.
Photo of tandy1000

tandy1000

  • 37 Posts
  • 3 Reply Likes
I'm using Tomato firmware on my router and doing the sniffing as you describe, and storing all the data in another program. Some details are in my post here: http://www.wxforum.net/index.php?topi...
Photo of Brock Nanson

Brock Nanson

  • 20 Posts
  • 6 Reply Likes
Ah, Tomato, yeah that would be a parallel project to dd-wrt.  If you've managed it, there is evidently enough functionality in the stripped down linux used... so I guess I'd better see about hacking one of my old routers with Tomato!  The link is also useful - thanks again!
Photo of bstrand42

bstrand42

  • 2 Posts
  • 1 Reply Like
I'm attacking this problem from another angle.  I'm working on a Mac program to read the sensor data directly off the USB port of the "head" unit that talks to the 5-in-1 sensor.  I'm far enough along to be able to get the data stream, which appears to update every 18 seconds or so.  I'm getting data like this (hex, of course)

01 c9 e2 78 00 37 5c 32 03 ff

02 00 00 59 3d 0f 9c 01 41 02 ac 8d 20 18 26 09 c4 07 1b 06 09 8b 4c 8c c4


The challenge is parsing this.  Does anyone have an interface spec?


Brad

Photo of George D. Nincehelser

George D. Nincehelser

  • 5731 Posts
  • 1070 Reply Likes
I haven't tried this myself, but it's a USB driver for weewx Matt Wall  recently posted.  I expect it would work just fine under MacOS.  

Looks promising!


https://svn.code.sf.net/p/weewx/code/trunk/bin/weewx/drivers/acurite.py
(Edited)
Photo of bstrand42

bstrand42

  • 2 Posts
  • 1 Reply Like
Very, very helpful...thanks!!!
Photo of Jack Bowman

Jack Bowman

  • 11 Posts
  • 1 Reply Like
This is a great thread! Lot's of good information flowing. Looks like a new project is on the horizon for me. I want to put up another weather station in another location, and need to be able to keep it small in size, and administer it remotely. Can I access the Raspberry PI remotely for maintenance, and tweaking the code? (OPENSSH)
Photo of Jerry Bixman

Jerry Bixman

  • 49 Posts
  • 2 Reply Likes
Don't know why not, I use my Pi headless without monitor,keyboard or mouse wireless from my desktop.

Photo of George D. Nincehelser

George D. Nincehelser

  • 5731 Posts
  • 1070 Reply Likes
If it's in a distant location you'll have to either get a static public IP, use a dynamic DNS solution, or have the Pi figure out the external IP and mail it to you occasionally or when it detects a change.

And, of course, you would have to make the appropriate entries in your router or firewall.
Photo of George D. Nincehelser

George D. Nincehelser

  • 6684 Posts
  • 1236 Reply Likes
FYI - I have a new beta version of "listener" and "parser" available with Wunderground "rapid-fire" rolled in.  For now I'm calling it "ipwxLite".

Personally I prefer weewx for reporting to wunderground and other services, but a few weeks ago someone asked if a simpler reporting script could be developed as they didn't want the advanced features of weewx provides...they just wanted fast reporting to wunderground and nothing else. (i.e. no graphs, no web pages, no local database, etc. )

Here it is, presented simply for educational and experimental purposes.  It's intended for use on a Raspberry Pi, but the scripts themselves should work fine on any system with tcpdump and perl and a little coaxing.

I'll eventually roll these into the next re-write of ipwx.   For the purposes of this beta, I've disabled the writing of the weewx data file.  If you have no intention of running weewx, this won't matter.  I've done this so you can run this alongside your original ipwx installation without creating conflicts.

The following instructions assume you have already set up your Rasberry Pi with a "bridged" network connection as per http://nincehelser.com/ipwx  and you are logged into a terminal session on your Rasberry Pi.

1. Create a new folder for ipwxLite:

mkdir ipwxLite


2. Change your current directory to that of ipwxLite with the cd command.

cd ipwxLite


3. Grab the "listener" and "parser" files directly from my server (no more cut/paste!) using the wget command.  As they are simple text files, you can view or alter them as needed.

wget http://nincehelser.com/ipwxcode/listener 
wget http://nincehelser.com/ipwxcode/parser

4. Change the permissions on the files so that they are "executable" code.

chmod +x listener
chmod +x parser

5. Run the files using the following line.  After about 18 seconds, you should start seeing some weather data on your screen.   (Be aware that your account must have "sudo" permission.  Press "ctrl-c" to quit the scripts.

./listener | ./parser

You'll see a screen looking something like this:


Note that this is not yet reporting to wunderground...it's just to show you things are set up OK.  The top part of the screen is the actual data intercepted from the Acurite Bridge, the middle section is human-readable weather data for debug purposes, and the last part is the data as it will be assembled for transmission to wundergroudn.

To make this actually report to wunderground, you need to edit the "parser" file with the following information:

$wunderEnable = "ON";
$wunderID = "YOURSTATIONID";
$wunderPASS = "xxxxxxxx";

(I didn't account for highly-complex passwords.  If you have special characters in your password, they may need to be "escaped".  Also, I think your station ID needs to be all caps, but I haven't tested that.)

You might also want to set the variable $baro_adjust to a value appropriate for your location.  It's expressed in mmHg.  

Save the file and restart

./listener | ./parser

If all goes well, you should see your station ID and password in the lower portion of your screen showing the data to be sent to wunderground.  If wunderground accepts your data, you'll see a "success" notice at the bottom.

New data will go to wunderground as new information is received from the bridge...typically this will be every 18 seconds with a 5n1.  Barometer information is sent every minute.  The script has provisions for reading the temp and humidity from a tower sensor.  I'm sending that temp data to wunderground as "soiltemp" just for fun.  (I haven't figured out how to graph multiple temp sensors on wunderground or if it is even possible, even though the protocol specs allow you to send such data)

Let me know if you have any problems or something isn't clear.
Photo of Jerry Bixman

Jerry Bixman

  • 49 Posts
  • 2 Reply Likes
Hi George, new ipwxLite is working and reporting to WU.  WU occasionally displaying wind direction no humidity
KUTPAROW2
Photo of Jerry Bixman

Jerry Bixman

  • 49 Posts
  • 2 Reply Likes
Update, it is all reporting now I guess it needed to run for a while
Photo of Jerry Bixman

Jerry Bixman

  • 49 Posts
  • 2 Reply Likes
Thank you George for your great work, still have not been able to get weewx working on my RPi but this will make me happy for a while.
Photo of Jerry Bixman

Jerry Bixman

  • 49 Posts
  • 2 Reply Likes
Hi George I have been using ipwxLite Beta for about 3 days now.  I have a 5n1 and 2 tower sensors.  One of the tower sensors is showing up correctly on WU as Soil Temp but not being passed to MBW.  MBW indicates no signal from that sensor.
Photo of George D. Nincehelser

George D. Nincehelser

  • 5840 Posts
  • 1098 Reply Likes
The current local time is sent in the responses that come back from the myAcurite servers.

The Acurite servers typically respond with a string like this each time data is sent.

{"localtime":"22:44:02","checkversion":"224"}

There are other "name":"data" pairs used for things like setting your wunderground settings, but those are only sent on an as-needed basis.

Other things thing might cause the rain counters to reset are a power or network glitch that causes the SmartHUB to reset internally.   Some people seem to have more trouble with this than others.  I used to have problems with a particular SmartHUB, but once I put it on a UPS the issue went away.  (I had it on a surge-protection-only outlet by mistake)
Photo of RDK

RDK

  • 162 Posts
  • 4 Reply Likes
George....OK, mine, Pi's and SmartHub's, are all on UPS's.  I know of one reset on Thursday.  We got about 1.5" of rain between 4 AM and 6 AM (Yes it was pouring), according to the Dashboard.  Then that evening after on and off rain all day I checked the Dashboard again and it was about zero. 

Friday I downloaded the data and it was all zeros until prior to about 10 PM.  However, the data being collected by my Pi was complete.  Weather Underground's graph showed about 2" prior to 9 PM and then went to zero and started over. At midnight it was about 1".  The sum of them was about what my Pi recorded.

Oh well, I will look into monitoring the replies from AcuRite so I can better anticipate the "midnight-local" resets.  Thanks for the info.....RDK
(Edited)
Photo of RDK

RDK

  • 162 Posts
  • 4 Reply Likes
George....OK, now that I have TCPFlow working, I have setup a program to monitor the traffic from and to one of my smartHUB's.  I see three types of records:

  a. GET /weatherstation/updateweatherstation?dateutc=now&action=updateraw&realtime=1&id=24CxxxxxxDCD&mt=tower&sensor=000nnnnn&humidity=86&tempf=42.7&baromin=30.11&battery=normal&rssi=1 HTTP/1.1

  b. {"localtime":"09:52:56","checkversion":"224"}GET /weatherstation/updateweatherstation?dateutc=now&action=updateraw&realtime=1&id=24CxxxxxxDCD&mt=tower&sensor=000mmmmm&humidity=88&tempf=37.4&baromin=30.11&battery=normal&rssi=2 HTTP/1.1

  c. {"localtime":"09:57:41","checkversion":"224"}

Based on your previous comments, I was expecting the first and last types, but was not expecting the second and that is the one which is seen about 90% of the time.

I'm going to try to get my monitoring program modified and tested before our next rainy period so I can track and identify the "localtime" records which correspond to bridge resets, especially those which occur at times other than midnight.

Any thoughts?.....RDK
Photo of George D. Nincehelser

George D. Nincehelser

  • 5840 Posts
  • 1098 Reply Likes
The second one (b) you have the server response from the previous request and the next data message run together.

It's actually like this:

(server response from previous GET) {"localtime":"09:52:56","checkversion":"224"}

(next GET) GET /weatherstation/updateweatherstation?dateutc=now&action=updateraw&realtime=1&id=24CxxxxxxDCD&mt=tower&sensor=000mmmmm&humidity=88&tempf=37.4&baromin=30.11&battery=normal&rssi=2

HTTP/1.1

Everything in curly braces "{ }" is a server response to a GET statement.

The GET statements are from a tower sensor (mt=tower).  For rain data you'll want to look for strings with the 5n1 model type (mt=5n1 if I remember correctly)

Remember there will be two kinds of GET for a 5n1.  Rain data will be in every other one.

If you have wunderground activated, you'll also see a GET that looks similar going to wunderground, but it will include your wunderground station ID and password/key.
Photo of RDK

RDK

  • 162 Posts
  • 4 Reply Likes
Thanks.  That makes sense......RDK
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George....Long time ago I seem to recall that you used a Wi-Fi dongle with your Raspberry Pi Bridge project.  I have been using two wired Ethernet connections for mine, but now I need to set up one with a Wi-Fi dongle and a wired connector.  The Raspberry Pi does not seem to like that idea.  Can you tell me how  you did your Network/interfaces file with the Wi-Fi?

Thanks....RDK
Photo of George D. Nincehelser

George D. Nincehelser

  • 6533 Posts
  • 1211 Reply Likes
I wouldn't go that far, especially when I can bridge with an original Pi works with no problems.   The problem is simply identifying what changes have occurred between now and then.  I can specifically say that Acurite has nothing do to with this.    

Unfortunately, the Raspberry Pi folks are not completely transparent on what changes they have made to the kernel.  They hold it back as propriety,  so that make things more difficult.
(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George...Can you share your configuration files (ie Interfaces, etc) with me so Ican at least get the bridge going without system errors?

This reference (http://blog.slor.net/2013/09/turning-your-raspberri-pi-into-wireless.html) seems to be right on target, but later comments indicate that his procedure is now failing.....RDK
Photo of George D. Nincehelser

George D. Nincehelser

  • 6533 Posts
  • 1211 Reply Likes
I'm currently just bringing the bridge up manually using brctl commands.  On my system they bring no objection.  On the other hand, I've updated my Pi's  firmware to to the latest version and I'm not clear what impact that may have had .   The last time I can remember seeing the error you are getting was with factory-fresh new Pi 2 firmware,  so that might be part of the equation. 

Off the cuff, I can't see a problem with his method.  However, it seems pretty clear that some changes have been made that the Pi folks aren't yet owning up to, or they don't realize it has caused a problem.  I can understand that they might have turned off the functionality in the kernel because packet fragmentation isn't accounted for, but on the other hand, simple applications like this it doesn't really matter.  The Aculink gear just isn't putting out packets large enough to be fragmented.

Bottom line: This problem is tractable.  It's just a matter of finding who did what to change the the behavior.  From everything I've read, people seem to be dancing around the problem, but have yet to find the real cause.  

Clearly you could address this issue at a higher level, but I'd really like to figure out the original change that suddenly caused everything to become difficult.  After that I will nail those responsible to a tree! ;)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George...I like your attitude. :-)

What are your BRCTL commands?

....RDK
(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George....As you may recall I have setup a system similar to yours, except rather than Perl I'm using Python.  All has been working just fine for the past 6 months.  The last Saturday we got our first frost
and my program threw an error as I seemed to have found a new sensor

xxxxxxxxEDD&sensor=00286&mt=water&temperature=A000000000&battery=normal&rssi=49jSV

I have a 5-in-1, a 3-in-1 and several towers which are being monitored with my Pi.  I do not have a "water" sensor and I doubt if I'm getting any signals from my neighbors as they are too far away.
The only explanations I can come up with are that one of my sensors has alternate, undocumented (??) "frost alarm" feature or the Acurite Bridge is listening to one of my old Oregon temperature sensors.  When I look at the Acurite Bridge web page I only see the above Acurite sensors.

The program failed on two successive nights, exactly when the outside temperature reached freezing and the Pi got the above record via the bridge.  I have now fixed the program, but am curious.

Any thoughts?......RDK
(Edited)
Photo of George D. Nincehelser

George D. Nincehelser

  • 6533 Posts
  • 1211 Reply Likes
I'd suspect the Oregon temp sensor.

I'm not sure why your python code would crash when that hit zero, though.  I'm guessing the zero condition is causing one of your formulas to crash, or maybe it is being interpreted as an incorrect type?  It's hard to say without knowing what the error message is.
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George....I guess I did not make myself clear.  I agree the crash was a programming issue which would have happened regardless of the language - PERL or Python. It is now fixed.  

My question was regarding the appearance of the "new" sensor record.  I don't have a "Water" sensor or any sensor which has a code of "00286".  I'm curious as to where it is coming from and whether or not it is a "feature" of one of my sensors which detects and triggers the above record for an alert  when the temperature reaches 0 C?

It can not be a neighbor's sensor, they are way too far away.

Thanks....RDK
Photo of George D. Nincehelser

George D. Nincehelser

  • 6533 Posts
  • 1211 Reply Likes
It's probably your Oregon Scientific sensor.  They operate at the same frequency, and likely share some technological heritage.  The bridge is just misinterpreting the data packet from the OS sensor as an Acurite device under certain conditions.
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George....Ah,  I suspected something like that.  OK, thanks....RDK
Photo of Vern M.

Vern M.

  • 135 Posts
  • 4 Reply Likes
FYI. The new Pi Zero is only $5 at Micro Center.
http://www.microcenter.com/product/45...
Photo of George D. Nincehelser

George D. Nincehelser

  • 6486 Posts
  • 1204 Reply Likes
Was just reading about that.

The frustrating thing is lack of a network port and no full-size USB ports.  You'd have to add a USB hub and a couple of network dongles for this project.  

Still, it's  only $5.  
Photo of Vern M.

Vern M.

  • 135 Posts
  • 4 Reply Likes
George, with these needed items, would the cost be the same as the regular Pi?
Photo of George D. Nincehelser

George D. Nincehelser

  • 6486 Posts
  • 1204 Reply Likes
You'd be getting awfully close.  It doesn't look like much of a "money-saver".  It may be more of a power and space saver.

I'd estimate $10 for a USB hub You'd have to get one with a micro-USB connector or adapter.  It might need to be powered, too.

Then add another $10 per network dongle.

If you're using the micro-HDMI, you'll also need the right cable or adapter.

For general use, I think most people would be better served by a regular Pi.  The Pi Zero looks more attractive for projects where you want to embed some intelligence in a project at very low cost.

It's too bad they didn't add built-in WiFi.   That would be make it  a more general-purpose system. 
Photo of Robert Watson

Robert Watson

  • 62 Posts
  • 10 Reply Likes
This is fantastic of course....I have tried an alternate method of pulling the data with some degree of success...one feature I would love to be able to figure out is how to measure proper wind gusts....it seems as though the anemometer is a pulsed counter with balanced magnets on opposite poles such it counts how many passes the magnets make every 18 seconds, and determines wind speed based on the total number of passes - The obvious first concern is is the unit is only sending data every 18 seconds, then that's the ball game - but I wonder if there is a way to have it go into a "manual count" type mode - something like this -  For math sake and ONLY as a comparison  - let's say the device calculates 100 rotations in 18 seconds for 10 mph wind.  (and 200 rotations for 20mph wind, 50 rotations for 5mph wind etc...)  So a "gust" of consequence could be anything above 20mph...so if for instance, it counted to 200 in less than 18 seconds, it could switch the divisor from 18 to the total seconds count effectively giving you a wind gust.  The obviously downfall would be if the calculations happened on the tail end of the 18 second loop, then it woudln't measure the gust at all...
And again, if there's no way to get data faster than the 18 seconds, that ends the conversation. And with the 18 seconds, that's what gives the device such long battery life (in addition to the solar panel on top - but I'm coming up on 2 years without replacing the lithiums right now and the station is showing about 40% still). But there could be a scenario where that could be "upped" - to measure the gusts - I'd certainly sacrifice having to change the batteries a little more often if it meant I could get even remotely accurate wind gust measurements.    In this recent wind storm, I was getting high wind alarms all the time - but they were maxing out at 24mph.....problem is when I use a pulse anemometer to measure gusts, I was getting readings in the 40mph range over 2-3 seconds...something that the 5 in 1 currently cannot compensate for.
 
Photo of George D. Nincehelser

George D. Nincehelser

  • 6480 Posts
  • 1202 Reply Likes
18 seconds it the reporting rate, not the sampling rate.

Wind speeds are sampled over a 4-second window.

There are various definitions of "gusts", but the WMO (World Meteorological Organization)  has a particular definition for these sorts of devices, but specifies a 3-second window.   So Acurite misses the mark by one second for gusts.
(Edited)
Photo of Robert Watson

Robert Watson

  • 62 Posts
  • 10 Reply Likes
Ok - so now we are talking - I wasn't aware of the 4 second sample -  It seems tho that there still is no "gust" definition in the default bridge...  And by the way - I certainly didn't mean any disrespect with my comments - looking at your code It's wonderful and very much appreciated...
Photo of George D. Nincehelser

George D. Nincehelser

  • 6480 Posts
  • 1202 Reply Likes
Correct.  There is no "gust" as the hardware doesn't  sample fast enough to meet common definitions.  Acurite doesn't claim to measure "gust".  

Different software packages often calculate gusts using their own preferred method, so they often don't match up.  Places like wunderground just take whatever your software says a "gust" is.
Photo of Robert Watson

Robert Watson

  • 62 Posts
  • 10 Reply Likes
Yup and that's the point I was looking to try and emulate or process....
Photo of George D. Nincehelser

George D. Nincehelser

  • 6480 Posts
  • 1202 Reply Likes
Some simply take the fastest speed recorded over the past 6 minutes.

Others take into account the average wind speed and only report a gust if the top speed exceeds a specified amount over that average.  Still others go further and start considering changes of wind direction.
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George......I've been using your technique for capturing the Acurite data from the Acurite Internet Bridge for almost a year now, as I think you know. 

Today's server outage was a real eye-opener for me as I did not realize, that the functions of the bridge, depended on it have full contact with the Acurite servers.  IE, the Internet bridge does not function "at all" if it loses Internet connection.

Has anyone found a way (hardware and software) to monitor the Acurite sensors independently of the Acurite Internet Bridge and the Internet.  I think I have heard of some PC applications, but they would require the PC to be running 24x7.  I wonder if there is something using a Raspberry Pi?

Thanks for any thoughts.....RDK

Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

OK, I need to research this a bit. 

But first, just to make sure we are on the same wavelength, I'm talking about the "Acurite Internet Bridge" and not my Raspberry Pi bridge.  It seems apparent that the "Acurite Internet Bridge" stops functioning (ie receiving/processing a sensor reading and then posting it to MBW) when it cannot connect to the Acurite servers. 

If I understand your reply, the "Acurite Internet Bridge" is just waiting for an acknowledgement that the previous record has been received and until that happens it stops.

Anyway, thanks and happy holidays....RDK

Photo of George D. Nincehelser

George D. Nincehelser

  • 6533 Posts
  • 1211 Reply Likes
Yes.  It seems that if the Acurite Bridge doesn't hear back occasionally from MBW, it will go into a reboot cycle in an attempt to re-establish the connection.

It's not waiting for an acknowledgment of the previous record sent, though.  It seems more like if it hasn't heard anything back from MBW for some time period, it will reboot.  What that time period is I haven't figured out.  
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

OK, thanks.  I'll work on this and let you know.

By the way, I'm very happy with my Python version of your code to process the Acurite Internet Bridge records.  I'm posting the results for all 5 sensors to a database on my website.  I then can access the data for plots and analysis.  WU and MBW are also there if/when I need them.

As a retired scientist, I have to have my regular dose of data to analyze. :-) ....RDK

Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George....I have done some research.  I will be sending you an e-mail with the data and my interpretation.  Am interested in your thoughts.....RDK

(Edited)
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George......Well, I tried to set up Squid as  proxy server, but did not think the system was stable enough to leave it running like that while I was off travelling to the USA.

That was unfortunate as, while gone, we had a wind storm which knocked out telephone and internet for 5 days.  All that data was lost, grr.

I'll be back to this project in a couple weeks.....RDK

Photo of Adam Cohrs

Adam Cohrs

  • 1 Post
  • 0 Reply Likes
I can't get my pi to get data. I'm running a wireless dongle and using the on board ethernet port to connect to the bridge.
(Edited)
Photo of RDK

RDK

  • 182 Posts
  • 6 Reply Likes
There have been lots of posts on the web for folks trying to set up a wireless bridge.  I'm not sure anyone has been successful, or at least with as simple of a setup as the wired setup George suggests.  Seems like it worked several versions back from the Raspbian distribution currently available.  I have tried without success. But I have not yet given up, maybe I'll get back to it one of these days...RDK
Photo of RDK

RDK

  • 182 Posts
  • 6 Reply Likes
I just ran across this thread on the Raspberry Pi forum (https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=17702&start=50).  Go to the last couple entries where "pathead" details how he got it to work on a Jessie installation of Raspbian. I have not tried it.  If  you do, let me know how you make out....RDK
Photo of Jeffrey Love

Jeffrey Love

  • 3 Posts
  • 0 Reply Likes
I had been running George's IPWX software on my Pi until I decided to take a look at the new MyAcurite. After seeing a lack of gust reporting and having had a server outage drop my connection to Wunderground, I'd like to go back to the simplicity of the Pi solution. However, with 224 now on the bridge, the Listener script only seems to display a truncated version of data:

&id=<my bridge's MAC address>&mt=5N1x31&sensor=00002236

Occasionally, there will be an additional character at the end of that string, but mainly the data stream is just the above.

Gven my ignorance on how this system works and having basically just run IPWX without a solid understanding of the back end, I'm stuck here.

There is an above thread within this thread between George and RDK. Do either of you have a working setup for the current bridge firmware that I might lean on you to provide me?

"If it ain't broke..."

Thanks for any thoughts!
Photo of Bob Paauwe

Bob Paauwe

  • 50 Posts
  • 5 Reply Likes
I am using a version built from the github source.  The latest tag I see in my clone is 'tcpflow-1.4.5' but I built from the head of master, looks like from Sept. 27th, 2016

Looks like there's been a few documentation fixes and a couple of code fixes since then so I would expect the latest code to work just fine.  
Photo of RDK

RDK

  • 182 Posts
  • 6 Reply Likes
Bob...Thanks.  Do you know what the zero option is supposed to do?  So far I don't find it in any web references.

I've installed the latest version from the GitHub and the man page says version 1.4.6.  Seems to work with my code and your command line test.

Thanks again....RDK
Photo of Bob Paauwe

Bob Paauwe

  • 50 Posts
  • 5 Reply Likes
The -0 simply removes the newline from the printed packets that are being output. Since we're trying to parse the packets, newlines in the middle just make the parsing more complicated.  If you are just looking at the output, the newlines would make it more readable.

It should have a brief description of all the options if you run 'tcpflow --help'
Photo of RDK

RDK

  • 182 Posts
  • 6 Reply Likes
Bob.....OK, I looked at the web and from my Pi the "man tcpflow" command, so far I have not found any references to the zero option.  I'll try the "tcpflow --help" when I get back to the Pi.

Thanks again.....RDK
Photo of George D. Nincehelser

George D. Nincehelser

  • 6486 Posts
  • 1204 Reply Likes
My memory is hazy on this, but I think it formats the output to the console better, specifically with regards to line breaks.
Photo of Andrew C Watson

Andrew C Watson

  • 2 Posts
  • 0 Reply Likes
Hello, I've been looking into connecting via the Pi. I do not have the Acurite internet bridge and want to connect using my 02032-RX receiver/display. I have successfully connected it via my laptop to Weather Underground and My Acurite so I know that works. Is there anything that would prevent my using the above instructions with my new Pi to make a 24 hr on connection?
Photo of George D. Nincehelser

George D. Nincehelser

  • 5731 Posts
  • 1070 Reply Likes
The instructions are way out-of-date and are not updated for the new protocol. 

However, using a Pi and a current version of weewx (weewx.com) you could do what you want with your display.
Photo of Andrew C Watson

Andrew C Watson

  • 2 Posts
  • 0 Reply Likes
Thank you very much!
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes

George....I just finished a Jessie setup like my Wheezy setup for monitoring my Acurite smartHUB.  Both are running on Pi B+'s.  Both seem to be running ok. 

However, it seems that with Jessie one is supposed to not do everything in the "Interfaces" file, but also to make changes to the "dhcpd.conf" file.   I just looked at the MAN file for that and am seriously confused.  Could you comment or share your "dhcpd.conf" file?

Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
George and Bob.....Have either of you looked at the Data packet from the new Access unit to see it we can continue to capture data from multiple sensor as it is being sent to the Acurite servers?  Like you, I have several Pi setups which are "happily" collecting data from the smartHUBs as they are  sending that data to the Acruite servers.  I'm squirreling that data in local databases for MY use.  If this new Access completely breaks my Pi capture systems I'm not going to be a "happy camper".....RDK
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
Jason.....Returning to a post you made about 2 months ago after I got the this error message: 
2018-03-10 21:04:26 Acurite 5n1 sensor 0x011E Ch C, Status E2, Unknown message type 0x20

Your reply is shown below:
===
"Yes, that's the same message I was seeing for my rain gauge.  It was showing a message type of 0x30.  You can get the data from that device, but it will require some code adjustments to the rtl_433 source.  You would need to edit the file: src/devices/acurite.c.

Near the top of the file, you will see a comment that says "Acurite known message types", and it has values for 0x31 and 0x38.  Add another line like this:
#define ACURITE_MSGTYPE_3N1                    0x20

Now you need to move way down into the code (around line 559) where you find this "if" statement:
if (message_type == ACURITE_MSGTYPE_WINDSPEED_WINDDIR_RAINFALL) {
Look further down (around line 600), and you will see the statement continues:
} else if (message_type == ACURITE_MSGTYPE_WINDSPEED_TEMP_HUMIDITY) {
What you would need to do is add another "else if" for the new message type that you added earlier.  Add it before the final "} else {" line (which is where if gives the error for the unknown message type. "
===
OK, made the changes you suggested:
=============
near the top:
#define ACURITE_MSGTYPE_3N1                    0x20

and about 600 lines down, before the final } else {

            } else if (message_type == ACURITE_MSGTYPE_3N1)$
            // Wind speed, temperature and humidity
            wind_speed_kph = acurite_getWindSpeed_kph(bb[3], bb[4]);
            wind_speed_mph = kmph2mph(wind_speed_kph);
            tempf = acurite_getTemp(bb[4], bb[5]);
            tempc = fahrenheit2celsius(tempf);
            humidity = acurite_getHumidity(bb[6]);
            data = data_make(
                "time",         "",   DATA_STRING,    time_str,
                "model",        "",   DATA_STRING,    "Acurite 3n1 sensor",
                "sensor_id",    NULL,   DATA_FORMAT,    "0x%02X",   DATA_INT,  $
                "channel",      NULL,   DATA_STRING,    &channel_str,
                "sequence_num",  NULL,   DATA_INT,      sequence_num,
                "battery",      NULL,   DATA_STRING,    battery_low ? "OK" : "L$
                "message_type", NULL,   DATA_INT,       message_type,
                "wind_speed_mph",   "wind_speed",   DATA_FORMAT,    "%.1f mph",$
                "temperature_F",        "temperature",  DATA_FORMAT,    "%.1f F$
                "humidity",     NULL,   DATA_FORMAT,    "%d",   DATA_INT,   hum$
                NULL);
            data_acquired_handler(data);

=============
I ran the test command "sudo rtl_433 -R 40 -F json > test.txt" but still see the errors and no 3n1 record is test.txt file.

What am I doing wrong?  Am I missing another step? Compile or reinstall? Al the rest of my rtl-433 code I s working fine....RDK
Photo of RDK

RDK

  • 187 Posts
  • 6 Reply Likes
Jason.....Returning to a post you made about 2 months ago after I got the this error message: 
2018-03-10 21:04:26 Acurite 5n1 sensor 0x011E Ch C, Status E2, Unknown message type 0x20

Your reply is shown below:
===
"Yes, that's the same message I was seeing for my rain gauge.  It was showing a message type of 0x30.  You can get the data from that device, but it will require some code adjustments to the rtl_433 source.  You would need to edit the file: src/devices/acurite.c.

Near the top of the file, you will see a comment that says "Acurite known message types", and it has values for 0x31 and 0x38.  Add another line like this:
#define ACURITE_MSGTYPE_3N1                    0x20

Now you need to move way down into the code (around line 559) where you find this "if" statement:
if (message_type == ACURITE_MSGTYPE_WINDSPEED_WINDDIR_RAINFALL) {
Look further down (around line 600), and you will see the statement continues:
} else if (message_type == ACURITE_MSGTYPE_WINDSPEED_TEMP_HUMIDITY) {
What you would need to do is add another "else if" for the new message type that you added earlier.  Add it before the final "} else {" line (which is where if gives the error for the unknown message type. "
===
OK, made the changes you suggested:
=============
near the top:
#define ACURITE_MSGTYPE_3N1                    0x20

and about 600 lines down, before the final } else {

            } else if (message_type == ACURITE_MSGTYPE_3N1)$
            // Wind speed, temperature and humidity
            wind_speed_kph = acurite_getWindSpeed_kph(bb[3], bb[4]);
            wind_speed_mph = kmph2mph(wind_speed_kph);
            tempf = acurite_getTemp(bb[4], bb[5]);
            tempc = fahrenheit2celsius(tempf);
            humidity = acurite_getHumidity(bb[6]);
            data = data_make(
                "time",         "",   DATA_STRING,    time_str,
                "model",        "",   DATA_STRING,    "Acurite 3n1 sensor",
                "sensor_id",    NULL,   DATA_FORMAT,    "0x%02X",   DATA_INT,  $
                "channel",      NULL,   DATA_STRING,    &channel_str,
                "sequence_num",  NULL,   DATA_INT,      sequence_num,
                "battery",      NULL,   DATA_STRING,    battery_low ? "OK" : "L$
                "message_type", NULL,   DATA_INT,       message_type,
                "wind_speed_mph",   "wind_speed",   DATA_FORMAT,    "%.1f mph",$
                "temperature_F",        "temperature",  DATA_FORMAT,    "%.1f F$
                "humidity",     NULL,   DATA_FORMAT,    "%d",   DATA_INT,   hum$
                NULL);
            data_acquired_handler(data);

=============
I ran the test command "sudo rtl_433 -R 40 -F json > test.txt" but still see the errors and no 3n1 record is test.txt file.

What am I doing wrong?  Am I missing another step? Compile or reinstall? Al the rest of my rtl-433 code I s working fine....RDK
Photo of Whosit42

Whosit42

  • 13 Posts
  • 5 Reply Likes
George,
In the beginning of your writeup for 'ipwx' you discuss the usage of a Raspberry Pi with Ethernet in and out. That is what I want to do. Will the instructions you give at the beginning, i.e. the changes to '/etc/network/interfaces' and the install of 'bridge-utils' accomplish the basic setup the two Ethernet adapters?

I have a Pi 3 B+, a 32GB SD card, and an USB Ethernet dongle. Based on what some of the folks are running as the OS to use for Acuparse, I have installed the latest version of Rasperian Stretch Lite. I do not think that the distro used should have an effect on the initial hardware setup.

Thanks for you time.
Photo of Whosit42

Whosit42

  • 13 Posts
  • 5 Reply Likes
George,
In the beginning of your writeup for 'ipwx' you discuss the usage of a Raspberry Pi with Ethernet in and out. That is what I want to do. Will the instructions you give at the beginning, i.e. the changes to '/etc/network/interfaces' and the install of 'bridge-utils' accomplish the basic setup the two Ethernet adapters?

I have a Pi 3 B+, a 32GB SD card, and an USB Ethernet dongle. Based on what some of the folks are running as the OS to use for Acuparse, I have installed the latest version of Rasperian Stretch Lite. I do not think that the distro used should have an effect on the initial hardware setup.

Thanks for you time.
Photo of George D. Nincehelser

George D. Nincehelser

  • 6591 Posts
  • 1224 Reply Likes
That should still work fine.  Just remember those instructions are ancient. 

Differences in the distributions may require you to install other supporting packages, though.