Hi all,
Here is the first public pre-release of MYSBootloader 1.3 together with MYSController 1.0.0beta for testing purposes.
Download here. Thanks for your feedback.
MYSBootloader 1.3pre (1.3NS)
- requires dev branch 2.0.0 (lib 1.5 not tested)
- supports OTA FW AND serial FW updates
- no external flash needed for OTA FW updates (thus, offline update)
- bootloader commands (clear eeprom, re-assign ID, re-assign parent ID)
- communicates via assigned parent node (if found)
- 2kb bootloader size
- source code will be published to repo once final
upcoming bootloader release (1.3S):
- secure bootloader (singing and locking feature)
- 4kb bootloader size
Attached bootloader file, compiled with these settings:
- nRF24 (Channel 76, base address 0xA8A8E1FC00, data rate 250kbs)
- 115200 baud (16Mhz) or 57600 (8Mhz)
MYSBootloader 1.0.0beta
- requires dev branch 2.0.0 (lib 1.5 not tested)
- RX only mode
- GW mode: Relay traffic to server socket
- I_VERSION handling
- I_DISCOVER
- add node & sensor ID
- node persistence
- lots of improvements
Flashing MYSBootloader using Arduino IDE and USBasp:
- Add these lines to the boards.txt file in your Arduino IDE installation folder
######## settings for ext XTAL 16Mhz, EESAVE, BOD1V8, no lock
proMYSBL16.name=ATmega328 external 16Mhz with MYSBootloader
proMYSBL16.upload.tool=avrdude
proMYSBL16.upload.protocol=arduino
proMYSBL16.upload.maximum_size=30720
proMYSBL16.upload.maximum_data_size=2048
proMYSBL16.upload.speed=115200
proMYSBL16.bootloader.tool=avrdude
proMYSBL16.bootloader.low_fuses=0xFF
proMYSBL16.bootloader.high_fuses=0xD2
proMYSBL16.bootloader.extended_fuses=0x06
proMYSBL16.bootloader.unlock_bits=0x3F
proMYSBL16.bootloader.lock_bits=0x3F
proMYSBL16.bootloader.file=MySensors/MYSBootloaderV13pre.hex
proMYSBL16.build.mcu=atmega328p
proMYSBL16.build.f_cpu=16000000L
proMYSBL16.build.board=AVR_UNO
proMYSBL16.build.core=arduino
proMYSBL16.build.variant=standard
######## settings for 8Mhz internal clock, EESAVE, BOD1V8, no lock
proMYSBL8.name=ATmega328 internal 8Mhz with MYSBootloader
proMYSBL8.upload.tool=avrdude
proMYSBL8.upload.protocol=arduino
proMYSBL8.upload.maximum_size=30720
proMYSBL8.upload.maximum_data_size=2048
proMYSBL8.upload.speed=57600
proMYSBL8.bootloader.tool=avrdude
proMYSBL8.bootloader.low_fuses=0xE2
proMYSBL8.bootloader.high_fuses=0xD2
proMYSBL8.bootloader.extended_fuses=0x06
proMYSBL8.bootloader.unlock_bits=0x3F
proMYSBL8.bootloader.lock_bits=0x3F
proMYSBL8.bootloader.file=MySensors/MYSBootloaderV13pre.hex
proMYSBL8.build.mcu=atmega328p
proMYSBL8.build.f_cpu=8000000L
proMYSBL8.build.board=AVR_UNO
proMYSBL8.build.core=arduino
proMYSBL8.build.variant=standard
- Copy MYSBootloaderV13pre.hex (from MYSController/Bootloader folder) to the [Arduino IDE installation folder]/hardware/arduino/avr/bootloaders/MySensors/
- Restart Arduino IDE, choose under Tools | Board | ATmega328 external 16Mhz with MYSBootloader or Tools | Board | ATmega328 internal 8Mhz with MYSBootloader depending on your HW settings
- Connect USBasp to sensor node and select Tools | Programmer | USBasp and hit "Burn Bootloader"
Please use the AVR fuse calculator to retrieve the individual fuse settings. If you need to change frequency, BOD or other settings, change the fuse settings based on the fuse calculator.
OTA FW updates using MYSController:
- Start MYSController, hit config and adjust settings (COM-Port & baud or IP address:port)
- Hit connect: Connection to gateway should be established (gateway answers with gateway ready message), the node should appear and request an ID & FW.
- Right-mouse click on that node, select assign FW, choose for example TimeReporter (demo firmware included in the MYSController/Firmware folder). Then click reboot and wait until FW is uploaded and node boots.
TimeReporter firmware reports every few seconds some values such as time, millis, and voltage.
Custom firmware: compile your sketch and retrieve the generated .hex file (activate verbose mode in the Arduino IDE to get compiler messages and output path).
Copy .hex file to MYSController/Firmware folder and edit firmware_config.csv file according to the existing lines.
Hit "Refresh Repo" in MYSController and the newly copied firmware should appear in the Assign FW dropdown list, ready to be uploaded.