OpenSprinkler › Forums › Comments, Suggestions, Requests › Opensprinkler on ESP8266
Tagged: ESP8266 installation
- This topic has 171 replies, 26 voices, and was last updated 2 years, 12 months ago by zenonmb.
-
AuthorPosts
-
June 5, 2017 at 8:32 am #46568
avgjoeParticipantrtf file of my attempted post attached
Attachments:
June 5, 2017 at 2:24 pm #46573
pbecchiParticipantIt always the same problem there are files that should not be part of the compilation: this generate double definitions.
Provide me a list of all files in your compilation. I will tell you the ones that need to be taken out!June 5, 2017 at 2:40 pm #46575
avgjoeParticipantThe file list is attached. I am not sure that is the issue now. There does appear to be a duplicate of the same declarations in pins.cpp and opensprinkler.cpp. Both of those are included directly or indirectly in the main code. But I could be missing something. I did try to clean up the files that came from the zip but there are many extras. Thanks for the help!
Attachments:
June 5, 2017 at 2:59 pm #46577
pbecchiParticipantTake out
Pins.cpp but leave pins.hSorry…..having left all those unused files create confusion!
Once you compile and build you have to define the configuration of your HW and change pins.h accordingly!
Tell me your HW and I will tell you how to do it!Paolo
June 5, 2017 at 3:11 pm #46578
avgjoeParticipantSUCCESS!!!! That did it. I did not think to simply remove that file. I thought it was required. Thanks!!!
My hardware is basically a raw ESP-12F. You can assume that every i/o pin is directly controlling 1 of the zones. I would love your suggestions on how to set that up. Now that I have a working start, I intend to remove references to rtc and 5100 as well as any pin that is not a zone output. It would be great if I could disable each of those hardware pieces optionally using define. The end result should be nothing more than raw ESP12f with 8 direct zones and nothing more. The only thing I will likely add afterward is a version that uses shift registers for zones to expand.
Thanks again!
June 5, 2017 at 3:39 pm #46579
pbecchiParticipantI am afraid you need to consider that you have to leave 3 GPio for input buttons and you may want to have 2 GPio for i2c for example for a LCD.
As a consequence you have only 3 pin available for valve control. You better use an i2c expander PCF8274 to drive the 8 output relay!June 5, 2017 at 3:47 pm #46580
avgjoeParticipantFor the minimal version I will have no LCD or buttons. Everything will be done via wifi including initial setup. I will reserve the ability to use the expander as an option where more than 8 valves are required or something link a rain sensor is needed. Hoping to control all of these “options” through the use of defines.
Can you help me through some initial config of the pins.h? Was it your intention to control everything hardware related there?
June 5, 2017 at 4:03 pm #46583
pbecchiParticipantNot sure it can be done! Let me see what I can do but buttons and i2c must be defined!
June 5, 2017 at 9:02 pm #46587
gmauzyParticipantCan you clean up the repo so we all can compile this without errors?
June 6, 2017 at 2:58 am #46591
pbecchiParticipantIn the attachment ,I have modified the pins.h file adding proto 11 for your case! To be selected in the line #define proto 11.
Now the question is what GPio assign to station outputs:
In the file I have left 0x3x numbers that are for a PDF expander
You have to set your books, but do not use 1 ,3 ,4 and 5.
Try using 0,2,9,10,12,13,14,15 and 16 left for spare!
You can probably do it since your board is a Esp8266 12e!Anyhow you are going to test with a fully blind system , having no feedback where the MCU work ,where is connected to internet ,where command to valves are received and running!
I doubt you will be able to do anything with this configuration: keep USB connected (pin 1 and3) at least you will see something!
Enjoy!Paolo
Attachments:
June 6, 2017 at 10:30 am #46594
avgjoeParticipantPaolo,
Where should the top level defines be? For example, I don’t see “#define ESP8266” anywhere. Are there any other defines that are expected but not set in your original code?
After replacing my working pins.h with your new version. I am seeing an unexpected compile error. I am trying to figure it out.
———————————–normal above——————————————
C:\Users\jburbano\AppData\Local\Temp\buildd53f635b949cbb8bc7cb5900f94f9aac.tmp\sketch\EtherCardW5100.cpp: In static member function ‘static bool EtherCardW5100::staticSetup(const uint8_t*, const uint8_t*, const uint8_t*, const uint8_t*)’:EtherCardW5100.cpp:444: error: ‘result’ was not declared in this scope
if (result) {
^
EtherCardW5100.cpp:458: error: ‘result’ was not declared in this scope
return result;
^
—————————————————more————–June 6, 2017 at 10:51 am #46596
avgjoeParticipantI see this code which is likely the source of my error above.
————————
#ifdef ESP8266
#ifndef WIFIMANAGER
uint8_t n = 0;
bool result = false;
————————-I believe that my defines are not set correctly. Can you tell me where and how you expected them to be set?
Thanks!!
June 6, 2017 at 2:54 pm #46600
pbecchiParticipantThe error you are reporting is very strange! There is no change in the error you are reporting due to the new pins.h file. The reason should be elsewhere!
Anyhow I have verified on my PC using the same pins.h file and I have found a different error relative to LCD definition. To correct the error you need to uncomment #define LCDI2C.
With this small correction it compile with no errors! Again it is very strange you find a different error!
Check what you are doing!The code now it is rather complex , so every time you change anything there is the risk of new errors , so changing of #define flags in pins.h can be done but each new configuration need to be tested for compilation a/o runtime errors.
June 6, 2017 at 4:10 pm #46601
avgjoeParticipantIt was the new pins.h that caused my errors. If I replace it with the old one it works. The new one causes the errors above.
As described earlier, this code made no sense to me:
————————#ifndef WIFIMANAGER
————————-
IF ESP8266 is defined, so will WIFIMANAGER. So I changed the line to below;———————————
//#ifndef WIFIMANAGER //this line may be the pins.h problem??======================================
#ifdef WIFIMANAGER //this added to fix problem======================================
———————————-It did allowed me to continue and I also found LCD errors. I am working on those now.
June 6, 2017 at 4:14 pm #46602
avgjoeParticipantCan you tell me which define statements you added that were not in the git repo code? Where do you #define ESP8266? I added it to pins.h but I am not sure if that is where it is intended to be added.
I would really like to be sure I am putting my defines in the right files/places.
June 6, 2017 at 5:24 pm #46605
ja.charerParticipant@pbecchi and @argjoe
What ESP8266ping.h you are using? I can’t find <Arduino-Ping-master\ESP8266ping.h> library declared in EtherCardW5100.h I’ve downloaded this one https://github.com/dancol90/ESP8266Ping and looks like this library is causing some problems.
I’m trying to accomplish same goal as argjoe to have minimal HW system as posible to be controlled over html or/and OpenHAB. And please be patient whit me 🙂 I’m beginner…Regards
CharerAttachments:
June 6, 2017 at 6:55 pm #46607
avgjoeParticipantAnd here is my hardware pin config form another sketch:
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(14, OUTPUT);
pinMode(16, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(15, OUTPUT);
pinMode(10, OUTPUT);Those are the 8 zone pins.
June 6, 2017 at 7:02 pm #46608
avgjoeParticipantESP8266ping is nowhere in my project. I don’t see it in EtherCardW5100.h I did not look at your error file but you probably have a lot of extra files like I did if you downloaded the zip as a start. Once I get a working complete version. I can upload my files. But you will have to wait.
June 7, 2017 at 12:42 am #46612
pbecchiParticipantHi guys
I don’t advise anybody , especially beginners , to change the code for their needs!
Of course this is Open Source and you are free to do it, but I will not follow you on that!The only thing to do , to adjust the code to your HW configuration, is to modify pins.h file where all the modifiable code flags (#define) are located.
To do that :choose one of the 11 proto cases, the one better for your needs and modify the value of the #define there.
Minimum HW configuration is proto 11!June 7, 2017 at 5:12 am #46615
ja.charerParticipantHi,
My intention is not to change the code at all, I just want to compile a minimal configuration as possible. 11 proto case looks perfect for me but won’t compile. I will try again from scrath. In meantime I order some HW as suggested Real Time Clock may be useful.
@avgjoe I can’t wait when you succeed.Regards
August 19, 2017 at 3:04 pm #47472
ja.charerParticipantHello again,
My instance of Opensprinkler on ESP8266 work sins two mount now whit out any significant problems. I can complain only speed but to be honest this is not big issue. However just after initial compilations I’ve observed strange behavior.After power up device always end-up in WiFi Manager mode. Entering password and WiFi Name and soft reset switched device in operational mode. Hard reset and again WiFi Manager mode. After some googling I’ve found solution. Adding below two lines in to “bool EtherCardW5100::WiFiconnect()” in file EtherCard5100.cpp (after DEBUG_PRINTLN(“Wait WIFI…”);) totally solved the issue.
Added lines:
WiFi.disconnect();
WiFi.setAutoConnect(true);Hope this will be usable for anyone.
RegardsSeptember 18, 2017 at 7:36 am #47742
RayKeymasterJust encountered this thread again, and it seems I haven’t mentioned in this threads that the OS 3.0 released earlier this year is an ESP8266-based OpenSprinkler, and the OpenSprinkler firmware has been modified to support this new hardware:
https://github.com/OpenSprinkler/OpenSprinkler-FirmwareI see a lot of references to EtherCardW5100 in this thread — I am a bit confused: does the custom hardware build here include a W5100 Ethernet controller? That’s for wired Ethernet (W5100 chip). If not, what’s the reference to W5100 for?
September 22, 2017 at 1:46 am #47824
pbecchiParticipantHi Ray
This name is an heritage of the branch I have used to start my port to Esp8266. I have started from a 2016 branch from Dave1001 that had the scope to port OS to Arduino Mega with a Ethernet shield.October 8, 2017 at 11:31 am #47955
RayKeymasterAh, ok, makes sense. Thanks for clarifying it.
October 23, 2017 at 6:41 am #48101
TeguhTeknisiParticipantHi @pbecchi
In this Post https://opensprinkler.com/forums/topic/opensprinkler-on-esp8266/#post-41685
You have build OpenSprinkler with NodeMCU and 74HC595
Because i have alot 74HC595, i want to make it.Please help me, can i have the schematic and the code?
Thanks.
Best Regrads,
TeguhEdit:
I have choose Proto = 1
But still failed to compile….Try to choode Proto = 8 (OSBee)
But still failed.Here the error:
sketch/PCF8574Mio - Copia.cpp:27:6: error: prototype for 'void PCF8574::begin(int)' does not match any in class 'PCF8574' void PCF8574::begin(int address) ^ In file included from sketch/PCF8574Mio - Copia.cpp:21:0: PCF8574Mio.h:35: error: candidate is: void PCF8574::begin(uint8_t) void begin(uint8_t address); ^ In file included from sketch/PCF8574Mio - Copia.cpp:23:0: /home/sukanime/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/Wire/Wire.h: In member function 'uint8_t PCF8574::read8()': /home/sukanime/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/Wire/Wire.h:69:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int) uint8_t requestFrom(int, int); ^ /home/sukanime/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/Wire/Wire.h:67:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t) uint8_t requestFrom(uint8_t, uint8_t); ^ sketch/PCF8574Mio - Copia.cpp:41:2: error: '_data' was not declared in this scope _data = Wire.read(); ^ sketch/PCF8574Mio - Copia.cpp: At global scope: sketch/PCF8574Mio - Copia.cpp:47:9: error: prototype for 'uint8_t PCF8574::value()' does not match any in class 'PCF8574' uint8_t PCF8574::value() ^ In file included from sketch/PCF8574Mio - Copia.cpp:21:0: PCF8574Mio.h:38: error: candidate is: uint8_t PCF8574::value() const uint8_t value() const { return _dataIn; }; ^ sketch/PCF8574Mio - Copia.cpp: In member function 'void PCF8574::write8(uint8_t)': sketch/PCF8574Mio - Copia.cpp:55:2: error: '_data' was not declared in this scope _data = value; ^ sketch/PCF8574Mio - Copia.cpp: In member function 'uint8_t PCF8574::read(uint8_t)': sketch/PCF8574Mio - Copia.cpp:63:10: error: '_data' was not declared in this scope return (_data & (1 << pin)) > 0; ^ sketch/PCF8574Mio - Copia.cpp: In member function 'void PCF8574::write(uint8_t, uint8_t)': sketch/PCF8574Mio - Copia.cpp:71:3: error: '_data' was not declared in this scope _data &= ~(1 << pin); ^ sketch/PCF8574Mio - Copia.cpp:75:3: error: '_data' was not declared in this scope _data |= (1 << pin); ^ sketch/PCF8574Mio - Copia.cpp:78:18: error: '_data' was not declared in this scope PCF8574::write8(_data); ^ sketch/PCF8574Mio - Copia.cpp: In member function 'void PCF8574::toggle(uint8_t)': Multiple libraries were found for "Dns.h" sketch/PCF8574Mio - Copia.cpp:84:2: error: '_data' was not declared in this scope Used: /home/sukanime/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/Ethernet _data ^= (1 << pin); ^ sketch/PCF8574Mio - Copia.cpp: In member function 'void PCF8574::shiftRight(uint8_t)': sketch/PCF8574Mio - Copia.cpp:92:2: error: '_data' was not declared in this scope
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Comments, Suggestions, Requests › Opensprinkler on ESP8266