Weatherlink IP?

945 views
Skip to first unread message

Julian

unread,
Jun 12, 2011, 9:23:07 AM6/12/11
to Weewx Weather Station Discussion
Hi

I'm new to this group so let me introduce myself. My name's Julian
and I live in Worcester in the UK. I am a long time Linux user and
developer but just getting started with a new Vantage Pro2 weather
station.

I started off using the wview code which connects nicely with my
WeatherlinkIP datalogger but there's a few things I dislike about
wview so thought I'd give Weewx a try. However, there doesn't seem to
be a way of connecting to the IP datalogger, is this the case?

If not, I'd like to work on adding this functionality! I'm a Python
coder by trade (I am a developer for launchpad.net) so I'll just dive
in and work on this unless anyone is already doing it. If anyone has
any tips for me I'll gladly take them on board.

Lastly, I noticed in the docs that it says that only consoles that use
US units are supported. Mine is a metric version and I noticed a few
metric "Sample Stations" so they must be doing it. Are the docs out
of date?

Regards,
Julian.

Jason Rennie

unread,
Jun 12, 2011, 10:27:19 AM6/12/11
to weewx...@googlegroups.com
On Sun, Jun 12, 2011 at 9:23 AM, Julian <bigj...@gmail.com> wrote:
I started off using the wview code which connects nicely with my
WeatherlinkIP datalogger but there's a few things I dislike about
wview so thought I'd give Weewx a try.  However, there doesn't seem to
be a way of connecting to the IP datalogger, is this the case?

I hadn't heard of the IP data logger.  It sounds like this turns your console into a web server.  Is that correct?  I believe all current users of weewx either have the serial port or USB data logger.  Do you know whether the IP logger can provide the LOOP and archive packets?  If so, it should be possible to reuse much of the communication code.

If not, I'd like to work on adding this functionality!  I'm a Python
coder by trade (I am a developer for launchpad.net) so I'll just dive
in and work on this unless anyone is already doing it.  If anyone has
any tips for me I'll gladly take them on board.

One thing I found slightly odd about the code organization is that the library code is in the "bin" directory.  But, this has the benefit of not requiring the user to make any modifications to PYTHONPATH since python automatically includes the directory-where-the-executable-is-located in sys.path.  So, I've come to admire the idea. :)  Generally, I've found the code organization to be quite good.  Note that dictionaries are used extensively instead of a more OOP approach.  The OOP approach would provide better automatic documentation, but might make the code less flexible.  wxengine.py is where you'll find the main control loop.

Lastly, I noticed in the docs that it says that only consoles that use
US units are supported.  Mine is a metric version and I noticed a few
metric "Sample Stations" so they must be doing it.  Are the docs out
of date?

I believe the protocol that weewx uses to communicate with the console  is US-unit-specific.  You can find the LOOP and archive specs in weewx/VantagePro.py.  Look for "struct.Struct", as well as "_archive_map" and "_loop_map".  I see a function called "translateLoopToUS" which makes me think whether a VP2 is sold as "US" or "metric" has little to do with the packet format.

Cheers,

Jason

--
Jason Rennie
Research Scientist
Google/ITA Software
617-714-2645


Joe Percival

unread,
Jun 12, 2011, 10:33:23 AM6/12/11
to weewx...@googlegroups.com
The last I looked into the IP version, it was very disappointing.  As I recall, it was only capable of uploading data to Davis Instrument servers where they would provide access via the web.  There were very limited options for formatting and display of the data.  Glad to hear that Wview found a way to access the data directly from the logger.
I felt that Davis had missed a tremendous opportunity when they limited the accessibility of the the data to such a degree.  I had hoped that the IP version would be capable of FTP of the data directly to a web server or perhaps provide a stand-alone web service but when they first came out there were no such options.  I actually had one on order but canceled upon learning of these constraints,
joe
--
You received this message because you are subscribed to the Google Groups "Weewx Weather Station Discussion" group.
To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to weewx-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weewx-user?hl=en.

Julian Edwards

unread,
Jun 12, 2011, 11:14:20 AM6/12/11
to weewx...@googlegroups.com
On 12 June 2011 15:27, Jason Rennie <jre...@gmail.com> wrote:
I hadn't heard of the IP data logger.  It sounds like this turns your console into a web server.  Is that correct?  I believe all current users of weewx either have the serial port or USB data logger.  Do you know whether the IP logger can provide the LOOP and archive packets?  If so, it should be possible to reuse much of the communication code.

It is essentially a web server, yes.  I was hoping it would use broadcast packets but apparently only one client can connect at once, which is a shame.

I have absolutely no idea if the protocol is the same - I'm also unfamiliar with it anyway but once I get a socket connected I'll see if it works with the existing code,
 
One thing I found slightly odd about the code organization is that the library code is in the "bin" directory.  But, this has the benefit of not requiring the user to make any modifications to PYTHONPATH since python automatically includes the directory-where-the-executable-is-located in sys.path.  So, I've come to admire the idea. :)  Generally, I've found the code organization to be quite good.  Note that dictionaries are used extensively instead of a more OOP approach.  The OOP approach would provide better automatic documentation, but might make the code less flexible.  wxengine.py is where you'll find the main control loop.

Cool, thanks for the pointers.

Launchpad uses a _pythonpath.py module that's generated automatically with buildout.  I guess that's overkill for weewx :)
 
Lastly, I noticed in the docs that it says that only consoles that use
US units are supported.  Mine is a metric version and I noticed a few
metric "Sample Stations" so they must be doing it.  Are the docs out
of date?

I believe the protocol that weewx uses to communicate with the console  is US-unit-specific.  You can find the LOOP and archive specs in weewx/VantagePro.py.  Look for "struct.Struct", as well as "_archive_map" and "_loop_map".  I see a function called "translateLoopToUS" which makes me think whether a VP2 is sold as "US" or "metric" has little to do with the packet format.

 Ok thanks - I'll dig around and see what works and what doesn't!

Now, to find some time to work on it... :)

Julian Edwards

unread,
Jun 12, 2011, 11:25:29 AM6/12/11
to weewx...@googlegroups.com
On 12 June 2011 15:33, Joe Percival <j...@bigtreestech.com> wrote:
The last I looked into the IP version, it was very disappointing.  As I recall, it was only capable of uploading data to Davis Instrument servers where they would provide access via the web.  There were very limited options for formatting and display of the data.  Glad to hear that Wview found a way to access the data directly from the logger.
I felt that Davis had missed a tremendous opportunity when they limited the accessibility of the the data to such a degree.  I had hoped that the IP version would be capable of FTP of the data directly to a web server or perhaps provide a stand-alone web service but when they first came out there were no such options.  I actually had one on order but canceled upon learning of these constraints,
joe


It's not restricted, thankfully.  It requests an IP address from a DHCP server by default but you can access its internal web server and reconfigure it to a static address (and port if needed).  The data then seems to be available on that port, I'll poke around in the wview code for inspiration.

Joe Percival

unread,
Jun 12, 2011, 11:32:17 AM6/12/11
to weewx...@googlegroups.com
I guess my hope had been that it would be able to "push" data to an external server other than Davis servers via FTP similar to what weatherlink software can do.
joe

Julian Edwards

unread,
Jun 13, 2011, 6:27:25 PM6/13/11
to Weewx Weather Station Discussion
Hi,

I've managed to get a very experimental piece of code to work.  The protocol is exactly the same as the serial logger so I've not changed anything in that regard.  For the purposes of experimentation I made a socket object that mimics the SerialWrapper and it worked apart from the _wakeup_console() function as flushing sockets doesn't quite work in the same way.

Because the serial code is highly intertwined with the protocol code, I need to split them up into different layers so this is going to be a bit more invasive than I thought.  But hopefully at the end of things the code will look much nicer with a separate data transport class that the protocol can read from and write to.

By the way, I took the liberty of registering the project on Launchpad (https://launchpad.net/weewx) and set it up to mirror the existing Sourceforge svn repo which allows me to use Bazaar instead of Subversion.  If anyone is interested in learning more about that I'm happy to explain it in more detail.

J.

Joe Percival

unread,
Jun 13, 2011, 6:52:49 PM6/13/11
to weewx...@googlegroups.com
Hi Julian,
Please don't get me wrong... I think what you are doing is great!
I just think it's a crying shame that Davis did not make the IP version more flexible!  The whole point of the IP version was to make a local PC unnecessary.  However, they blew it.
Now, a question about your experiment... will it work remotely?  In other words, can I have my python code running on a web server in one location,  have the weatherlink IP connected to a router in another location, and execute wewwx using dyndns (or fixed IP)?  Not that I am going to use it that way since I don't have the weatherlink IP, but at least that would fulfill the dream of not needing a local computer.
Thanks,
joe

Jason Rennie

unread,
Jun 13, 2011, 8:38:21 PM6/13/11
to weewx...@googlegroups.com
On Mon, Jun 13, 2011 at 6:27 PM, Julian Edwards <bigj...@gmail.com> wrote:
By the way, I took the liberty of registering the project on Launchpad (https://launchpad.net/weewx) and set it up to mirror the existing Sourceforge svn repo which allows me to use Bazaar instead of Subversion.  If anyone is interested in learning more about that I'm happy to explain it in more detail.

Cool.  Let me suggest mentioning that the code is VP2 specific so that people aren't disappointed if/when they try to run it with other stations. :)

Btw, a few months ago, we had some discussion about what is the best code/project hosting site---sourceforge was a bit lacking, IIRC.  Do you have opinions?

Jason

Julian Edwards

unread,
Jun 14, 2011, 5:30:06 AM6/14/11
to weewx...@googlegroups.com
On 13 June 2011 23:52, Joe Percival <j...@bigtreestech.com> wrote:
Hi Julian,
Please don't get me wrong... I think what you are doing is great!
I just think it's a crying shame that Davis did not make the IP version more flexible!  The whole point of the IP version was to make a local PC unnecessary.  However, they blew it.

As far as I know, you don't need a local PC.  The blurb on the box that I have says that it uploads without the need for a PC.  See also http://www.weatherlink.com/
 
Now, a question about your experiment... will it work remotely?  In other words, can I have my python code running on a web server in one location,  have the weatherlink IP connected to a router in another location, and execute wewwx using dyndns (or fixed IP)?  Not that I am going to use it that way since I don't have the weatherlink IP, but at least that would fulfill the dream of not needing a local computer.
Thanks,
joe

Absolutely yes.  The code just makes a TCP connection to the datalogger, it could be on the other side of the world for all it knows. 

J.

Pete

unread,
Jun 14, 2011, 5:14:33 AM6/14/11
to Weewx Weather Station Discussion
Hi there,

Just to let you know I've already written the code to talk to the
WeatherLinkIP and it's available in a branch on sourceforge -
http://weewx.svn.sourceforge.net/viewvc/weewx/branches/VLIP/ . Yes,
this will work over the internet too. Just be aware that the design of
the protocol is pretty much meant for controlled networks, if someone
were to discover that it was a WeatherLinkIP running they could write
to parts of the EEPROM inside the console.

In order to talk to the WeatherLink IP you must first get onto it's
web interface to disable data uploads to the Davis site, that's all
the configuration necessary on the WeatherLinkIP. The configuration
file has a few options for specifying how to connect to the
WeatherLinkIP (weewx.conf):- type should be set to ethernet, host
should be set to the address of your WeatherLinkIP and tcp_port set to
whatever you selected on the web interface (it is 22222 by default).
There is a very small change which I will get to Thomas, other than
that it has been working fine for the last 2 months or so.

Pete

unread,
Jun 14, 2011, 7:38:19 AM6/14/11
to Weewx Weather Station Discussion
For anyone wishing to give it a go here is the patch against the
branch revision 422 http://pastebin.com/U2EDewYC . It fixes a few
issues with the initial (branch, revision 422) version that haven't
made it into the repository yet.

Julian Edwards

unread,
Jun 14, 2011, 5:39:19 PM6/14/11
to weewx...@googlegroups.com
This is great!  You've done pretty much what I would have done although your socket code has a bug - you can't rely on recv() to return the number of characters that you asked for.


It's currently running very well for me, I have pushed a complete Bazaar branch here:

Who can commit all this to the mainline?

Thanks
J

John Canfield

unread,
Jun 14, 2011, 5:59:58 PM6/14/11
to Weewx Weather Station Discussion
So I can run weewx on a remote server and pull the data from the
Weatherlink device? This is what I conclude from Julian's response a
couple of posts up. If so, when my FIT dies, I can buy a Weatherlink
and move weewx to my remote host - that would be nice.

John

On Jun 14, 3:39 pm, Julian Edwards <bigjo...@gmail.com> wrote:
> On 14 June 2011 12:38, Pete <pww...@gmail.com> wrote:
>
> > For anyone wishing to give it a go here is the patch against the
> > branch revision 422http://pastebin.com/U2EDewYC. It fixes a few

Pete

unread,
Jun 14, 2011, 6:07:51 PM6/14/11
to Weewx Weather Station Discussion
Thanks for catching that!

> Who can commit all this to the mainline?

I think only Thomas has commit access to the repository on
sourceforge. I'm unable to test the serial code in my implementation
(although I believe it should still work, it would be good if someone
with the USB cable could give it a test).

Pete

unread,
Jun 14, 2011, 6:10:27 PM6/14/11
to Weewx Weather Station Discussion
On Jun 14, 10:59 pm, John Canfield <johnwcanfi...@gmail.com> wrote:
> So I can run weewx on a remote server and pull the data from the
> Weatherlink device?  This is what I conclude from Julian's response a
> couple of posts up.  If so, when my FIT dies, I can buy a Weatherlink
> and move weewx to my remote host - that would be nice.
>

Yes, it would work with the code as it is now fine.

Joe Percival

unread,
Jun 14, 2011, 6:18:36 PM6/14/11
to weewx...@googlegroups.com
weatherlink IP, not the "normal" weatherlink device.

Thomas Keffer

unread,
Jun 14, 2011, 6:34:38 PM6/14/11
to weewx...@googlegroups.com

Indeed. I'm on a boat trip right now in the middle of nowhere, but let me take a look at everything when I get back and I'll do the commit.

I am open to moving to a different repository and opening up the commit process. Any suggestions?

My principal goal is maintaining a small simple, elegant core that doesn't look like it's been hacked by a committee. Anything consistent with that is open.

-tk
________________
Blame my Android for any typos.

Julian Edwards

unread,
Jun 15, 2011, 8:12:25 AM6/15/11
to weewx...@googlegroups.com
On 14 June 2011 23:34, Thomas Keffer <tke...@gmail.com> wrote:

Indeed. I'm on a boat trip right now in the middle of nowhere, but let me take a look at everything when I get back and I'll do the commit.

I am open to moving to a different repository and opening up the commit process. Any suggestions?


I am a bit biased as a core developer on Launchpad.net but I can heartily recommend it along with the Bazaar DVCS :)  We import projects from Sourceforge a fair bit, so it's a streamlined op (bugs, code etc).  I already mirrored your SVN repo there.

Ron Knapp

unread,
Jun 17, 2011, 10:41:51 AM6/17/11
to Weewx Weather Station Discussion
If you want this functionality and don't mind another piece of
equipment I use a ip terminal server, it basically connects a db-9
serial connection to a telnet connection. This works with the wview
ethernet setup and I see no reason it shouldn't be easily adaptable to
this project. I can test this if someone wants to do the code,
basically you telnet to ip:port and then it is just like connected to
the serial device. These servers are like $125-$200 so if you already
have a serial model you can just add this for less then the $300 cost
of the ip logger. It allows you to put your weather station away from
the computer as long as have ethernet connect where you want to put
it. I have even seen wifi units but have never tried one. Here
is an example:

http://www.newegg.com/Product/Product.aspx?Item=N82E16812200028

I use an 10 year old AXIS unit but others should work but buy at your
own risk as I have not tested any other models.



On Jun 15, 8:12 am, Julian Edwards <bigjo...@gmail.com> wrote:

Pete

unread,
Jun 17, 2011, 11:08:51 AM6/17/11
to Weewx Weather Station Discussion
On Jun 17, 3:41 pm, Ron Knapp <ron.sie...@gmail.com> wrote:
> If you want this functionality and don't mind another piece of
> equipment I use a ip terminal server, it basically connects a db-9
> serial connection to a telnet connection. This works with the wview
> ethernet setup and I see no reason it shouldn't be easily adaptable to
> this project. I can test this if someone wants to do the code,
> basically you telnet to ip:port and then it is just like connected to
> the serial device.

This is essentially what the WeatherLinkIP from Davis does, so the
code should work as is

Ronald Knapp (Cell)

unread,
Jun 17, 2011, 11:09:39 AM6/17/11
to weewx...@googlegroups.com
Great will give a try as soon as I can.

Ron Knapp

unread,
Jun 17, 2011, 11:15:58 AM6/17/11
to weewx...@googlegroups.com
Has anybody used Google Code and have any opinion on it?


Thomas Keffer

unread,
Sep 27, 2011, 11:19:23 AM9/27/11
to Trav, weewx-user
Weewx has been successfully ported to the WeatherLinkIP, and it has also been run on a Sheeva Plug (see my notes on the topic), so I don't see why doing both would not be possible.

Pete has done the WeatherLinkIP port, which Julian patched a bit and has put up on Bazaar. Here's the complete branch you need:


I need to integrate this in with the main source branch, which I'll get to RSN.

I am not familiar with usb2serial, but it sounds like you have a udev problem.

I've been working on reducing memory requirements, but I'll get into that on another thread.

-tk

On Mon, Sep 26, 2011 at 6:46 PM, Trav <travis...@gmail.com> wrote:
I have a Sheeva Plug and need to get weewx on it running weather ip,
is this possible? I had usb2serial installed but it would not
recognize the usb2serial on every bootup. Any help is much
appreciated. Thanks.

Reply all
Reply to author
Forward
0 new messages