A solar powered, wifi connected thermometer implemented with ESP8266 and BME280.
Solar Powered WiFi Weather Station is:
SolarTherm WiFi Local Admin is able to:
SolarTherm WiFi Local Admin isn't:
(This Table of Contents was manually created by myself. 【ツ】)
A lot. Will come soon.
solartherm.sql
file added AUTO_INCREMENT
for field id
index.html
This project is really early development stage and need improvements everywhere especially on security aspects. It is working in my environment with 2 of this wifi IoT devices. This means it is possible to replicate it on other devices too.
If you need external services like ThingSpeak, Blynk, IFTTT or MQTT you should use the original Arduino Sketch or clones around this project. I'm personally not using this services for such kind of project.
For example:
Build the hardware recommended by Open Green Energy in his Solar Powered WiFi Weather Station v2.0 project.
Here i have some images from my SolarTherm thermometer devices (cases from Debasish Dutta and Marc Stähli):
This project was built with love <3 and the Arduino IDE to compile and upload it to the Wemos board.
You have to install the following libraries this project depends on to your development environment:
Rename the config.sample.h
file to config.h
, and modify the values.
If you want to use more than one device then rename the file to something like config-one.h
and config-two.h
and so on.
Declare the correct file in solartherm-wifi-local-admin.ino
(comment out existing others declared there). You can only have one device config to build the binary.
See the sections below for more information about the particular features that can be configured in this file.
After turning on the device the first time it will enter into configuration mode.
In configuration mode SolarTherm acts as a WiFi access point.
The SSID name and the password to connect to this access point can be specified in the WIFI_AP_SSID
and WIFI_AP_PASSWORD
parameters in config.h
.
Use your computer to connect to this network, then navigate to http://192.168.4.1
in your web browser to open the configuration portal where you can select the preferred wireless network and set the WiFi password for SolarTherm.
Important: SolarTherm will wait for user interaction only for 60 minutes on the configuration portal, then restarts automatically.
This timeout can be configured in the WIFI_CONFIG_PORTAL_TIMEOUT_SECONDS
parameter in config.h
.
SolarTherm collects sensor data and forwards them to local network storage or MagicMirror.
Nearly every local network storage with Apache, PHP, MySQL and filesystem write permissions are possible e.g. RPI.
LAMP stack should not that old. Something newer like actual Raspbian light with manually installed and properly configured services.
Don'forget to secure up you stack if you want to call the webpage with measured and styled data from outside your local network.
If you want to have this as docker installation i'm sure you will find what sweats your needs. I'm not going to provide or support it.
The explanation is not done well. I have to correct it and explain some more detailed steps in the future.
To set up the config files on you local network LAMP stack:
generate-password.php
located in admin folder
S47TnP3pp3R
should a self defined salt what you have to set inside remote-temperature.php
solartherm.sql
located in admin folder on your MySQL Server command line or with phpMyAdmin if installed, to create the needed database.remote-temperature.php
file you have to enter your MySQL database credentials (here i use only localhost if you want to use something else feel free to adjust it)get-data.php
file too.config.h
specify:
LOCAL_STORAGE_HOST
LOCAL_STORAGE_HOSTNAME
LOCAL_STORAGE_API_KEY
you created in step 2.That's it! In every measurement cycle SolarTherm will push the data to your local network storage.
Just put your database credentials where you store your measured SolarTherm data in get-data.php
.
If your LAMP is properly configured you can open you web browser and point to the URL you specified in your webserver configuration (virtual host whatever).
You will get a responsive webpage like the following image:
At this moment i only provide german language in the index.html
file. Feel free to adjust this for your own content.
Webpage was tested with Chrome and Firefox. Responsive design should work on mobiles too.
Will come soon
Magic Mirror (known as MagicMirror²) is an open source, modular smart mirror platform, and SolarTherm is able to push measured temperature, humidity and battery level data to MagicMirror to display them immediately.
An example display of the measured data on MagicMirror may look like this:
To set up the SolarTherm MagicMirror connection follow these steps:
config.h
specify:
MAGIC_MIRROR_HOST
parameter.MAGIC_MIRROR_SENSORID
That's it! In every measurement cycle SolarTherm will push the data to your MagicMirror.
Will come soon
ESP8266 supports over the air updates out of the box, so you can load the firmware to the ESP using Wi-Fi connection rather than a serial port.
In this project only the ESP8266httpUpdate from OTA is available because all other solutions are not suitable due to the deep sleep functionality what is used in this project.
Make sure you read the Security disclaimer and other security related sections in the official documentation to understand the risks!
In this stage the over the air update only receive over unsecure protocol (http instead of https) what is no problem in my local network because i don't need it SSL based.
If you want a secure SSL connection transfer for your binary SolarTherm builds you have to extend the ota-updater.cpp
to provide a security parameter.
It is somehow risky to use it with webspace hoster due to the scripts on LAMP stack side. They are more drafts and inspiration for further development.
config.h
:
OTA_UPDATE_HOST
(could also IP address or Dynamic DNS)OTA_UPDATE_PORT
ota-update.php
is located OTA_UPDATE_SCRIPT_PATH
OTA_UPDATE_VERSION
to identify the correct *.bin
sketch fileota-update.php
with the name you defined in config.h
OTA_UPDATE_VERSION
solartherm-ota/bin
folderEvery time you build a new binary you get a new md5 checksum for your compiled file.
During upload your ESP device will send debug log messages through the serial port. So if OTA does not work, connect your device to your computer, start a serial monitoring tool (e.g. Termite), and start the OTA update through the wireless network.
You can customize the messages in the ota-updater.cpp
file.
Thanks to Open Green Energy for sharing his Solar Powered WiFi Weather Station v2.0 project.
Thanks to Marc Stähli 3KUdelta for his thingiverse STL's and some code inspiration
Thanks to György Balássy balassy for the base Arduino code
Thanks to Jonas Badalic for his base web frontend code
And all other guys where i have stolen code snippets or ideas or inspirations to make some things possible. ;-P
ℓ٥ﻻ ﻉ√٥υ all ❤◦.¸¸.◦✿
This project is maintained by Maja Aurora Pieper.