Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Weather Station Ideas


Gina

Recommended Posts

Hi Gina, 

For the wind direction indicator, have you seen the AS5600 chips? 

"AS5600 Absolute Value Encoder PWM I2C Port Precision 12Bit"

On Ebay for about £3, you just hover a magnet over them, and it will read out the angle to 12bits, you can easily drop 8 of those bits!

Data sheet here:  https://ams.com/documents/20143/36005/AS5600_DS000365_5-00.pdf

Might be simpler than all those reed switches and resistors!

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I certainly think MQTT is OTT for what I want.

I agree that I could probably use KStars/Ekos/INDI but that doesn't really fit the bill as I see it.  It's great for astro but my thinking is that a weather station is rather different.  If linking the weather to obsy roof control I can see the advantage but I don't think I shall be doing that - just a rain sensor will take care of closing the roof if it rains.  I know I could use an RPi (maybe plus ESP to give enough IO pins) and get the data indoors that way.

I thought I read that one or two on here had weather station software running on their indoor computers that didn't use Ekos etc.

Link to comment
Share on other sites

2 minutes ago, Gina said:

I certainly think MQTT is OTT for what I want.

I agree that I could probably use KStars/Ekos/INDI but that doesn't really fit the bill as I see it.  It's great for astro but my thinking is that a weather station is rather different.  If linking the weather to obsy roof control I can see the advantage but I don't think I shall be doing that - just a rain sensor will take care of closing the roof if it rains.  I know I could use an RPi (maybe plus ESP to give enough IO pins) and get the data indoors that way.

I thought I read that one or two on here had weather station software running on their indoor computers that didn't use Ekos etc.

Maybe a look through weeex ?

Link to comment
Share on other sites

13 minutes ago, jiberjaber said:

There's also this if it's not all about indi, though you might have to reverse engineer how the sensors are connected to the application and then replicate that on you ESP station implementation..
http://www.weewx.com/

That looks very interesting - could be just what I need.  Thanks.

Link to comment
Share on other sites

5 minutes ago, fireshipjohn said:

Hi Gina, 

For the wind direction indicator, have you seen the AS5600 chips? 

"AS5600 Absolute Value Encoder PWM I2C Port Precision 12Bit"

On Ebay for about £3, you just hover a magnet over them, and it will read out the angle to 12bits, you can easily drop 8 of those bits!

Data sheet here:  https://ams.com/documents/20143/36005/AS5600_DS000365_5-00.pdf

Might be simpler than all those reed switches and resistors!

I already have a similar device but the mechanics of my wind vane use an end bearing (ball and flat) and I can't use an on-axis magnet.

Link to comment
Share on other sites

Problem installing WeeWX - all went well until the install stage.

gina@Mint-Desktop ~ $ sudo apt-get install weewx
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I've had this before with other software but forget how to cure it.

Link to comment
Share on other sites

Checking out the documentation I've found another problem.  The drivers included are for the many proprietary stations.  Can't see any mention of ESP.  Maybe I would need to code the ESP to use one of those station data formats.

I come back the the query of whether anyone here has a working weather station using an ESP without anything to do with Ekos etc.

Edited by Gina
Link to comment
Share on other sites

I'll check that out as it could do what I want but I did say "weather station using an ESP without anything to do with Ekos etc."  Sorry Wim.

  • Like 1
Link to comment
Share on other sites

The esp32 use wifi, as you know. But their range can be too short. But there's a neat fix: use another esp32 as a relay station. Here's how that goes.

Esp #1 is weather station and is not connected to wifi, but is set up to use Esp-now, espressif's protocol for peer to peer communication.

Esp #2 is situated where it is within reach of your wifi, and esp #1 Esp-now. It polls #1 on a regular basis (Esp-now), then connects to wifi for the rest of the time, and publishes the weather data as a file or web server. Indi/Ekos can read this data.

Esp32's are so cheap, that this is an alternative. Also, the data rate for esp-now is lower than regular wifi, so will likely have a longer range. I've been playing with Esp-now to get this working for my obsy.

An alternative would be to use LoRa, as with these

http://www.ebyte.com/en/product-view-news.aspx?id=132

 

Link to comment
Share on other sites

8 minutes ago, Gina said:

I'll check that out as it could do what I want but I did say "weather station using an ESP without anything to do with Ekos etc."  Sorry Wim.

Doesn't have to be ekos. Before I coded it so that indi drivers could poll the data, I coded it as an ordinary web server, like this

https://lastminuteengineers.com/bme280-esp32-weather-station/

ESP32-Weather-Station-Tutorial-For-Interfacing-BME280-Sensor.jpg.6b46c31cf47f78a9880425eab54d1cb5.jpg

Edited by wimvb
Link to comment
Share on other sites

I think the WiFi range should be alright but I'll bear that in mind.

My plan was not to use the weather station to control the roof but to display the weather data indoors - particularly wind direction and speed plus temperature and humidity outdoors and in the obsy.

  • Like 1
Link to comment
Share on other sites

11 minutes ago, wimvb said:

Doesn't have to be ekos. Before I coded it so that indi drivers could poll the data, I coded it as an ordinary web server, like this

https://lastminuteengineers.com/bme280-esp32-weather-station/

That's interesting.  Hadn't though of making the ESP a web server, indeed didn't know it was possible.  So all the HTML code is put in the ESP32.  That should work fine for a simple weather station but I wonder if there's space to generate graphs and charts as I've done in the past using Python and GnuPlot.

Link to comment
Share on other sites

I think I prefer the WeeWX approach but I don't know if it is possible to make the ESP look like one of the commercial stations. 

I have yet to find something which will work as I would like.  The ESP as web server is interesting though complicated and would require quite a lot of work to add the wind sensors and rain gauge.

Another problem may be that I was thinking of having 2 ESPs in different places to cover all the WS sensors.

Maybe I need to rethink the whole thing.

Link to comment
Share on other sites

28 minutes ago, Gina said:

I think I prefer the WeeWX approach but I don't know if it is possible to make the ESP look like one of the commercial stations. 

I have yet to find something which will work as I would like.  The ESP as web server is interesting though complicated and would require quite a lot of work to add the wind sensors and rain gauge.

Another problem may be that I was thinking of having 2 ESPs in different places to cover all the WS sensors.

Maybe I need to rethink the whole thing.

A bit of a quick google on Arduino and Weeex gives quite a few options Gina. Here's one, though you might want to look through the google results incase there's one that suits you better (this is a few years since last updated)

https://github.com/rkaczorek/arduino-pws

 

Edited by jiberjaber
  • Thanks 1
Link to comment
Share on other sites

I Googled ESP and WeeWX and came up with THIS which might form a basis for what I want.  It uses an RPi as the client rather than a desktop or laptop and ESP8266 like I have with lots of pins.  I guess an ESP32 would work as well.  I haven't read right through the article yet but it looks hopeful.

One thing I was hoping I might do as an extra would be a wall display of the weather data with analogue dials.  An RPi would drive these gauges nicely.

  • Like 1
Link to comment
Share on other sites

Read right through that now and not all the code is included! 😮  I may be able to glean some information from it but I'm none too hopeful.

Link to comment
Share on other sites

I think I was looking more at what format the data needed to be in order to get it in to WeeWX.  Looks like there are two approaches, a serial way (the arduino-pws way) and a flatfile way (your solar powered example link)

If the flat file works, then you could implement how you get your data from the ESP to the WeeWX any way you fancied...  just need to be sure it doesn't cause problems with getting the data for your proposed wall dials.

I know I am going to sound like a stuck record here, but MQTT would allow the real time data to be used by multiple devices, you could have a simple MQTT client in python creating a flat file for WeeWX and your wall dials could subscribe to the topics that interest them and get the data real time.

For example, on my all-sky camera PI I have a script that gets the weather data and puts it in a file for use by the camera to create the header...

 

Quote


#!/bin/bash
#mqttwx.sh
#launches mosquitto_sub to listen for temperature, wind and direction for 1 time
#this is run by cron every 2 mins


#Config Variables
EXE="/usr/bin/$BIN" # Directory of camera control executable
HOME="/home/allsky" # Working directory
#-------------------------------------------------------------------
#
# Listen for temperature
mosquitto_sub -h 192.168.1.6 -t home/garden/TempC -C 1 > "$HOME/wxtemp.tmp" &
# Listen for wind speed
mosquitto_sub -h 192.168.1.6 -t home/garden/wind/speed -C 1 > "$HOME/wxspeed.tmp" &
# Listen for wind direction
mosquitto_sub -h 192.168.1.6 -t home/garden/wind/dirC -C 1 > "$HOME/wxdir.tmp"


# Copy temp files over existing ones
mv "$HOME/wxtemp.tmp"  "$HOME/wxtemp"
mv "$HOME/wxspeed.tmp"  "$HOME/wxspeed"
mv "$HOME/wxdir.tmp"  "$HOME/wxdir"

# Log time of update to wxupdate when debuging
#
echo "$(date +%y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M)" >"$HOME/wxupdate"
# end

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Gina said:

I think I prefer the WeeWX approach but I don't know if it is possible to make the ESP look like one of the commercial stations. 

I have yet to find something which will work as I would like.  The ESP as web server is interesting though complicated and would require quite a lot of work to add the wind sensors and rain gauge.

Another problem may be that I was thinking of having 2 ESPs in different places to cover all the WS sensors.

Maybe I need to rethink the whole thing.

The esp can use micropython, but even if weewx is ported to that, I think that you’ll run into memory problems. Even though the esp has 4MB, I believe. Installing a microsd card shield seems overkill.

With multiple esp’s, you should definitely look into Esp-now.

https://www.espressif.com/en/products/software/esp-now/overview

Link to comment
Share on other sites

I thought installing WeeWX into the ESP was asking too much - WeeWX looks like a powerful piece of software.

I wondered about ESP-now for using two ESPs.  Sounds like a solution.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.