OpenSprinkler Firmware Update
The OpenSprinkler firmware/software is regularly updated to include new features and functionality. You can update the firmware at any time by reflashing the microcontroller (MCU). The source code is completely open and free. You are welcome to modify it and share your contributions at GitHub.
- You need a regular size Male A to Male B USB cable (most printers use this type of cable).
- If you own OpenSprinkler v1.0 or 1.1: you need an external ISP programmer (FTDI cable no longer works due to the size of the new firmware). An inexpensive USBtiny programmer is available at Rayshobby Shop. In addition, you need to run the following command to re-program the fuse bits:
avrdude -c usbtiny -p m328p -B 250 -F -U lfuse:w:0xff:m -U hfuse:w:0xd1:m -U efuse:w:0x06:m
Only do this on v1.0 or v1.1. Do not re-program the fuse bits on OpenSprinkler v1.2 and above, as they have built-in USBtiny programmer and are already programmed with the correct fuse bits.
Upload a Precompiled Firmware
1. Install USBtiny driver
- On Linux or Mac, there is no need to install driver — USBtiny is already supported.
- On Windows, please download and install the USBtiny driver here (Lady Ada’s website).
• If you use Windows 7 or Vista 64-bit, please follow the instructions here.
Once you plug in the USB cable, the programmer should appear in your device list:
- On Linux, type lsusb in command line and you will see Multiple Vendors USBtiny with ID 1781:0c9f.
- On Mac, go to Hardware Profile and check the USB device list.
- On Windows, go to Control Panel -> Devices and Printers and check if USBtiny ISP is listed there.
2. Install avrdude
Avrdude is a free software for uploading a program to AVR microcontrollers. To install:
- For Linux, use sudo apt-get install avrdude.
- For Mac, follow the instructions here.
- For Windows, install WinAVR.
3. Upload firmware (.hex):
Precompiled firmware files are available at the OpenSprinkler GitHub download page. The easiest way to download is to click on the Zip icon to download the entire package, and unzip it to a local directory.
Next, identify your hardware version number, which is printed on top of your OpenSprinkler circuit board. Then go to software/compiled/ of your local directory, and the sub-folder corresponding to your hardware version. For generation v1.x hardware (based on ATmega328), run this command:
avrdude -c usbtiny -p m328p -F -U flash:w:xxx.hex
where xxx.hex is the name of the program you wish to upload. In Linux, you should run the command with sudo or as a root user. Wait for the upload process to complete, and you are all set.
Similarly, for generation v2.x hardware (based on ATmega644), run this command:
avrdude -c usbtiny -p m644 -F -U flash:w:xxx.hex
Note that firmware 2.0.0 and above will only work on hardware 2.x: do not upload firmware 2.0.0 to hardware 1.x.
Note that when uploading a new firmware, the controller will automatically trigger an EEPROM reset. If for some reason it did not, you can perform a manual reset in Setup Options.
Compile and Modify the Source Code
If you wish to modify the OpenSprinkler source code and customize the software, please follow the instructions below. The F.A.Q. page contains some basic information to get you started. The source code has been documented with comments. It is your responsibility to understand the code if you wish to make changes. We will try our best to answer your questions but cannot respond to all requests.
If you wish to install everything from scratch:
- For OpenSprinkler 1.x generation hardware, please follow instructions archived here: http://rayshobby.net/?page_id=6210
- For OpenSprinkler 2.x generation hardware, please follow instructions archived here: http://rayshobby.net/?page_id=6619