OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Modifying the firmware
- This topic has 21 replies, 13 voices, and was last updated 6 years, 8 months ago by Ray.
-
AuthorPosts
-
August 19, 2017 at 9:37 pm #47478
951calguyParticipantare this instructions still good for the opensprinkler 3.0?
https://openthings.freshdesk.com/support/solutions/articles/5000165132-how-to-compile-opensprinkler-firmware
And how does it get flashed to the 3.0? is it still using the Arduino IDE?Thanks
September 18, 2017 at 7:41 am #47743
RayKeymasterUpdate: just added a more completed set of instructions to this support article:
https://openthings.freshdesk.com/solution/articles/5000165132-how-to-compile-opensprinkler-firmware=========================
Not yet, sorry about the lack of clear instructions for OS 3.0. Here are the basic steps:
– Download firmware code from:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware– Install makeEspArduino:
https://github.com/plerup/makeEspArduino
(use ESP8266 core 2.2.0 as the firmware hasn’t been tested with 2.3.0 yet)– Install the SSD1306 (for ESP8266) library:
https://github.com/squix78/esp8266-oled-ssd1306– Use the makefile (the firmware files contain a Makefile.esp8266):
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/Makefile.esp8266
You need to change the ESP_ROOT pointer in the makefile, and when uploading firmware you need to change the UPLOAD_PORT to match the serial port that appears in your system. The rest should work just fine.October 1, 2017 at 10:44 pm #47893
admin2ParticipantCurrently running OS Firmware 2.1.7 and wondering if upgrading to 3.0 (once an instruction guide has been created) will give me an easier path to utilising both flow and rain sensors without have to modify OPTION_SENSOR_TYPE in the firmware?
October 4, 2017 at 1:25 pm #47905
foodbagParticipantI’ve tried compiling the firmware using these directions (on OS X and ubuntu), but it always fails on compiling server.cpp complaining that ‘class UpdaterClass’ has no member named ‘reset’. Any suggestions for getting this part to compile? Thanks!
October 7, 2017 at 3:12 am #47932
jerryleoParticipantHi,
I’m having the same problem. Has anyone found a solution yet?
ThanxOctober 9, 2017 at 1:13 am #47997
RayKeymasterOops, that’s a step I forgot to describe. It’s basically changing the Updater.h in esp8266 core to include an additional function (to handle firmware upload failure case). For now, check the opengarage github:
https://github.com/OpenGarage/OpenGarage-Firmware/tree/master/Modifications
which contains the Updater.h file that should overwrite the existing one in the esp8266 core folder (or if it’s not compatible with your Updater.h, just follow the changes in that file to add the additional function).October 10, 2017 at 3:43 pm #48026
jerryleoParticipantThanks… that did it.
October 24, 2017 at 1:51 am #48109
TeguhTeknisiParticipantThanks alot, i can compile & upload it to WeMos D1 Mini using Arduino IDE 1.8.3 after change the Updater.h with https://github.com/OpenGarage/OpenGarage-Firmware/tree/master/Modifications in packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/
Somehow, when i use ESP8266 core 2.2.0 it will compile but afer i upload it, my WeMos D1 Mini Just “Hang” with OpenSprinkler WiFi logo.
When i use ESP8266 core 2.3.0 it will fine.PS: I use Kubuntu 17.04 64 bit.
I use OpenSprinkler-Firmware-master.zip (clone download from github),
– then extract it and rename the folder OpenSprinkler-Firmware-master to OpenSprinkler
– then rename mainArduino.ino to OpenSprinkler.ino
– after that, i put OpenSprinkler folder above to ~/Arduino/
– Download https://github.com/squix78/esp8266-oled-ssd1306/releases version 3.2.7, extract it and rename the folder to SSD1306
then move folder SSD1306 to ~/Arduino/libraries/
– then open OpenSprinkler.ino from the folder ~/Arduino/OpenSprinkler/ with Arduino IDE
– then Compile and Upload it to WeMos D1 MiniNovember 28, 2017 at 1:48 am #48366
tangmonster911ParticipantHi there
I am also trying to compile the code , But i get compiler error on:
———————
server.cpp:2069: error: ‘time’ was not declared in this scopegt = time(NULL);
^
exit status 1
‘time’ was not declared in this scope
———————-not sure if there is a include missing?
Trying to compile with Arduino exactly as per TeguhTeknisi’s post.
November 29, 2017 at 5:56 pm #48377
os061217ParticipantI have the same problem as tangmonster911 and found this note in TimeLib.h.
// This ugly hack allows us to define C++ overloaded functions, when included
// from within an extern “C”, as newlib’s sys/stat.h does. Actually it is
// intended to include “time.h” from the C library (on ARM, but AVR does not
// have that file at all). On Mac and Windows, the compiler will find this
// “Time.h” instead of the C library “time.h”, so we may cause other weird
// and unpredictable effects by conflicting with the C library header “time.h”,
// but at least this hack lets us define C++ functions as intended. Hopefully
// nothing too terrible will result from overriding the C library header?!Still trying to figure out how to fix it. I just upgraded to Arduino IDE 1.8.5 and am trying to compile OS 2.1.7. I have working versions of 2.1.6 on older Arduino IDE. I am wondering if this is a IDE issue or an issue the implementation of the override. I do not see this in 2.1.6
It would be good to hear from the people/person that wrote the note above.
November 30, 2017 at 11:16 pm #48419
RayKeymasterI think I’ve seen this problem before. This probably has to do with Mac and Windows treating Time.h and time.h as the same file name (case insensitive), whereas the firmware is looking for the system’s time.h. Try to remain Time.h and Time.cpp in the firmware folder to something else, like Timetime.h and Timetime.cpp, and see if it compiles.
December 1, 2017 at 10:31 am #48427
os061217ParticipantThanks Ray! That fixed it for me. I had another workaround but this is better. My files and references were changed to OSTime.h and OSTime.cpp. It would be great to work this into the mainline code.
December 1, 2017 at 11:05 am #48428
foodbagParticipantAnother solution for OSX is to make a sparse bundle that is case insensitive (so that Time.h and time.h are seen as different) and put all the source files in there. That is what I did to build the firmware on OSX using the makeEspArduino makefile.
February 10, 2018 at 1:08 am #48858
jnissenParticipantAny idea on when a set of detailed programming instruction for the ESP8266 using OTA programming? I have my system up and running for a few months now but I need to clear my logs often to run have it reboot from time to time. Would appreciate the instructions as it seems the code is now fixed.
February 17, 2018 at 8:30 am #48927
PeteParticipantSorry if this is a dumb newbie question…
I think I managed to get everything to compile OK:
Linking /tmp/mainArduino/mainArduino.bin
Versions: , 2.2.0-dirtyMemory usage
Ram: 41053 bytes
Flash: 328683 bytesBuild complete. Elapsed time: 22 seconds
I can see a whole stack of stuff in the /tmp/mainArduino directory, but how do I get whatever needs to be onto the OpenSprinkler? I ran the makefile from within the Arduino/libraries/OpenSprinkler directory, and I did specify what I believe to be the correct UPLOAD_PORT. Was the image supposed to get uploaded as part of the make process?
I didn’t want to just play around at this point because I didn’t want to trash whatever was currently on the OpenSprinkler without some level of confidence that I’d be able to put something functional back.
February 19, 2018 at 12:20 pm #49154
RayKeymaster@jnissen: here is the link to a recent reply on a different thread, which included instructions on how to do OTA update:
https://opensprinkler.com/forums/topic/os3-reboots-randomly-and-eventually-view-logs-fails-and-reboots/#post-48937
@Pete: it’s the .bin file in the folder that you should upload. You can use OTA update as the link above explains.February 19, 2018 at 5:14 pm #49162
PeteParticipantIf all things in life could be so simple! That worked just fine.
Thanks.
March 13, 2018 at 2:38 am #49334
PatManParticipantHi, am really new to microprocessors and compiling stuff. Trying to compile the code for my Wemos D1 Mini. Running Windows 10 and using Arduino IDE v.1.8.5 to compile.
Have fixed all the Updater.h and Time.h issues discussed above but the compiler still throws up the following problem when running the mainArduino.ino sketch:
error: macro names must be identifiers
#ifndef(ESP8266)I’ve followed TeguhTeknisi’s method and tried ESP8266 cores 2.2.0, 2.3.0 and 2.4.1.
March 13, 2018 at 8:52 pm #49337
komoyaParticipantI have the same problem with you. but fixed with this way: change ” #ifndef(ESP8266)” to “#ifndef ESP8266;” you will successfully compile and download.
but after this, i can not receive the WIFI SSID “OS-xxxx”, I don’t know why. i hope that you can fix this problem and let me know:)
March 15, 2018 at 2:30 am #49354
PatManParticipant@komoya Thanks, your suggestion to remove the brackets on “#ifndef(ESP8266)” worked like a charm. Managed to compile and get the code on my Wemos D1 Mini working.
Not sure why you could not receive the initial WIFI SSID from the device. Mine worked fine. However, some issues I faced were:
1. ESP8266 core 2.4.1 did not work. Had to use the older 2.2.0 core. Perhaps you could experiment with different versions to solve the WIFI SSID problem.
2. The latest SSD1306 OLED driver from the link earlier on this thread did not work. Had to locate an older version here. Just use the latest version on the list.
April 19, 2018 at 8:00 am #49613
accarienParticipantHello, i downloaded OSBeeWifi firmware in order to flash it on an esp8266
I had to modify fonts.h and images.h in order to make it work with SSD1306 library (changing font and logos datatype)
To modify call to blynk begin() function main.cpp :
Blynk.begin(osb.options[OPTION_AUTH].sval.c_str(),osb.options[OPTION_SSID].sval.c_str(),osb.options[OPTION_PASS].sval.c_str());
Modify updater.hBut there is a compilation error i can’t solve :
Archiving built core (caching) in: C:\Users\Acca\AppData\Local\Temp\arduino_cache_905034\core\core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_dio,UploadSpeed_9600,FlashSize_4M3M,ResetMethod_ck,Debug_Disabled,DebugLevel_None_____e92e35acb2bb2c88dd1ba926ed261c45.a
libraries\OSBeeWiFi\main.cpp.o: In function `std::_Function_handler<void (), void(*))>::_M_invoke(std::_Any_data const&)’:C:\Users\Acca\Documents\Arduino\libraries\esp8266-oled-ssd1306/SSD1306Wire.h:134: multiple definition of `Blynk’
sketch\opensprinkler.ino.cpp.o:(.bss.Blynk+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Erreur de compilation pour la carte Generic ESP8266 Module
i can’t find the “blynk” term in SSD1306Wire.h
Could someone help me please ?May 17, 2018 at 6:46 am #50008
RayKeymasterIt might not be directly in SSD1306Wire.h, but in some other file that it includes. Can you do a global search for Blynk inside that folder to find out?
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Modifying the firmware