OpenGarage Forums OpenGarage Firmware Fork with MQTT, Magnetic Sensor support ,Close if left open at night – misc

This topic contains 81 replies, has 7 voices, and was last updated by  andyss 1 year, 4 months ago.

Viewing 15 posts - 16 through 30 (of 82 total)
  • Author
    Posts
  • #659

    Ray
    Keymaster

    @curiousg: if you unplug the microUSB cable, then press and hold the pushbutton onboard, then plug in the microUSB cable while holding the button, and then release the button, that will get ESP8266 into programming mode waiting for a new firmware to be uploaded. This is fairly common procedure to program ESP8266.

    Note that when auto-closing the door (i.e. due to automation setting), there is a mandatory buzzer beep — this is just to conform with regulations. In case someone is working nearby the garage door, this will notify the person to avoid any potential danger (this is mandatory even though all garage door systems already have sensors to sense blockers).

    @lawrence_jeff: I was just responding in another thread that the changes you made are great and will definitely take a look and integrate them into the master branch asap.

    #664

    CuriousG
    Participant

    Ray,

    I’m aware on how to get it into programming mode. The question remains why doesn’t OTA work? And for me it’s a hassle since my Opengarage unit is mounted up high with double stick tape. Because the unit is mounted, I have climb up a ladder while bringing up Surface along with me, then I have to hold the USB cable near the port while I hold on to the button as I plug in the USB cable. Certainly not advisable to do and I wouldn’t if I could get OTA to work.

    #672

    Ray
    Keymaster

    @curiousg: does your OG come with a black-colored enclosure, or a brown acrylic enclosure? The black-colored ones used a different ESP8266 chip (WROOM-02) and I don’t quite remember whether OTA update has been tested for that chip — it should work, but perhaps some compilation settings need to be changed to fit that chip.

    #675

    CuriousG
    Participant

    It is the black enclosure. It was purchased 9/5/16 order #6607 if that helps. I do anticipate I will flash it further with Jeff’s firmware changes so if I can get the firmware to work OTA that would help immensely. I can’t be the only older OpenGarage user attempting to flash OTA. I’m open to compile changes to try if you’re so inclined to give me instructions.

    Also the wording on this part is confusing from your compilation instructions:

    Copy the OpenGarage library to your Arduino’s libraries folder. You also need to update a file in the ESP8266 core and Blynk library. See README.txt in the Modifications folder for details.

    In the modifications folder it only makes reference to esp8266. Is that the only file that needs to be replaced or is there one in the Blynk directory also? The folder location is in %appdata%/Arduino15 for those using Windows. That was a hassle to find.

    #676

    lawrence_jeff
    Participant

    Yes – you only need to change the one file, the instructions probably changed at some point and not all references were updated. I noticed this when making my changes

    Jeff

    #677

    CuriousG
    Participant

    Thanks Jeff.

    I tried compiling Ray’s original 1.06 firmware and had errors then switched to your firmware and this is the result I got:

    Arduino: 1.6.5 (Windows 7), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 4M (1M SPIFFS), ck, Disabled, None"
    
    In file included from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/arch/cc.h:39:0,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/arch.h:43,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/debug.h:35,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/opt.h:46,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/tcp_impl.h:35,
                     from ogMainArduino.ino:22:
    C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include/ets_sys.h:168:5: error: previous declaration of 'int atoi(const char*)' with 'C++' linkage
     int atoi(const char *nptr);
         ^
    In file included from c:\users\User\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\stdint.h:12:0,
                     from c:\users\User\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\lib\gcc\xtensa-lx106-elf\4.8.2\include\stdint.h:9,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include/c_types.h:8,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/arch/cc.h:38,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/arch.h:43,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/debug.h:35,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/opt.h:46,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/tcp_impl.h:35,
                     from ogMainArduino.ino:22:
    c:\users\User\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\stdlib.h:70:5: error: conflicts with new declaration with 'C' linkage
     int _EXFUN(atoi,(const char *__nptr));
         ^
    In file included from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/arch/cc.h:39:0,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/arch.h:43,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/debug.h:35,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/opt.h:46,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/tcp_impl.h:35,
                     from ogMainArduino.ino:22:
    C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include/ets_sys.h:183:6: error: previous declaration of 'void ets_intr_lock()' with 'C++' linkage
     void ets_intr_lock();
          ^
    In file included from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h:25:0,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,
                     from ogMainArduino.ino:23:
    C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:137:20: error: conflicts with new declaration with 'C' linkage
     void ets_intr_lock();
                        ^
    In file included from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/arch/cc.h:39:0,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/arch.h:43,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/debug.h:35,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/opt.h:46,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include/lwip/tcp_impl.h:35,
                     from ogMainArduino.ino:22:
    C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include/ets_sys.h:184:6: error: previous declaration of 'void ets_intr_unlock()' with 'C++' linkage
     void ets_intr_unlock();
          ^
    In file included from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h:25:0,
                     from C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,
                     from ogMainArduino.ino:23:
    C:\Users\User\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:138:22: error: conflicts with new declaration with 'C' linkage
     void ets_intr_unlock();
                          ^
    Error compiling.
    
      This report would have more information with
      "Show verbose output during compilation"
      enabled in File > Preferences.
    
    #678

    lawrence_jeff
    Participant

    That doesn’t ring any bells, do you get the same issue with Ray’s?
    Does a basic ESP8266 example compile?

    I can install it all from scratch on a different machine tonight to see if there are any steps missing but as I recall I just followed the instructions and didn’t have any trouble getting it to compile.

    Jeff

    #681

    CuriousG
    Participant

    Grrr somehow when editing my last reply it doesn’t show up but it sensed I already had a duplicate post. Here it is again.

    After I edited the missing libraries from Ray’s firmware, this is the result

      Arduino: 1.6.5 (Windows 7), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 4M (1M SPIFFS), ck, Disabled, None"
    
    OpenGarage\main.cpp.o: In function 

    blynk_count_millis()’:
    C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:7: multiple definition of `blynk_count_millis()’
    ogMainArduino.cpp.o:C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:7: first defined here
    OpenGarage\main.cpp.o: In function `blynk_count_seconds16()’:
    C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:12: multiple definition of `blynk_count_seconds16()’
    ogMainArduino.cpp.o:C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:12: first defined here
    OpenGarage\main.cpp.o: In function `blynk_count_minutes16()’:
    C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:18: multiple definition of `blynk_count_minutes16()’
    ogMainArduino.cpp.o:C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:18: first defined here
    OpenGarage\main.cpp.o: In function `blynk_count_hours8()’:
    C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:24: multiple definition of `blynk_count_hours8()’
    ogMainArduino.cpp.o:C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/Blynk/BlynkEveryN.h:24: first defined here
    OpenGarage\main.cpp.o: In function `std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&)’:
    c:\users\User\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2/functional:2031: multiple definition of `Blynk’
    ogMainArduino.cpp.o:(.bss.Blynk+0x0): first defined here
    collect2.exe: error: ld returned 1 exit status
    Error compiling.`

    I was able to compile the esp8266 Blink example without a hitch. I don’t know if running under Windows is part of the issue.

    #683

    lawrence_jeff
    Participant

    Ok – finally had a chance to look at this – I took a clean Win10 laptop and went through all the steps successfully. Here is what I did

    *Installed Arduino 1.6.13
    *Once installed installed 2.3.0 of the arduino esp8266 core via board manager
    *Installed the latest Blynk software via Manage Libraries
    *Manually added the pubsubclient my version also requires (https://github.com/Imroy/pubsubclient) download and then extract the pubsubclient-master folder to your libaries folder (by default in the my documents/Arduino/Libraries) rename this folder after copy to pubsubclient
    *Downloaded my fork via the download option in github and then extracted the opengarage folder to the same libraries folder
    * Copied the modifications header file from the zip to the folder in C:\users\YourID\Appdata\Local Settings\Arduino\…… (per the instructions)

    So at this point if you open your libraries folder you should see
    Blynk
    OpenGarage
    PubSubClient

    Then go into Opengarage\Examples – open the ino file
    In arduino select Generic ESP8266 – 4/1 Spiffs

    Compile

    No issues on my system

    • This reply was modified 1 year, 10 months ago by  lawrence_jeff.
    #685

    lawrence_jeff
    Participant

    I updated the readme’s of my fork to hopefully make this process more clear – reference that instead of this post and let me know if you still have issues

    #687

    CuriousG
    Participant

    I wrote a somewhat lengthy post only to have the website crash when I tried to post. Arrrggh. Bottom line, I was able to get it to compile with your updated readme.

    #691

    italoc
    Participant

    I like your fork and i think to try your firmware with a magnetic conact, but i have a question:

    mangetic contact need to be connected to GPIO4 and GPIO5 correct?

    a magnetic contact like this is ok ?
    https://www.amazon.it/dp/B00901DDYU/ref=wl_it_dp_o_pC_S_ttl?_encoding=UTF8&colid=WKAFHZHA7NIZ&coliid=I2DJ6UQLXIA59N

    thanks

    #692

    sirotkaslo
    Participant

    italoc, I believe you need a normally closed sensor, so when both ends are together its in closed position.

    As far as this firmware goes, this is perfect, but where do I change how open door is read – from distance sensor to magnetic switch? I am really new to all of this…
    Thank you!

    #693

    italoc
    Participant

    you can’t find any option in options page?

    in github readme i see this:

    “Option page changes

    Support for added functions – like magnetic switch sensor type and close at certain time”

    let me know

    #694

    sirotkaslo
    Participant

    I have no idea tbh, as I’ve only tried official firmware for now, still waiting for magnetic switch to arrive from china, usually takes about 2-3 weeks to Slovenia.

Viewing 15 posts - 16 through 30 (of 82 total)

You must be logged in to reply to this topic.

OpenGarage Forums OpenGarage Firmware Fork with MQTT, Magnetic Sensor support ,Close if left open at night – misc