Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Setting up an MQTT system for Weather Sensing and Astro Control


Gina

Recommended Posts

In this thread I will endeavour to build an MQTT system to read ambient weather conditions outside and in the observatory and control the roll-off-roof etc.

  • Like 1
Link to comment
Share on other sites

Firstly, I plan to collect information here and then alter code to suit my devices.

Basically, the MQTT system consists of a number of clients and a server (called "Broker" in MQTT parlance).  The clients will include :-

  • ESP based units that will read things like temperature, humidity and atmospheric pressure, outside and in my observatory
  • wind speed and direction
  • rain gauge
  • probably a cloud sensor
  • ESP32 that will control the ROR motor
Edited by Gina
Link to comment
Share on other sites

I think I mentioned this chap before, but certainly worth looking at. I have used his "The Script" before a long time ago when I was first starting out on the MQTT and NodeRed journey and it looks like there is more good stuff included in it, his blog is good for new gadgets, I've just noticed there is an ESP based board with MOSFET on his blog which I intend to take a look at.

https://tech.scargill.net/the-script/

 

  • Thanks 1
Link to comment
Share on other sites

And in other news, I finally bit the bullet and put my WXStn code on git hub.  Took a while to go through and check I hadn't left any personal details in there (api keys, passcodes etc) but given you've moved towards weatherstation and MQTT etc I thought it might be useful for your consideration / examples of how to (not?) do it :)

https://github.com/oldjiberjaber/wxstation

(I've got no idea of how github works mostly but seemed like the easiest place to share the code with you from) 

 

  • Thanks 1
Link to comment
Share on other sites

Used anMQTT set up on PI 3B (notplus) for 3 yrs very reliable - I suggest someting like MQTT-Explorer-0.3.5.exe for Windows and I forget the Linux equiv - very useful for testing/trouble shooting - especially Topic names and the dreaded "/" or "\". Plus watch out for security in MQTT broker which was a bit hot and miss (3yrs ago).

I used Node-red as the server (also on the MQTT PI) which simplified development(hrs not days to produce working web based GUI's) as many dials,charts etc all exist but there are plenty of ready made IOT for the home that incorparate weather coding plugin's (but dont need the Internet).

 

  • Thanks 2
Link to comment
Share on other sites

17 minutes ago, stash_old said:

Used anMQTT set up on PI 3B (notplus) for 3 yrs very reliable - I suggest someting like MQTT-Explorer-0.3.5.exe for Windows and I forget the Linux equiv - very useful for testing/trouble shooting - especially Topic names and the dreaded "/" or "\". Plus watch out for security in MQTT broker which was a bit hot and miss (3yrs ago).

I used Node-red as the server (also on the MQTT PI) which simplified development(hrs not days to produce working web based GUI's) as many dials,charts etc all exist but there are plenty of ready made IOT for the home that incorparate weather coding plugin's (but dont need the Internet).

 

I've just tried that application, great stuff. Previously I was using MQTT.fx - a good improvement!

  • Like 1
Link to comment
Share on other sites

Started the process for building the broker on a Raspberry Pi 3B+.  Downloaded the latest Raspbian Lite and wrote the MicroSD card with Etcher.  Connected monitor (HDMI) KB and Trackball and logged in.  Then set up with sudo raspi-config - SSH and WiFi.  Logged in with SSH and it was alright until the password which it wouldn't accept and came up with an error.  Decided to check out raspi-config again and connected keyboard and monitor.  Nothing!!  RPi now seems dead!!  Red LED came on on power up but not green (activity).

Edited by Gina
Link to comment
Share on other sites

What is the minimum (cheapest) SBC that will run a broker?  RPi B+ is £40 ish.  RPi Zero W about half that.  To tell the truth, I'm fed up with my ever growing pile of dead RPi boards!!  They seem to either go on indefinitely or die quite quickly.

Link to comment
Share on other sites

I'm wondering if boards from Amazon etc. might be sub-standard.  May be better to use "ThePiShop".

How about this RPi version?  Would it be alright for the broker?  A YouTube video say it is.

1258619986_Screenshotfrom2020-08-1313-35-48.png.d44cbeb102fe43ca0c5add8dfa70b557.png

Edited by Gina
Link to comment
Share on other sites

I have about 5-6 ESP8266 devices around the house running this which might be of use (the good thing about this project of yours is it is finally making me put my code into a repository rather than at teh mercy of onedrive on my home PC) I use a variant of this code for the house thermostat (with some node.red in the background)

(covers DHT22, BME280 and SHT30 sensors)

https://github.com/oldjiberjaber/ESP_MQTT_Temperature

 

  • Like 1
Link to comment
Share on other sites

IMHO run the broker on a "good" SBC (PI's > zero work for me never failed - touching hodd at this point LOL ) and plug that into a main network via the ethernet and let your network AP's do all the hard Wireless work - they have a better beam spread anyway and the device is acting as a central point(i.e. Broker running). I do tend to always have 2 matching sd cards just case one dies or I screw up the settings/software.

Dont know why older PI's are still holding there price but £B's are to be had for about £24 on Fleabay https://www.ebay.co.uk/itm/Raspberry-Pi-3-Model-B-Board-Quad-Core-1-2GHz-64bit-CPU-1GB-Ram-Wi-Fi-Blueto/114349459091?epid=2084942669&hash=item1a9fc24693:g:~f0AAOSw5J1fMUju

  • Thanks 1
Link to comment
Share on other sites

Yes, I'm inclined to agree with that.  I wasn't happy using an ESP8266 as broker - asking for trouble - and I want best reliability for getting all this working being totally new to MQTT.

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
×
×
  • 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.