OpenSprinkler Forums Comments, Suggestions, Requests Opensprinkler on ESP8266

Viewing 25 posts - 76 through 100 (of 160 total)
  • Author
    Posts
  • #46568

    avgjoe
    Participant

    rtf file of my attempted post attached

    #46573

    pbecchi
    Participant

    It 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!

    #46575

    avgjoe
    Participant

    The 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:
    #46577

    pbecchi
    Participant

    Take out
    Pins.cpp but leave pins.h

    Sorry…..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

    #46578

    avgjoe
    Participant

    SUCCESS!!!! 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!

    #46579

    pbecchi
    Participant

    I 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!

    #46580

    avgjoe
    Participant

    For 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?

    #46583

    pbecchi
    Participant

    Not sure it can be done! Let me see what I can do but buttons and i2c must be defined!

    #46587

    gmauzy
    Participant

    Can you clean up the repo so we all can compile this without errors?

    #46591

    pbecchi
    Participant

    In 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:
    #46594

    avgjoe
    Participant

    Paolo,

    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————–

    #46596

    avgjoe
    Participant

    I 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!!

    #46600

    pbecchi
    Participant

    The 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.

    #46601

    avgjoe
    Participant

    It 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.

    #46602

    avgjoe
    Participant

    Can 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.

    #46605

    ja.charer
    Participant

    @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
    Charer

    Attachments:
    #46607

    avgjoe
    Participant

    And 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.

    #46608

    avgjoe
    Participant

    ESP8266ping 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.

    #46612

    pbecchi
    Participant

    Hi 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!

    #46615

    ja.charer
    Participant

    Hi,
    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

    #47472

    ja.charer
    Participant

    Hello 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.
    Regards

    #47742

    Ray
    Keymaster

    Just 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-Firmware

    I 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?

    #47824

    pbecchi
    Participant

    Hi 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.

    #47955

    Ray
    Keymaster

    Ah, ok, makes sense. Thanks for clarifying it.

    #48101

    TeguhTeknisi
    Participant

    Hi @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,
    Teguh

    Edit:
    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
Viewing 25 posts - 76 through 100 (of 160 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Comments, Suggestions, Requests Opensprinkler on ESP8266