As it looks now, code will be released tommorow. To speed up some things I took some time to write a few things down.
A little info / manual about ESPimatic.
What started as ‘hey, I want to build a ESP8266 that will send the temperature of a DS18B20 to pimatic’ lead to the current project ESPimatic.
What can you do with ESPimatic?
You can get temperature (and/or humidity) from a DS18B20 and/or a DHTxx sensor. The value is send to pimatic on a interval. To see the value of the sensor you can connect a dual 8x8 LED Matrix. Further you can connect up to 4 relays, controlled from pimatic.
How to install ?
Download all the files from GitHub, compile the sketch and upload to your ESP. It is HIGHLY RECOMMENDED to have a ESP with 4mb flash size. If you plan to update future versions through webinterface, do no forget to correctly configure your board in Arduino
After flashing the ESP will boot up in Acces Point modus, and format a virtual drive in flash. Connect to ssid ESPimatic with password espimatic. Open http://192.168.4.1 in your browser.
You will see a very simple page with the option to upload files. Upload all the HTML files (one by one) you downloaded from GitHub. When finished, reboot your ESP! This can be done with the url http://esp-ip//api?action=reboot&value=true (or simply plug the power )
After uploading and rebooting it is time to configure ESPimatic.
First you have to tell what available GPIO’s you have. In the ‘configure’ menu select System -> GPIO
Select the GPIO’s you have/want available for ESPimatic, leave unusable unchecked.
Next thing to do is configure pimatic. In the ‘configure’ menu select System -> Pimatic and fill in the the information to contact your pimatic system.
Your ESPimatic is now ready to use.
Short info about all the menu options:
Hardware -> DS18B20
Here you can configure a DS18B20 sensor. Only one sensor is supported. You can only choose free GPIO’s. Don’t forget to tell the name of the variable in pimatic for updating.
Hardware -> LED Matrix
Here you can configure a LED Matrix (MAX7219). You can only choose free GPIO’s. The LED Matrix has 5 wires:
VCC
GND
DIN
CS
CLK
You should connect CLK to GPIO14 and DIN to GPIO13 , CS is free to configure. When enabling LED Matrix, GPIO 14 and GPIO13 are automaticly set is used. Select what you want to see on the matrix. Nothing will keep the matrix displaying “OK” or “AP” after startup. When the matrix is enabled, it will fill up the rows during wifi connecting.
Hardware -> IR LED
Here you can configure a IR LED. You can only choose free GPIO’s. To use this, you have to use pimatic. Create a random variable and set it with the IR value of your desired device/function. The create a rule with the following command:
execute "sudo curl --silent --data ‘action=ir&value=$ir’ http://esp-ip/api > /dev/null"
This will pass the IR value to the ‘api’ and will drive the IR Led. For more info about obtaining IR commands see this lib : http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
Hardware -> Relay
Here you can configure up to 4 relays. You can only choose free GPIO’s. To turn a relay on or off, use the api command.
Hardware -> DHT
Here you can configure a DHT sensor. You can only choose free GPIO’s. You should configure what DHT type you have. I only have a DHT11 and have not test this very much, I find DHT unreliable. Don’t forget to configure your pimatic variable.
System -> WifI
Configure / change your WiFi settings here. When ESPimatic can’t connect to your configured network, it will fall back to access point modus (ESPimatic / espimatic).
System -> Firmware
Use this to upload a compiled BIN file to your ESP. If you alter the code yourself, don’t forget to keep everything for uploading and writing a BIN or you will loose this function. Also make sure you compile with correct board settings (flash size) or it will fail to update!
System -> Reset
Caution : This will delete every save option in EEPROM (including wifi)!
System -> Filemanager
A more GUI based page to upload and delete files on the ESP. Files you will delete will be los forever. Files you upload with the same name will be overwritten without warning.
Saving the follwoing settings will cause a mandatory reboot:
- DS18B20
- LED Matrix
- IR LED
- Relay
- DHT
- WiFi
- Reset
Every page has a Refresh and a Reboot button on the navbar. Refresh will reload the save settings from the ESP. Reboot will ask you to confirm and send a reboot to the ESP.
API
It is not realy a API, just some simple URL’s to do some stuff. Supported actions:
action = ir , value = 3420,1592,500,1128, … this will blast the IR code in the aire
action = reboot , value = true This will reboot the ESP
action = matrix_brightness value=[0-8] change the brightness of the LED Matrix
action = matrix_display , value = [on-off[ turn the LED Matrix on or off
action = relay[1-4] , value = [on-off[ turn the relay x on or off
action = clearerror , value wifi,ds18b20,eeprom,upgrade] This will clear a error. Should be done automaticly by the website(s).
action = reset , value=true This will clear all EEPROM settings, including wifi!
By default you can access the page http://esp-ip/format , this will format the SPIFFS filesystem without asking or warning! You can disable this in the code if you like.
Known issues:
- DHT could be buggy. Not tested very well because I rarely use one. Only tested with DHT11
- No mDNS support. This sucks and should never be used. Useless thing that I won’t support
- JS/CSS for bootstrap and jquery are loaded from internet. For now it takes to much SPIFFS space and slows down the pages to much.
- Relays are shortly tested but should work without any issues.
Bugs/problems
Please report in THIS TOPIC and I will try to take a look
Forking/commting to Git etc
I’m not a developper, my code is rubbish. I have not very much knowledge of the GitHub system. For now please accept that I won’t merge codes or something like that with github. If you have any ideas or bugfixes report in this topic
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm