Author Topic: Intercepting the data from 5-in-1 Bridge to AcuRite My Backyard Weather  (Read 3362 times)

0 Members and 1 Guest are viewing this topic.

Offline jems

  • Senior Member
  • **
  • Posts: 56
I was curious if anyone has any info on what the AcuRite My Backyard Weather has in place to receive the data from the 5-in-1 Bridges out there.  My goal is to redirect the data coming from the Bridge (via name resolution manipulation) such that it lands on my internal web server.  I've already accomplished this, but I'm not sure what type of "POST" the Bridge is sending.   Can it be captured with a simple perl CGI script?   Or do I need some kind of web object code?  I took a few stabs at intercepting it as if it were sent via standard POST, but couldn't see the data as I would expect.

I'm currently using some code to parse tcpdump data, written by nincehelser (thanks!).  It's working pretty good, but I'd like to dabble with the post data itself.

Any info would be great.

Thanks!

Offline tandy1000

  • Contributor
  • ***
  • Posts: 107
I think Wireshark has a POST dissector.. Is that something you've looked at? I can't say I know much about web protocols. But I'm using the packet capture method to get the data with success. I have ncat/ngrep running on my Tomato-firmware router, and a separate python script to decode, thanks to the work of others!

Offline Jack Bowman

  • Forecaster
  • *****
  • Posts: 305
  • Ambient Weather WS-2000
    • KCOFORTC421 - Hanna Farm
Here is a windows based solution...

http://kevin-key.blogspot.com/
Ambient Weather WS-2000 Weather Station

Home Weather Server:
http://kcofortc421.dynu.net/WD/wx.html

Weather Underground Link:
https://www.wunderground.com/dashboard/pws/KCOFORTC421

PWS Weather Link:
https://www.pwsweather.com/obs/KCOFORTC421.html

Offline jems

  • Senior Member
  • **
  • Posts: 56
Thanks for the reply!
However, this pretty much does the same thing I'm currently doing-- intercepting the packets, parsing, etc.

My goal is to actually let the Bridge POST directly to my internal web server by tricking it into thinking its posting to acu-rite.
I've already accomplished this by changing the host name on my Linux router such that the acu-rite web server resolves to my internal web server.  However, when the data arrives on my web server, I'm not sure how to actually process it.  I see the access in the logs, but standard perl CGI doesn't capture or see the value/pairs.

Make sense?

Thanks!

Offline nincehelser

  • Forecaster
  • *****
  • Posts: 3337
Yes.  That's another method of doing the same thing.  Just set up a web server to accept the posted values.  The problem is you then have to manipulate the values so that they make sense to the human eye.  That's a lot of what the "parser" does in my solution.

Probably the worst is calculating the barometric pressure.  It comes through in the post as 13 values or so.  You need to take all those values and run them through some math to get the absolute pressure.

Wind direction is also odd.  They used a non-standard Gray code for describing the wind direction, so probably the easiest way to interpret that is with a lookup table or a bunch of if-then or case statements.

Rainfall is pretty straightforward, but you have to be aware it's sending a number that represents how much rain fell in the last 36 seconds.  It's up to you to keep track of the total.

Humidity, temp, and windspeed are also fairly straightforward.  Just remember it's sending in metric units.




Offline jems

  • Senior Member
  • **
  • Posts: 56
Thanks for the reply!
How did you actually catch the data in the post?  Is it a java object or something?
I tried creating a simple perl CGI script to capture whatever was sent, but it seems to not actually see or capture anything it understands.
I see the bridge's data hitting my web server, but my perl cgi just drops it since it doesn't understand what its seeing.


Offline nincehelser

  • Forecaster
  • *****
  • Posts: 3337
Thanks for the reply!
How did you actually catch the data in the post?  Is it a java object or something?
I tried creating a simple perl CGI script to capture whatever was sent, but it seems to not actually see or capture anything it understands.
I see the bridge's data hitting my web server, but my perl cgi just drops it since it doesn't understand what its seeing.

I don't remember the details, but it was with a perl CGI script.  I didn't go very far with that method as it seemed too much work to me, but that's because I'm more network oriented.  Someone more focused on web development might prefer something using an app server, but that's a bit out of my area. 

I would think that there should be some generic CGI scripts out there that will disassemble a POST statement.

Offline jems

  • Senior Member
  • **
  • Posts: 56
Yes, I tried using the old (yet very reliable) cgi-lib.pl, and wrote a basic "spit back" script to return all the pairs.  But nothing came back.  This is why I thought there was something else going on.
But if that's how you remember it working, I'll poke at it a bit more.

Thanks again!