Author Topic: Davis, Arduino, Node Red, Python  (Read 5286 times)

0 Members and 1 Guest are viewing this topic.

Offline ziplockk

  • Member
  • *
  • Posts: 20
Davis, Arduino, Node Red, Python
« on: November 19, 2017, 08:12:24 AM »
Am a fettler with an interest in weather and software . . . have a wireless Davis VP2 but no Davis indoors hardware. I have used a meteostick/pi for some years (and still do) but have been playing with ESP8266 devices to get the Davis data feed onto an IP network and into node red, thereafter I have an isolated rpi which publishes this data to the net for a live display, plan is to add some modern tech graphing (probably highcharts) capability as time allows.

Live data page is at http://weather.ziplockk.com/newlive.html you will get an update every 5 seconds and will be disconnected after a while.

Data/tech path is :

VP2/RF -> (RF/HopeRF69/Moteino/Serial -> Serial/ESP8266/JSON/UDP) -> UDP/JSON/NodeRed/JSON/UDP -> UDP/JSON/WEBSOCKET

I'm using python/tornado as the device exposed to the net, on an isolated subnet on my network, happens to be running on a pi at the moment but I plan to replace this with an esp8266 device, more secure, less power consumption (although I use pi zero w's so it's all fairly power efficient already).

Davis VP2 protocol decode is being done in Node Red and the output of that is various things, one of which is a JSON message over UDP which ultimately feeds the public facing websocket.

It all seems fairly robust and hassle free.

Advantage of Node Red is that it's super simple to add new processing logic, as complex as you like, without having to hand code it . . . good for experimentation. I use this same Node Red instance for some limited home automation stuff also, and that will only increase over time.

There might be some useful parts in this for others, happy to put the various parts on github if anybody is interested.

Fd
« Last Edit: November 19, 2017, 08:14:52 AM by ziplockk »

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Davis, Arduino, Node Red, Python
« Reply #1 on: November 19, 2017, 10:15:46 AM »
That is pretty cool!  Sure - post it to Github etc.  (BTW, I had to look up "fettler".  :) 

Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline ziplockk

  • Member
  • *
  • Posts: 20
Re: Davis, Arduino, Node Red, Python
« Reply #2 on: November 19, 2017, 12:16:57 PM »
Will do.

I use Node Red to integrate other data feeds also. I have an RFM69 868MHz RF ultra low power sensor network (all battery powered and remote) collecting various things, of weather interest two FIR sensors which can produce very accurate cloud cover information, you can see the raw data from them on the linked page, I use Node Red to calculate a cloud cover estimate which is really quite accurate. One is a wide angle and one a narrow angle of view.

Lastly the newer tech is RFM95 LORA RF comms which I capture data from up to 5Km away, again around 868MHz but using LORA CSS which with a weedy 100mW transmitter does well to do 5Km non LOS . . .

Interesting toys ;-)

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 1132
    • Wilmslow Astro
Re: Davis, Arduino, Node Red, Python
« Reply #3 on: November 19, 2017, 02:34:33 PM »
I'd be interested to know if you are applying the windspeed corrections to the raw data from the ISS?
Mark

Offline ziplockk

  • Member
  • *
  • Posts: 20
Re: Davis, Arduino, Node Red, Python
« Reply #4 on: November 19, 2017, 04:08:50 PM »
I'm using dekay's algorithm to decode the data and haven't looked any deeper yet. If there's a clear definition of the algorithm then it's likely trivial to apply . . .
Fd

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 1132
    • Wilmslow Astro
Re: Davis, Arduino, Node Red, Python
« Reply #5 on: November 19, 2017, 04:16:01 PM »
There is a lookup table in one of the Davis technical documents, I don't know if it is current as they have updated the corrections over the years. I just means you have to do a 2D interpolation across windspeed and direction to get the corrected value.

I keep meaning to look into this to implement on an Arduino, but for now my system still uses the console to do it for me ;) And yes the console speed does often read differently from the raw value on the Arduino.
Mark

Offline ziplockk

  • Member
  • *
  • Posts: 20
Re: Davis, Arduino, Node Red, Python
« Reply #6 on: November 22, 2017, 05:11:31 PM »
Hacked this up while waiting on a late flight . . .

linear speed and angle interpolation between defined observation data in Davis docs.

Seems to work on the face of it . . .

https://github.com/fergusd/weather/blob/master/speedCorrection/interpolator.c

If anybody wants to port/contribute, ask and it shall happen ;-)

I'll probably run this as an exec from within node red . . . someone could port it to javascript of course ;-) . . .

Self tests itself against the observed results in the provided documentation . . . ideally should add tests for mid points between the speed and angle sites defined in the documentation . . . but late flights don't wait . . .
« Last Edit: November 22, 2017, 05:15:45 PM by ziplockk »

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 1132
    • Wilmslow Astro
Re: Davis, Arduino, Node Red, Python
« Reply #7 on: November 23, 2017, 06:55:58 AM »
Good work, I'm not in a position to test it at the moment, but I will someday!...
Mark