Giter Site home page Giter Site logo

stevepmitchell / weewx-socketlogger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from poblabs/weewx-socketlogger

0.0 2.0 0.0 10 KB

A weewx driver that connects to a socket and process data from the socket as weather packet data

Python 100.00%

weewx-socketlogger's Introduction

weewx SocketLogger driver

Inspired from the hackulink driver, which was based on the weewx wmr100 driver, this weewx driver will connect to a socket server and listen for weather data. The weather data needs to be comma separated and contain a sensor schema that matches the database.

My specific use case to make this driver is that I own the Ambient Weather WS-1200-IP and there is no way to redirect the weather data to your own server. So I came up with a TCP iptables redirect that gets the data into weewx using PHP and ncat as a socket server. Once weewx has the data, then you can have weewx update CWOP, PWSWeather, WeatherBug and more.

For the writeup on how I'm using this driver with the weather station data iptables redirect and a socket server, check it out here on my blog: http://obrienlabs.net/redirecting-weather-station-data-from-the-ambient-weather-observerip/

This driver requires:

  • A socket server (ncat is what I used)
    • If you don't want to use ncat, the Python socket library could be hooked in pretty easily I would think. However, this would make the socket available only when weewx is running. This may not be ideal for all situations.

Install

  • Copy the socketlogger.py driver to the bin/user folder (For my CentOS install it's located at /usr/share/weewx/user)
  • Copy the text snippet from the weewx.conf in this repo to your weewx.conf
  • Modify the configuration in weewx.conf to update the IP and port information for the socket server, also update the hardware description if needed
  • Restart weewx

Version

1.0 - Initial

Troubleshooting

  • The driver contains many commented log points as loginf(). Uncomment one, restart weewx and keep an eye on the log file to see if it can offer insight on what's wrong.

Warranty

There is no warranty that this will work. In my testing it seems very stable, but admittedly there could be a few bugs that I haven't come across yet. Note, if the socket server crashes or if weewx crashes, then no data is being captured, which means your data is not being logged and you're not updating any weather services.

I'm open to pull requests to make this better!

weewx-socketlogger's People

Contributors

poblabs avatar

Watchers

James Cloos avatar Steve Mitchell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.