Author Topic: New beta version of "listener" and "parser" for ipwx  (Read 3452 times)

0 Members and 1 Guest are viewing this topic.

Offline nincehelser

  • Forecaster
  • *****
  • Posts: 3337
New beta version of "listener" and "parser" for ipwx
« on: March 25, 2015, 06:09:32 PM »
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:

Code: [Select]
mkdir ipwxLite

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

Code: [Select]
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.

Code: [Select]
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.

Code: [Select]
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.

Code: [Select]
./listener | ./parser


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:

Code: [Select]
$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

Code: [Select]
./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.

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: New beta version of "listener" and "parser" for ipwx
« Reply #1 on: March 25, 2015, 07:07:14 PM »
Neat!  Thanks for sharing.  And an excellent write-up BTW.
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline Inverno

  • Senior Contributor
  • ****
  • Posts: 228
Re: New beta version of "listener" and "parser" for ipwx
« Reply #2 on: March 25, 2015, 08:55:01 PM »
Great stuff thanks. Any chance to make the upload time to WU any value you want greater than 18 seconds?

Offline geofb13

  • Contributor
  • ***
  • Posts: 131
Re: New beta version of "listener" and "parser" for ipwx
« Reply #3 on: March 25, 2015, 08:59:12 PM »
Thanks for sharing, I'm going to look over it some this week and hopefully run a test or two with some data this weekend.

Offline nincehelser

  • Forecaster
  • *****
  • Posts: 3337
Re: New beta version of "listener" and "parser" for ipwx
« Reply #4 on: March 25, 2015, 09:19:30 PM »
Great stuff thanks. Any chance to make the upload time to WU any value you want greater than 18 seconds?

I wasn't planning on taking it that far.  Something like that is probably better handled by weewx, which I have set to 1 minute, but is adjustable to longer reporting intervals.

I imagine it could be scripted by pushing the "rapid fire" readings into an array, then computing an appropriate value to send when the reporting time comes due.  Kind of like I'm doing with the wind gust array to keep track of the highest wind speed in the last 10 minutes, or the amount of rain that has fallen in the last hour.

Offline mikez104

  • Member
  • *
  • Posts: 41
Re: New beta version of "listener" and "parser" for ipwx
« Reply #5 on: April 25, 2015, 02:00:43 PM »
Will this still work to hand off info to weewx?

Offline nincehelser

  • Forecaster
  • *****
  • Posts: 3337
Re: New beta version of "listener" and "parser" for ipwx
« Reply #6 on: April 25, 2015, 02:41:59 PM »
Will this still work to hand off info to weewx?

Yes, but you would have to un-comment those lines.  I commented them so they wouldn't interfere with an already-running version.