Forum Replies Created
-
AuthorPosts
-
pbecchiParticipantI think I told you already that SPIFFSsdfat should not be included in the compilation, since is not used!
Therefore I believe you are compiling the wrong files!!
Take only the files of branch modifAfterUpload in the directory OpenSprinklerArduino_v_2.1.6.
July 12, 2016 at 10:32 am in reply to: Penmen-Monteith ETo method python script for possible use as weather script #43415
pbecchiParticipantThanks again for the speedy answer:
You can use a small solar panel with a good specification and decay rate for watts/meter over time. Then infer solar radiation using charge rate.
That exactely the way I want to do it:
I have an Arduino connected to Solar Panels that measure the KWHour produced: it is enough to use in ET0 formulas the ratio between max daily power to the actual one.
I will also try the PAN EVAPORATION method applied to Swimming Pool!
I will tell you the results!
Paolo
July 12, 2016 at 3:27 am in reply to: Penmen-Monteith ETo method python script for possible use as weather script #43412
pbecchiParticipantHi Shawn
thank’s for your immediate and comprehensive answer.
Since you have been very detailed your explanations , I would like to describe to you what I have done in my code , hoping to get some advice and suggestions.
I have started last year to try to automatize my garden irrigation system consisting in several units about 100mt away from my home.
I was thinking to use Arduinos that I normally use and program. Then I discovered ESP8266 and OpenSprinkler and I understood that porting OpenSprinkler to ESP8266 was the way to go! I have completed the porting 3-4 month ago and I have now 5 units running 24h a day.
But I am missing a tool to manage those units (checking status and functions of the units and regulate intervals depending on weather).
I started that my OpenSprikler Manager that will be ready for first upload to GitHub soon. The code measure the water flow from the main supply valve and is WiFi connected to all the units, with Api calls. This way if the flow for a certain interval is not correct will warn that the unit or the irrigation devices are not working correctly.
Coming to the weather controls routines ….I am reading WU json /conditions/pws:XXXXXX output and recording temperatures,humidity,wind,rain and sun radiation.
I have followed tightly the Allen-Pereira :Crop evapotranspiration – Guidelines for computing crop water requirements – FAO Irrigation and drainage paper 56. It provide all needed info to compute irrigation needs. A comprehensive database is included of different crop behaviours and assumptions to be taken.
According to the above I have evaluated actual daily ET0 and used Kc parameters for the areas with different (from grass) vegetations.
The ET0 equations are straight forward…. but measured sunrad is sometime unreliable…therefore I have corrected the reading if are very far from clear sky radiation . This lead to good result that shown daily values ranging fro 1.9 to 4.5 ( I live in Italy!).
I was thinking anyhow to get some local measurement to verify those values or using a solar panel or using the “pan evaporation” method applied to my swimming pool.
Those calculations are used to draw a water balance versus time plot of the different zone so that water shortages can be easily seen and corrected .
The programs correction can be done automatically , but I prefer supervision and manual controls of the units ( at least at this time!).I look forwards to your welcome comments
Paolo
July 11, 2016 at 5:17 am in reply to: Penmen-Monteith ETo method python script for possible use as weather script #43401
pbecchiParticipantHi to everybody,
I have written a c++ code that run on an ESP8266 as a OpenSprinkler master/controller !
Hart of the code is a computation based on Penman ET method on the amount of irrigation required to be compared to the actual OS watering schedule.
I have found this thread very interesting and I would like to discuss some of the issues I have encountered writing my code:
First and most important getting good weather data, to be used for ET calculation, like sun radiation values that are difficult to get from WU stations. Using monthly average data as well as evaluating sun rad. from other parameters doesn’t lead to good results.
I understand that your calculations are based on cloud coverage forecast and you derive from that the hour of sunshine value to be used in calculations.
I think that since ET water needs are only relevant to future irrigation will be better to use actual data.Second is how to account of different kind of vegetation and ground coverage and seasonal as well as how to account for water runoff and percolation.
Third have you foreseen any possibility to use local sensors?
pbecchiParticipantIf you take the code from the github in the directory OpenSprinklerArduino_2_1_6 and branch modafterupload: it MUST compile !
Check you are using only the right directory!Hardware : you are not going very far without a I/O expander!
GPIO available are very few:how do you want to connect your 5 relay + push buttons?
What about LCD?
pbecchiParticipantSorry…
I have seen your previuos post only now!It appear that the various #define in pins.h and config.h files are still mess out!
You can: reload the file version on the github and just select your hardare configuration selection one of the 6 proto configurations.
Or: post the pins.h file you are trying to use and describe your hardware configuration( the config.h should be the original one).
In that case I will have a look to your file and give you some advice!Paolo
pbecchiParticipantThe OpenSprinkler Master code release beta 1. is now ready …… I will test it on my garden set up (4 OpenSprinkler units) for at least a week and than I will upload the code to github.
Summary of the OS Manager features:
Basically OS master run in a waterproof case and is connected to my home-garden WiFi network. The 4 OS unit are spread in my garden several feet away (a good wifi connection to the remote units is very important!).
The code interrogate at regular intervals the units with all the necessary api calls( /jo, /jc ,/jn /jp) and keep in EEprom memory an update configuration of all units.
Every time a new data come from OS units the code check possible program cycles overlap and propose a program intervals time change!
A sequence of all wathering intervals is created and is available for graphic plots.In addition a ISR routine is used for acquisition of pulses coming from a precision flow meter connected to the main water valve.
For each watering interval the water flux is measured and recorded.Following measurements of the same zone allow to make a comparison from recorded to actual flow and flow difference above a certain amount
is considered a possible failure of the OS unit , valves or tubing.
Failure are recorded and alert messages are sent out.Defining the area of the watering for each zone in square meters and dividing the measured flow in liters allow to define precisely the equivalent watering in mm.
The code connect every hour to a near Wunderground Station and acquire Temperature Humidity Wind Rain and Sun Radiation:
data are recorded on file and, with daily averages of meteo data, ETo value is calculated.Water balance for each zone is computed and the water mm value of each zone is plotted in graphical window of the touch screen.
To Be continued……..
Paolo
pbecchiParticipantpin.h is the file that need to be modified to fit your hw configuration. You can find few already prepared cases (proto 1 to 6):
if you need help you can just give me you Hw connections and I can do it for you!I am also preparing a short manual (in the github wiki section) that will describe possible Hw configurations and how to prepare the Pins.h file.
It will be ready in a couple of weeks!Paolo
pbecchiParticipantIn the attachment a picture of the hardware I am using:
an ESP8266
a TouchScreen 4.2″ TFT
+ an RTC b.b.The reason of this is:
-I wanted to be an independent full time running unit.
-I wanted to be remotely or/and locally controlled
-I needed sufficiently powerfull MCU in term of Flash and memory unit
-I needed touchscreen for local full control and easy supervision( a very inexpensive unit)I use Arduino/core libraries.
Total HW cost about 15$.
I will give more detail soon!
Paolo
Attachments:
pbecchiParticipantSorry but I need some more data in order to be able to give you some help:
could you please post (as attachement) the USB output up to the point of Esp reset?
pbecchiParticipantsorry Samer, but after a couple of day of normal work…..again the black screen with the same message.
I would like to understand what can be causing this, I don’t want to keep resetting to factory every few days!
I have 4 OS unit running now and only one give me this problem, apparently all have similar set up!
This one is the one with the worst ethernet connection , but normally after few trial works!
I really would like to understand!
Paolo
pbecchiParticipantThank’s!
I have reset to factory and now the units work again…..!
It was probably corrupted data, I hope it doesn’t append very often!
Paolo
pbecchiParticipantWhat kind of “boot loop” you are in?
If you give me more detail a may give you some guidance….. anyhow to run an opensprinkler without a RTC is not advisable!
In theory NTC should provide right time syncronisation, but since the unit restart very often and syncronisation require more trials……By the way , I will upload a new release of ESP8266 OpenSprinkler at the end of the week, it will include several improvements:
OTA upload capability to upload firmware by TCPIP
WiFi Manager to select WiFi SSID and password without USB connection
other minor and bug correction.
pbecchiParticipantYou can try to use it the way you propose , but be aware:
-RTC may not be used (I haven’t tried…) but time synchronization it is slow…
-all pins 8+3 need to be declared on pins.h file and ESP8266 has no sufficient GPIO
-you may try to give the pins you are not using a dummy number but must be an available GPIO.
-3 pins are necessary for OS buttons.Much better to use an expansion cip: or a PCF8574 or a shift register cip.
Paolo
pbecchiParticipant@ganralf
Some of the available RTC library are NOT compatible with ESP8266 : some do not compile, some compile but dosn’t run.
You should use the one specified in the readme……
Regarding your boot loop …Fivos is correct if you are using EEPROM on I2C you need to have the RTC board with the EEPROM cip on it!
It should show up at boot …but he saying “no I2c devices found!”.
Otherwise you can specify EEPROM_ESP with a define on pins.h and libsel.h files and the ESP flash will be used as an EEPROM.
@fivos
I uploaded yesterday a new release of the code.It Is in the branch modAfterUplaod, I changed the name of the .ino to OpenSprinkler_ESP8266_2_1_6!
I have also put all the files in the same directory deleting all “../”.
This code contain several bugs corrections:
now most of the function I have tested works…
(regarding logs ..I believe that the code is correct but there is some problem in the java code that run in the server that I cannot asses and correct)
it may depend on the browser I use….. try and tell me what’s append!
I am doing little changes right now, since I am working now on the new “OpenSprinkler_Master” code I did to you mention earlier:
I have now 3 Opensprinkler boards ( proto 1,2 and 3) to monitor and control ….it is coming out …. a little more time …..!
pbecchiParticipantFivos
tanks for your corrections and suggestions!
I will use GPIO n. in the defines and I will correct the HW drawing then I will upload a commit that include also the logging fix.
Regarding the future development
I have started working on the master unit core and in a couple of week I should be able to upload something….
If you have some time you could start to download the existing weather code available on the github (in pyton and/or in javascript…languages I don’t know) and port it to c++ writing a scketch that can do the same functions:
I had a look today and I think it will not be a long work than we can go with new sensors and new algorithms(there is a lot of topics on this subject in this forum).
pbecchiParticipantAdC buttons worked on my first prototype but control of the unit require double pressing that is not possible with 3 ADC buttons.
Yesterday I have fixed the logging that wasn’t working….all other OS features seams to work but I have just tested only 2 Hw configurations!
So please do all the test you want I just let me know if everything is OK!
Then we can go on and think about improvements :
-I want to bring the weather routines inside the code so that it could be possible to change the algorithms and take into account local sensors.
-It should be also feasible to change the display and buttons (Now the local control of the unit is really complex and “unfriendly”):may be a touch screen display…should do the work much better!I want also to write a code to run in a remote master unit for control and coordination of several OpenSprinklers!
If you have time,and wish to participate……….there is a lot to do!
pbecchiParticipantI am interested:
-it your breadboard working OK?
-have you tested most of the OS features?Most of the bugs I know have been corrected…. I am waiting for new issues… to try to complete debugging!
Then I want to start putting new features in the code of OS.
Paolo
pbecchiParticipantI am impressed ………………..you are really fast:
-this is a bug in ScanI2C() already corrected : look at the new branch I have uploaded yesterday!
-remember that as the code stand now the I2C LCD has his own library
so his address should be given with #define LCD_ADDR 0xnn otherwise is will be considered an expander.Web Server works? No other bugs? Logging doesn’t work am working on it!
Since your so fast… I will try to answer ASAP….but consider time zone (I am in Europe!)
pbecchiParticipantI am glad you could get already there! As I told you I need to complete documentation:
yes , if you are using Arduino IDE you need to have all files in the same directory and to delete “../” from include statements.
about lcd i2c library….. there is a large choise
Declaration of all pins are in pins.h file for i2c use standard D2,D1 orchange it to your needs
Anyhow…… today I will add documentation for compile and build and the sckematics
pbecchiParticipantThanks Ray for your suggestions!
I want to inform you and everybody interested that
you can find first beta release of OPENSPRINKLER ported to ESP8266
on: //GitHub.com/pbecchi/OpenESP8266_SprinklerLook forward to your comments and suggestions!
pbecchiParticipantFor….anybody interested!
HARDWARE for OpenSprinkler with ESP8266.
The code is compatible for several different hardware configurations:
MCU: ESP8266 or ARDUINO MEGA
VALVE CONTROL: SHIFT REGISTER (like 74HC575 …. ) or I2C EXPANDER (like PCF8574)
RTC DS1307 or DS3231 breadbords with I2C epproms (like AT24C32 )
LCD LCD1602 or 2004 with parallel or I2C interface (or driven with a PCF8574)
BUTTONS on ANALOG or DIGITAL Inputs Lines (or trough a PCF8574).So to start debugging it will be necessary to have at least one ESP8266 (better a NodeMCU v1.0 ) a RTC clock board (with EEPROM) and an LCD (better with I2c interface).
It will be good to have or a SHIFT register chip (like 74HC575) or a PCF8574 : leds can be used for debugging ,
later we can go with relay boards or with a simple Triac circuit.
Remember that voltage level for ESP8266 is 3.3V and this apply to all pin (5V is no good) better to verify that I2C components are 3.3V level compatibles…..
or to have a level shifter!I am preparing a Fritzing project for components connection that can be done easily on a standard breadboard.
pbecchiParticipantI have to complete debugging,
but as soon as I have documented what I have done I will put the code on GitHub!
A let you know when it will be ready!
pbecchiParticipantI add the attachment with ESP8266 pinout (this is NodeMcu but the GPIO n. are the same) : you can see possible utilization of different pins!
@for Ray:
SD emulation on SPIFFS work well but I have some problem with wopts.txt file : it has been deleted and it doesn’t create it again.
I dont understand his use ….. everything work without it!Attachments:
pbecchiParticipantRay and Ian
thanks for your replay!
@Ian
How can I contact you at…..nam!za?
I appreciate very much your offer of one of your boards: as you can see from the pictures I am very basic in electronic prototyping:
– first picture is a proto complete and running that use 74HC595 an RTC DS3231 , a 20*4 LCD I2C and an analog pin for buttons
(better to foreseen this option in you breadboard)
– second one is (not yet complete..) with PCF8574 …(having most pins free) I will go with digital buttons ( to enable double pressing)On both board there is no SD card …I use instead SPIFFS that emulate an SD on the ESP flash.
This is the best I can do, as far as proto boards, hand soldering and use of stripboards. I also use existing boards as far as possible:
for ESP8266 this an NODEMCU v1.0, for RTC this is ZS 042 with a 32k EEPROM pin .The way I have ported the software should maintain full backward compatibility therefore I can select different kind of hardware just using few #define
I testing now…debugging on first propotype…… I will start soon with the second!I don’t use SD card since I want to have more GPIO available and I cannot afford to use 4 for SPI : I want to leave the pins for future development for local data acquisition (temperature, humidity and rain amount ) since local Wunder stations are not very reliable and I will use one of the stations in a glass house.
As far as use of pin on ESP8266 (in my case NODEMCU 1.0) I made a table on attachment 3 : as you can see 3 pins are use for flashing and booting the unit (better you dont use it). Unfortunately ESP are not so well documented and the n. of pin available is very short(better to use ESP8266 v1.2+ or NODEMMCU 1.0+).
Other point: I have preferred to use of an external I2c EEPROM rather than using ESP flash memory (could be erased) since I don’t believe there is any speed issue.One question: how can I modify the weather algoritm ( it is done outside the code )?
I have seen a lot in the forum but it is only related to the Raspberry PI and is done with plug-in!Attachments:
-
AuthorPosts