Hackulink, an weewx driver for the AcuRite AcuLink Internet Bridge

# Hackulink Driver

download

## What is it?

A driver for feeding data from an Acu-Rite Acu-link internet bridge into weewx.

## Um, what’s “weewx”

> weewx is a free, open source, software program, written in Python, which interacts with your weather station to produce graphs, reports, and HTML pages. It can optionally publish to the WeatherUnderground, PWSweather.com, CWOP, WOW, or AWEKAS.

Get it here: http://www.weewx.com

## What else should I know.

  • The code could be better, but it seems to work.
  • It ignores data from tower sensors.
  • I have no idea how it would work with two 5in1 sensors.
  • It won’t log any data if the internet connection or AcuLink’s servers are down.
  • The inside temperature, which is a byproduct of the pressure calculation, isn’t right, possibly because of heat emitted by operation of the bridge.
  • Reported pressure isn’t adjusted for elevation of the sensor.

## What do I need?

  • A computer with a working installation of weewx (v 2.5.0 as of this writing).
  • An AcuLink internet bridge.
  • A 5in1 Sensor.
  • A live internet connection.
  • A router running OpenWRT Attitude Adjustment somewhere between the Acu-Link and the Internet.
  • A static DHCP lease for the AcuLink.
  • The ability to debug your setup if it doesn’t work, because I’m probably not going to have much time to help.

## What’s next?

  • Configure the router:
  • Install the optional ‘ngrep’ and ‘ncat’ packages.
  • Add the following command to the local ‘startup section’ on the Startup page under the System menu. It should be a single line ending in ‘&’, and you’ll need to substitute your AcuLink’s numerical IP address for XX.XX.XX.XX.
  • ncat -l 2999 --send-only --max-conns 2 --keep-open -c "/usr/bin/ngrep -l -q -d br-lan -W none 'id=' 'src host XX.XX.XX.XX && dst port 80'" &
  • Copy the hackulink.py file into the weewx/drivers directory.
  • Adapt the sample weewx.conf file to your environment. At the very least you may need to change the host_ip value.
  • Start weewx.
  • If it doesn’t work for you, figure out why.

## How does it work?

  • Weewx loads the driver, the driver opens a socket connection to port 2999 on the router.
  • On the router, ncat acts like a simple TCP/IP server listening on port 2999. When a client connection comes in, it starts ngrep and sends the output from ngrep to the client.
  • ngrep looks for packets passing through the br-lan interface from the IP address of your AcuLink which contain ‘id=’, when it captures one, it outputs the contents to ngrep. These packets contain HTTP POST requests with the sensor data the AcuLink has received and is submitting to the AcuLink webservice. In most situations, a single packet contains the full contents of the POSTed data.
  • The driver receives the captures POST data, checks it to see if it looks complete, and then further parses it, decodes the values, and yields the readings back to the weewx code that called it.

## Credits

  • Based on the wmr100 driver.
  • Informed from the information shared by the author and commenters on: http://moderntoil.com/?p=794
  • Wind Direction encoding reverse engineered by Jason Anthony
  • Hacked by Erik Speckman

8 thoughts on “Hackulink, an weewx driver for the AcuRite AcuLink Internet Bridge

  1. Pingback: Announcing Hackulink | GeekFun

  2. Pingback: My costly mistakes on the path to a somewhat inexpensive home server | Tech Obsessed

  3. eas Post author

    I haven’t touched this code in a long time, but I wanted to share a comment I received via email from Johnathan G, which includes a diff for getting this working with WeeWx 3.0.

    It did not work on weewx version 3.0. There is a conversion site on: http://www.weewx.com/docs/upgrading.htm. Following the conversion guide I made a two minor changes and your driver worked with version 3. Below is a diff of the changes.

    $ diff ~/Downloads/hackulink/hackulink.py hackulink.py
    34c34,35
    < import weewx.abstractstation --- > ## import weewx.abstractstation
    > import weewx.drivers
    52c53,54
    < class Hackulink(weewx.abstractstation.AbstractStation): --- > #class Hackulink(weewx.abstractstation.AbstractStation):
    > class Hackulink(weewx.drivers.AbstractDevice):

    Thank you, it works for me. If I have any further improvements I will pass them along.

    Note: I am using the following ngrep string to avoid having to lock down IP addresses by specifying the MAC address instead of IP address:

    ncat -l 2999 --send-only --max-conns 2 --keep-open -c "ngrep -l -q -d br0 -W none 'id=' 'ether src host 00:25:9c:58:02:c6 && dst port 80'"&

  4. Ronald Poulin

    Haculink no longer works with the new MyAculink service that has replaced the old Acurite service. From what I can tell using tcpdump, The new service uses a GET with the weather parameters sent from the 5in1 with what appears to be breaks in the URL arguments (could be my lack of knowledge in trying to decode tcpdump). The response from the GET, in my case is a url pointing to an update to Wunderground where I share my data. My bridge then turns around and updates Wunderground with a POST. It’s kind of interesting to watch.

    If you are still interested, I would like to work with you to figure this out. I’m not a Python wizard but I can write Python. If you are not interested let me know and I will begin working on it on my own with your permission (you have a copyright on this driver that I would not like to break)

    Sincerely,
    Ron

  5. John Hutchison

    Another note on 3.0+:

    After the last ‘import’ the following needs to be added in order for it to show in the driver selection: DRIVER_NAME = ‘Hackulink’
    DRIVER_VERSION = “1.0”

  6. Jonathan G

    Has anyone worked on this since the migration to MyAcurite. It looks like the output is easier to parse but I have not had time to work on modifying the driver. I did change the ngrep search string from ‘id=’ to ‘^&’ and that seems to get to the full data. If I do get around to converting the driver I will post back here.

  7. Pingback: Berries, Bananas, Oranges and C.H.I.P.s | Tech Obsessed

  8. John

    Well,

    DO NOT WASTE YOUR TIME WITH THIS METHOD!!! IT DOES NOT WORK WITH CURRENT ACURITE VERSION!

    AFTER 2 freaking hours finding a suitable router of the ones I had laying around and flashing Attitude Adjustment, I just thought I’d read through the replies, NO MORE FREAKING SUPPORT! THEN SAY THAT AT THE TOP OF THE PAGE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I mean, I am TOTALLY, 100% grateful for the work that was done with this, but it’s NOT effing cool to NOT put, IN REAL FREAKING BOLD TEXT AT THE TOP OF THE PAGE, “THIS NO LONGER WORKS WITH LATEST ACURITE VERSION” or am I just so pissed I went through first few steps FOR NOTHING (no, a router with an outdated version of firmware was NOT worth it! I prefer DD-WRT anyway)!

    SO for those like myself, that read stuff in order from TOP to BOTTOM, congrats, you TOO just wasted your time!

    Again, I think it’s amazing that people take their time to make what they want, happen, THEN share it with the world, but this is just a recipe for a waste of time!

    I hope a work around has been worked out, as I really wanted to get this working! The time I wasted would’ve been worth a Meteobridge!

    Best of luck but please WARN everyone that your method is WAY outdated!!!!

    John

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.