MYSBootloader 1.3.0-beta.3
-
And here comes another release for public testing:
MYSBootloader v1.3.0-beta.3
Source / compiled .HEX and additional information can be found here.
One more (and last) time: Happy New Year 2017!
-
Hi Tekka,
Happy 2017! Thanks for the update, can you upload a 8Mhz precompiled bootloader? (and update boards.txt)
I'm curious is there a changelog since last version?
-
@tekka Hi Happy new year 2017 !!!
Many thanks for release source of MYSBootloader!!! A very good news !!!
Can you explain how to compile ?
Makefile in Master Branch failed with :make: *** No rule to make target 'MYSBootloader.c', needed by 'MYSBootloader.o'.
I would like to compile an ATMega328 1Mhz version
Thanks
-
To tekka:
+1 to "Can you explain how to compile ?"
OTA with MYSBootloader is possible also with gateway based on ESP8266 ? I cant do it, node is just rebooting after firmware update request and thats all.
-
@MiKa @Tetnobic:
Issue created, please feel free to add any comments: https://github.com/mysensors/MySensorsBootloaderRF24/issues/3
-
Hi Tekka,
First, thx for all your hard work.
+1 for the How-to cause I'm on a try to compile since two hours, :(. There is an include missing : RF24_registers.h.
While I'm here, is there a timout if the node can't reach the gateway in order to boot anyway in this version ?
Thx again.
-
@Tetnobic, @Feji
Dev branch updated: https://github.com/mysensors/MySensorsBootloaderRF24/tree/development- updated Makefile, added include files to same dir
- To compile (under win): install make (I'm using mingw32-make from MinGW)
- clone dev repo
- update paths to avr tools and includes in Makefile (BINPATH, INLCUDES)
- run Makefile to obtain .hex file
- Flash .hex file using ISP
-
Hi Tekka,
can You compile for ATMega328P 8MHz pls?
THX,
MiKa
-
Hi,
There is a 8 MHz version.
I can't get the serial uploading working, don't know why.
-
I already have it finnaly I compile it after one hour
-
To Feji: You have speed 38400 Bd?
-
It's a 56K version, I haven't try 38k yet.
-
@Feji
try 38400Bd it should work
HW.h
#ifndef BAUD_RATE
#if F_CPU >= 16000000L
#define BAUD_RATE 115200
#elif F_CPU >= 8000000L
#define BAUD_RATE 38400L
#elif F_CPU >= 1000000L
#define BAUD_RATE 9600L
#elif F_CPU >= 128000L
#define BAUD_RATE 4800L
#else
#define BAUD_RATE 1200L
#endif
-
My bad, it's a 38k version but I was trying to upload the sketch at 56k...
-
After modifying the HW.h, it's work much better :). Obviously...
Serial upload confirmed work at 57600.
-
Hello everybody.
I have a problem with the update over the air.
Version 2.1.0 mysensors
Gateway on ESP8266 default sketh
I downloaded the loader in atmega328p Arduino pro miniin MYSController choose firmware
in logs[12.01.2017 20: 32: 50.118 Info] INFO BL version = 768 ย [12.01.2017 20: 32: 50.118 Info] INFO Send FW info to node 4: type = A, version = 1, blocks = 0x0050, CRC = 0x46D4 ย [12/01/2017 20: 32: 50.120 Info] TX 4, 0, 4, 0, 1; 0A0001005000D446 ย [12/01/2017 20: 32: 52.205 Info] RX 0, 255, 3, 0, 2, 2.1.0 ย [12.01.2017 20: 32: 53.724 Info] RX 10, 3, 1, 0, 0, 21.2 ย [12/01/2017 20: 32: 53.736 Info] RX 4; 255; 3, 0, 6, 0 ย [12/01/2017 20: 32: 53.737 Info] TX 4; 255; 3, 0; 6; M
in arduino serial
0 MCO: BGN: INIT NODE, CP = RNONA -, VER = 2.1.0 3 TSM: INIT 4 TSF: WUR: MS = 0 11 TSM: INIT: TSP OK 13 TSM: INIT: STATID = 4 15 TSF: SID: OK, ID = 4 16 TSM: FPAR 53 TSF: MSG: SEND, 4-4-255-255, s = 255, c = 3, t = 7, pt = 0, l = 0, sg = 0, ft = 0, st = OK: 592 TSF: MSG: READ, 0-0-4, s = 255, c = 3, t = 8, pt = 1, l = 1, sg = 0: 0 598 TSF: MSG: FPAR OK, ID = 0, D = 1 2060 TSM: FPAR: OK 2061 TSM: ID 2062 TSM: ID: OK 2064 TSM: UPL 2069 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 3, t = 24, pt = 1, l = 1, sg = 0, ft = 0, st = OK: 1 2083 TSF: MSG: READ, 0-0-4, s = 255, c = 3, t = 25, pt = 1, l = 1, sg = 0: 1 2088 TSF: MSG: PONG RECV, HP = 1 2092 TSM: UPL: OK 2093 TSM: READY: ID = 4, PAR = 0, DIS = 1 2113 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 4, t = 0, pt = 6, l = 10, sg = 0, ft = 0, st = OK: FFFFFFFFD0033C3E0300 2131 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 3, t = 15, pt = 6, l = 2, sg = 0, ft = 0, st = OK: 0100 2138 TSF: MSG: READ, 0-0-4, s = 0, c = 4, t = 1, pt = 6, l = 8, sg = 0: 0A0001005000D446 2144 OTA: FWP: UPDATE ! 2146 OTA: FWP: FLASH INIT FAIL 2151 TSF: MSG: READ, 0-0-4, s = 255, c = 3, t = 15, pt = 6, l = 2, sg = 0: 0100 4074 TSF:! MSG: SEND, 4-4-0-0, s = 255, c = 0, t = 17, pt = 0, l = 5, sg = 0, ft = 0, st = NACK: 2.1. 0 5727 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 3, t = 6, pt = 1, l = 1, sg = 0, ft = 1, st = OK: 0 5734 TSF: MSG: READ, 10-10-0, s = 3, c = 1, t = 0, pt = 7, l = 5, sg = 0: 21.2 ! 5739 TSF: MSG: REL MSG, NREP 5817 TSF: MSG: READ, 0-0-4, s = 255, c = 3, t = 6, pt = 0, l = 1, sg = 0: M ! 7739 TSF: MSG: SEND, 4-4-0-0, s = 1, c = 0, t = 23, pt = 0, l = 0, sg = 0, ft = 0, st = NACK: 8436 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 3, t = 11, pt = 0, l = 9, sg = 0, ft = 1, st = OK: Yang Node 8462 TSF: MSG: SEND, 4-4-0-0, s = 255, c = 3, t = 12, pt = 0, l = 4, sg = 0, ft = 0, st = OK: v1.0
confuse line
2144 OTA: FWP: UPDATE
! 2146 OTA: FWP: FLASH INIT FAILwhat could be the problem?
-
@Werwolfx
Disable MY_OTA_FIRMWARE_FEATURE, this is only required for the external flash/dualoptiboot OTA method, MYSBootloader handles OTA updates offline.
-
@tekka oh, my mistake, thank you very much for your work.
-
I try to disable MY_OTA_FIRMWARE_FEATURE in arduino/
but no effect =(
In arduino load example code PingpongSensor and add in sketch
#define MY_NODE_ID 4MYSController log
14.01.2017 8:43:45 CLICK Board with MYSBootloader=TRUE 14.01.2017 8:43:46 RX 10;5;1;0;17;841 14.01.2017 8:43:46 RX 10;6;1;0;39;3.66 14.01.2017 8:43:52 RX 0;255;3;0;2;2.1.0 14.01.2017 8:43:54 TX 4;0;3;0;13;0 14.01.2017 8:43:54 INFO FW "TimeReporter" assigned to node 4 14.01.2017 8:43:57 RX 6;3;1;0;16;0 14.01.2017 8:43:57 RX 6;6;1;0;3;0 14.01.2017 8:43:57 RX 5;3;1;0;16;0 14.01.2017 8:43:57 RX 5;6;1;0;3;0 14.01.2017 8:43:57 RX 6;5;1;0;0;20.25 14.01.2017 8:44:00 RX 4;255;0;0;17;2.1.0 14.01.2017 8:44:00 CHILD New child discovered, node id=4, child id=internal 14.01.2017 8:44:00 DEBUG Update child id=255, type=S_ARDUINO_NODE 14.01.2017 8:44:00 RX 4;255;3;0;6;0 14.01.2017 8:44:00 TX 4;255;3;0;6;M 14.01.2017 8:44:00 RX 4;1;0;0;23; 14.01.2017 8:44:00 CHILD New child discovered, node id=4, child id=1 14.01.2017 8:44:00 DEBUG Update child id=1, type=S_CUSTOM 14.01.2017 8:44:00 RX 4;255;3;0;12;v1.0
Arduino serial
38602 TSF:MSG:READ,0-0-4,s=0,c=3,t=13,pt=0,l=1,sg=0:0 0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.0 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 12 TSM:INIT:STATID=4 14 TSF:SID:OK,ID=4 16 TSM:FPAR 52 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 153 TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0 157 TSF:MSG:FPAR OK,ID=0,D=1 2060 TSM:FPAR:OK 2061 TSM:ID 2062 TSM:ID:OK 2064 TSM:UPL 2067 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2081 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2086 TSF:MSG:PONG RECV,HP=1 2088 TSM:UPL:OK 2091 TSM:READY:ID=4,PAR=0,DIS=1 2122 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2128 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2139 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0 2151 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 2170 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M 2184 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK: 2192 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=OK:Yang Node 2236 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=4,sg=0,ft=0,st=NACK:v1.0 Yang NodeReady. 2243 MCO:REG:REQ 2249 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2 2265 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1 2269 MCO:PIM:NODE REG=1 2272 MCO:BGN:STP 2273 MCO:BGN:INIT OK,TSP=1 2315 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=6,sg=0:Metric
-
@Werwolfx I don't see any MYSBootloader startup message in your log. Please re-download the .hex from the github repo to ensure you are on the most recent version and flash it following these instructions: https://www.mysensors.org/about/ota
-
@tekka
i tryed it
My little instructions for Arduino Atmega328p 5v ext
1)download from https://github.com/mysensors/MySensorsBootloaderRF24
2)copy to arduino folder arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors and paste boards.txtproMYSBL.name=ATmega328 16Mhz MYSBootloader proMYSBL.upload.tool=avrdude proMYSBL.upload.protocol=arduino proMYSBL.upload.maximum_size=30720 proMYSBL.upload.maximum_data_size=2048 proMYSBL.upload.speed=115200 proMYSBL.bootloader.tool=avrdude proMYSBL.bootloader.low_fuses=0xF7 proMYSBL.bootloader.high_fuses=0xDA proMYSBL.bootloader.extended_fuses=0x06 proMYSBL.bootloader.unlock_bits=0x3F proMYSBL.bootloader.lock_bits=0x0F proMYSBL.bootloader.file=MySensors/MYSBootloader.hex proMYSBL.build.mcu=atmega328p proMYSBL.build.f_cpu=16000000L proMYSBL.build.board=AVR_UNO proMYSBL.build.core=arduino proMYSBL.build.variant=standard
3)In Arduino IDE select downloadex bootloader and burn it to Atmega
avrdude log/home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/bin/avrdude -C/home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x06:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xF7:m avrdude: Version 6.3, compiled on Dec 16 2016 at 12:32:01 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "/home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf" User configuration file is "/home/werwolfx/.avrduderc" User configuration file does not exist or is not a regular file, skipping Using Port : usb Using Programmer : usbasp AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : usbasp Description : USBasp, http://www.fischl.de/usbasp/ avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: erasing chip avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: reading input file "0x3F" avrdude: writing lock (1 bytes): /home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/bin/avrdude -C/home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -Uflash:w:/media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex:i -Ulock:w:0x0F:m Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: verifying lock memory against 0x3F: avrdude: load data lock data from input file 0x3F: avrdude: input file 0x3F contains 1 bytes avrdude: reading on-chip lock data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of lock verified avrdude: reading input file "0x06" avrdude: writing efuse (1 bytes): Writing | ***failed; ################################################## | 100% 0.03s avrdude: 1 bytes of efuse written avrdude: verifying efuse memory against 0x06: avrdude: load data efuse data from input file 0x06: avrdude: input file 0x06 contains 1 bytes avrdude: reading on-chip efuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet This behaviour is deprecated and will result in an error in future version You probably want to use 0xfe instead of 0x06 (double check with your datasheet first). avrdude: 1 bytes of efuse verified avrdude: reading input file "0xDA" avrdude: writing hfuse (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of hfuse written avrdude: verifying hfuse memory against 0xDA: avrdude: load data hfuse data from input file 0xDA: avrdude: input file 0xDA contains 1 bytes avrdude: reading on-chip hfuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of hfuse verified avrdude: reading input file "0xF7" avrdude: writing lfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lfuse written avrdude: verifying lfuse memory against 0xF7: avrdude: load data lfuse data from input file 0xF7: avrdude: input file 0xF7 contains 1 bytes avrdude: reading on-chip lfuse data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of lfuse verified avrdude: Version 6.3, compiled on Dec 16 2016 at 12:32:01 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "/home/werwolfx/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8/etc/avrdude.conf" User configuration file is "/home/werwolfx/.avrduderc" User configuration file does not exist or is not a regular file, skipping Using Port : usb Using Programmer : usbasp AVR Part : ATmega328P Chip Erase delay : 9000 us avrdude done. Thank you. PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : usbasp Description : USBasp, http://www.fischl.de/usbasp/ avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: reading input file "/media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex" avrdude: writing flash (32762 bytes): Writing | ################################################## | 100% 0.00s avrdude: 32762 bytes of flash written avrdude: verifying flash memory against /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex: avrdude: load data flash data from input file /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex: avrdude: input file /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex contains 32762 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 32762 bytes of flash verified avrdude: reading input file "0x0F" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lock written avrdude: verifying lock memory against 0x0F: avrdude: load data lock data from input file 0x0F: avrdude: input file 0x0F contains 1 bytes avrdude: reading on-chip lock data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of lock verified avrdude done. Thank you.
- I loaded test sketh WaterMeterPulssensor (from Mysensors example) to arduino
wait if the module is start and see to MYSController
in MYSController
14.01.2017 11:34:49 RX 5;6;1;0;3;0 14.01.2017 11:34:52 RX 10;5;1;0;17;5519 14.01.2017 11:34:52 RX 10;6;1;0;39;23.99 14.01.2017 11:34:57 RX 6;3;1;0;16;0 14.01.2017 11:34:58 RX 6;4;1;0;37;170 14.01.2017 11:34:58 RX 6;6;1;0;3;0 14.01.2017 11:34:58 RX 6;5;1;0;0;20.50 14.01.2017 11:35:01 RX 4;255;0;0;17;2.1.0 14.01.2017 11:35:01 DEBUG Update child id=255, type=S_ARDUINO_NODE 14.01.2017 11:35:01 RX 4;255;3;0;6;0 14.01.2017 11:35:01 TX 4;255;3;0;6;M 14.01.2017 11:35:02 RX 4;255;3;0;11;Water Meter 14.01.2017 11:35:02 RX 4;255;3;0;12;1.1 14.01.2017 11:35:02 RX 4;1;0;0;21; 14.01.2017 11:35:02 DEBUG Update child id=1, type=S_WATER 14.01.2017 11:35:02 RX 4;1;2;0;24; 14.01.2017 11:35:08 RX 10;5;1;0;17;5462 14.01.2017 11:35:08 RX 10;6;1;0;39;23.75 14.01.2017 11:35:18 RX 7;3;1;0;16;0 14.01.2017 11:35:18 RX 7;4;1;0;37;192 14.01.2017 11:35:18 RX 7;6;1;0;3;0 14.01.2017 11:35:19 RX 5;3;1;0;16;0 14.01.2017 11:35:19 RX 5;4;1;0;37;34 14.01.2017 11:35:19 RX 5;6;1;0;3;0
5)in MYSController Assign FW Blink and Reboot
MYSController14.01.2017 11:38:03 TX 4;0;3;0;13;0 14.01.2017 11:38:09 RX 4;255;0;0;17;2.1.0 14.01.2017 11:38:09 CHILD New child discovered, node id=4, child id=internal 14.01.2017 11:38:09 DEBUG Update child id=255, type=S_ARDUINO_NODE 14.01.2017 11:38:09 RX 4;255;3;0;6;0 14.01.2017 11:38:09 TX 4;255;3;0;6;M 14.01.2017 11:38:09 RX 4;255;3;0;11;Water Meter 14.01.2017 11:38:09 RX 4;255;3;0;12;1.1 14.01.2017 11:38:09 RX 4;1;0;0;21; 14.01.2017 11:38:09 CHILD New child discovered, node id=4, child id=1 14.01.2017 11:38:09 DEBUG Update child id=1, type=S_WATER 14.01.2017 11:38:10 RX 4;1;2;0;24; 14.01.2017 11:38:14 RX 4;255;3;0;21;0
Serial
101794 TSF:MSG:READ,0-0-4,s=0,c=3,t=13,pt=0,l=1,sg=0:0 0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.0 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 13 TSM:INIT:STATID=4 14 TSF:SID:OK,ID=4 16 TSM:FPAR 52 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 345 TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0 350 TSF:MSG:FPAR OK,ID=0,D=1 2060 TSM:FPAR:OK 2061 TSM:ID 2062 TSM:ID:OK 2064 TSM:UPL 2067 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2081 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2086 TSF:MSG:PONG RECV,HP=1 2089 TSM:UPL:OK 2091 TSM:READY:ID=4,PAR=0,DIS=1 2098 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2104 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2114 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0 2126 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 2157 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M 2164 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:Water Meter 2176 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1 2183 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=21,pt=0,l=0,sg=0,ft=0,st=OK: 2189 MCO:REG:REQ 2193 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 2245 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1 2250 MCO:PIM:NODE REG=1 2252 MCO:BGN:STP 2255 TSF:MSG:SEND,4-4-0-0,s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK: 2262 MCO:BGN:INIT OK,TSP=1 2335 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=6,sg=0:Metric 2866 TSF:MSG:READ,0-0-4,s=1,c=1,t=24,pt=0,l=6,sg=0:400100 Received last pulse count from gw:400100 6381 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0: 6386 TSF:MSG:BC 6637 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0```
- I loaded test sketh WaterMeterPulssensor (from Mysensors example) to arduino
-
@Werwolfx but still no signs of MYSBootloader - what RF channel are you on?
-
@tekka
NRF24L01+
#define MY_RADIO_NRF24What is the "no signs of MYSBootloader"?
-
@Werwolfx As soon as the bootloader takes over, in your case after the reboot request (1), but before the MYS lib 2.1.0 init message (2):
(1) 14.01.2017 11:38:03 TX 4;0;3;0;13;0 (2) 14.01.2017 11:38:09 RX 4;255;0;0;17;2.1.0
it will send a I_FIRMWARE_CONFIG_REQUEST message to inform the controller about the currently loaded FW and request a new FW.
looks like this:
4;255;4;0;0;BE0001003003D8490102
This is missing in your case, therefore I'm wondering if you have incompatible radio settings. Please post your GW sketch and upload your MYSBootloader.hex file for further troubleshooting.
-
@tekka GW on esp8266 (default sketch) + NRF24L01+
on GW/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * Contribution by Ivo Pullens (ESP8266 support) * * DESCRIPTION * The EthernetGateway sends data received from sensors to the WiFi link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * VERA CONFIGURATION: * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin. * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003 * * LED purposes: * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch, only the LEDs that is defined is used. * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions. * nRF24L01+ ESP8266 * VCC VCC * CE GPIO4 * CSN/CS GPIO15 * SCK GPIO14 * MISO GPIO12 * MOSI GPIO13 * GND GND * * Not all ESP8266 modules have all pins available on their external interface. * This code has been tested on an ESP-12 module. * The ESP8266 requires a certain pin configuration to download code, and another one to run code: * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch') * - Connect GPIO15 via 10K pulldown resistor to GND * - Connect CH_PD via 10K resistor to VCC * - Connect GPIO2 via 10K resistor to VCC * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch') * * Inclusion mode button: * - Connect GPIO5 via switch to GND ('inclusion switch') * * Hardware SHA204 signing is currently not supported! * * Make sure to fill in your ssid and WiFi password below for ssid & pass. */ // Enable debug prints to serial monitor #define MY_DEBUG // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h #define MY_BAUD_RATE 115200 // Enables and select radio type (if attached) #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_GATEWAY_ESP8266 #define MY_ESP8266_SSID "WiFI" #define MY_ESP8266_PASSWORD "password[0_1484386469111_MYSBootloader.hex](/uploads/files/1484386469171-mysbootloader.hex) " // Enable UDP communication //#define MY_USE_UDP // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. // #define MY_ESP8266_HOSTNAME "sensor-gateway" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) //#define MY_IP_ADDRESS 192,168,178,87 // If using static ip you need to define Gateway and Subnet address as well //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0 // The port to keep open on node server mode #define MY_PORT 5003 // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 // Controller ip address. Enables client mode (default is "server" mode). // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68 // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway // #define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period // #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Led pins used if blinking feature is enabled above #define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin #define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED #if defined(MY_USE_UDP) #include <WiFiUdp.h> #endif #include <ESP8266WiFi.h> #include <MySensors.h> void setup() { } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }
In MYSController on mudule i click INFO
FW Update = no
Bootloader = N/Amay be problem in the Bootloader.hex?
-
@Werwolfx Please also update the bootloader file.
-
@tekka said:
@Werwolfx Please also update the bootloader file.
I'll update more than once, but there is no effect.
avrdude writes that everything is OK
I do not know what to do = (avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: auto set sck period (because given equals null) avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: reading input file "/media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex" avrdude: writing flash (32762 bytes): Writing | ################################################## | 100% 0.00s avrdude: 32762 bytes of flash written avrdude: verifying flash memory against /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex: avrdude: load data flash data from input file /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex: avrdude: input file /media/werwolfx/SSDData/arduino-1.8.0/hardware/arduino/avr/bootloaders/MySensors/MYSBootloader.hex contains 32762 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 32762 bytes of flash verified avrdude: reading input file "0x0F" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lock written avrdude: verifying lock memory against 0x0F: avrdude: load data lock data from input file 0x0F: avrdude: input file 0x0F contains 1 bytes avrdude: reading on-chip lock data: Reading | ################################################## | 100% 0.00s avrdude: verifying ... avrdude: 1 bytes of lock verified avrdude done. Thank you.
-
@Werwolfx sorry, maybe I was not clear - please upload it here to the forum I will try to reproduce your setup.
-
@tekka If i ENABLE #define MY_OTA_FIRMWARE_FEATURE
i see ST_FIRMWARE_CONFIG_REQUEST in MYSCONTROLLER logs!!!
if i DISABLE //#define MY_OTA_FIRMWARE_FEATURE msg not in logi not have external flash/
402 14.01.2017 21:29:28 TX 4 - Water Meter N/A C_INTERNAL NO I_REBOOT 0 403 14.01.2017 21:29:28 RX 4 1 C_REQ NO V_VAR1 408 14.01.2017 21:29:34 RX 4 INTERNAL C_STREAM NO ST_FIRMWARE_CONFIG_REQUEST FFFFFFFF48044E100300 409 14.01.2017 21:29:34 TX 4 N/A C_STREAM NO ST_FIRMWARE_CONFIG_RESPONSE 0A0001005000D446 410 14.01.2017 21:29:34 RX 4 INTERNAL C_PRESENTATION NO S_ARDUINO_NODE 2.1.0 411 14.01.2017 21:29:34 RX 4 INTERNAL C_INTERNAL NO I_CONFIG 0 412 14.01.2017 21:29:34 TX 4 INTERNAL C_INTERNAL NO I_CONFIG M 414 14.01.2017 21:29:34 RX 4 - Water Meter INTERNAL C_INTERNAL NO I_SKETCH_NAME Water Meter 417 14.01.2017 21:29:34 RX 4 - Water Meter INTERNAL C_INTERNAL NO I_SKETCH_VERSION 1.1 419 14.01.2017 21:29:34 RX 4 - Water Meter 1 - S_WATER C_PRESENTATION NO S_WATER
i load this HEX
load from Arduino IDE 1.8.0
0_1484418874223_MYSBootloader.hexboard.txt
proMYSBL.bootloader.tool=avrdude
proMYSBL.bootloader.low_fuses=0xFF
proMYSBL.bootloader.high_fuses=0xDA
proMYSBL.bootloader.extended_fuses=0xFE
proMYSBL.bootloader.unlock_bits=0x3F
proMYSBL.bootloader.lock_bits=0x0F
proMYSBL.bootloader.file=MySensors/MYSBootloader.hex
-
@Werwolfx Ok, seems like you also upload the sketch via USBasp thereby erasing/overwriting the bootloader. Try uploading the sketch via serial or OTA after flashing the bootloader.
-
@tekka am I correct in thinking the HEX found on Github can be used with all Arduino's? I noticed my old folder has one hex for 16, 8 and 1Mhz?
I'm using this board.txt
menu.cpu=Processor ############################################################## MYSBL13.name=MYS Bootloader - atmega328p MYSBL13.upload.tool=arduino:avrdude MYSBL13.upload.protocol=arduino MYSBL13.upload.maximum_size=30720 MYSBL13.upload.maximum_data_size=2048 MYSBL13.bootloader.tool=arduino:avrdude MYSBL13.bootloader.unlock_bits=0x3F MYSBL13.bootloader.lock_bits=0x0F MYSBL13.build.mcu=atmega328p MYSBL13.build.board=AVR_PRO MYSBL13.build.core=arduino:arduino MYSBL13.build.variant=arduino:standard ## ------------------------------------------------- MYSBL13.menu.cpu.16MHzatmega328=ATmega328 16MHz (XTAL, BOD1V8) MYSBL13.menu.cpu.16MHzatmega328.upload.speed=115200 MYSBL13.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF MYSBL13.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA MYSBL13.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x06 MYSBL13.menu.cpu.16MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader.hex MYSBL13.menu.cpu.16MHzatmega328.build.f_cpu=16000000L MYSBL13.menu.cpu.8MHzatmega328=ATmega328 8MHz (RC, BOD1V8) MYSBL13.menu.cpu.8MHzatmega328.upload.speed=38400 MYSBL13.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xE2 MYSBL13.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA MYSBL13.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x06 MYSBL13.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader.hex MYSBL13.menu.cpu.8MHzatmega328.build.f_cpu=8000000L MYSBL13.menu.cpu.1MHzatmega328=ATmega328 1MHz (RC/8, BOD1V8) MYSBL13.menu.cpu.1MHzatmega328.upload.speed=9600 MYSBL13.menu.cpu.1MHzatmega328.bootloader.low_fuses=0x62 MYSBL13.menu.cpu.1MHzatmega328.bootloader.high_fuses=0xDA MYSBL13.menu.cpu.1MHzatmega328.bootloader.extended_fuses=0x06 MYSBL13.menu.cpu.1MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader.hex MYSBL13.menu.cpu.1MHzatmega328.build.f_cpu=1000000L```
-
I guess not... The old hex for 8Mhz works, but the one from this thread does not...
I'm trying to upload this to my Pro Mini, does anyone have an 8Mhz that works?
-
@tekka I've noticed some odd things with my nodes when running the bootloader.
To test I uploaded a simple count time sketch. When running the MYS bootloader the timer resets every 10 seconds, see:
Time: 999 Time: 2000 Time: 3000 Time: 4001 Time: 5001 Time: 6002 Time: 7004 Time: 8003 Time: 9005 Time: 0 Time: 999 Time: 2000 Time: 3000 Time: 4001 Time: 5001 Time: 6002 Time: 7004 Time: 8003 Time: 9005 Time: 0
Using the stock Pro Mim 8Mhz 3.3v bootloader it works fine, any ideas?
Perhaps this is because I'm testing using a non-MySensors sketch?
-
@Mark-Swift yeah, this is intended behavior: the watchdog kicks in after ~8s, so either you reset it in loop() or disable it in setup().
-
Is there a version or branch of this for the rfm69?
-
@rmtucker No, but everybody is welcome to contribute and enhance the functionality.
-
@tekka, I'm trying to compile the HEX using OSX. I have installed avr-gcc with homebrew but I get
rm *.o
rm: *.o: No such file or directory
make: [clean] Error 1 (ignored)
rm *.elf
rm: *.elf: No such file or directory
make: [clean] Error 1 (ignored)
rm *.hex
rm: *.hex: No such file or directory
make: [clean] Error 1 (ignored)
"avr-gcc" -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -Wextra -Wundef -pedantic -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o" -I MYSBootloader.c -o MYSBootloader.o
avr-gcc: fatal error: no input files
compilation terminated.
make: *** [MYSBootloader.o] Error 1When issueing the Make command, can you help, any suggestions?
-
@Mark-Swift I haven't tested that with OSX - maybe somebody can help here?
-
@tekka, started a windows VM, run via MinGW and got this when running makefile, does it look okay?
C:\MySensorsBootloaderRF24-development>mingw32-make.exe rm *.o process_begin: CreateProcess(NULL, rm *.o, ...) failed. make (e=2): The system cannot find the file specified. Makefile:40: recipe for target 'clean' failed mingw32-make.exe: [clean] Error 2 (ignored) rm *.elf process_begin: CreateProcess(NULL, rm *.elf, ...) failed. make (e=2): The system cannot find the file specified. Makefile:40: recipe for target 'clean' failed mingw32-make.exe: [clean] Error 2 (ignored) rm *.hex process_begin: CreateProcess(NULL, rm *.hex, ...) failed. make (e=2): The system cannot find the file specified. Makefile:40: recipe for target 'clean' failed mingw32-make.exe: [clean] Error 2 (ignored) "C:/Arduino/hardware/tools/avr/bin/avr-gcc" -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -ffunction-sections -fdata-sections -fpack-struct -fshort -enums -mrelax -Wall -Wextra -Wundef -pedantic -mmcu=atmega328p -c -std=gnu99 -M D -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o" -IC:/Ardu ino/hardware/tools/avr/avr/include/avr MYSBootloader.c -o MYSBootloader.o In file included from Core.h:40:0, from MYSBootloader.c:69: HW.h:51:2: warning: #warning is a GCC extension #warning BAUD_RATE error greater than 2% ^ HW.h:51:2: warning: #warning BAUD_RATE error greater than 2% [-Wcpp] In file included from Core.h:42:0, from MYSBootloader.c:69: MyMessage.h:292:3: warning: ISO C99 doesn't support unnamed structs/unions [-Wpe dantic] }; ^ "C:/Arduino/hardware/tools/avr/bin/avr-gcc" -nostartfiles -Wl,-s -Wl,-static -Wl ,-Map=".map" -Wl,--start-group -Wl,--end-group -Wl,--gc-sections -mrelax -Wl,-se ction-start=.text=0x7800 -mmcu=atmega328p -o MYSBootloader.elf MYSBootloader.o -lm "C:/Arduino/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom MYSBootloader .elf MYSBootloader.hex "C:/Arduino/hardware/tools/avr/bin/avr-size" MYSBootloader.elf text data bss dec hex filename 2036 6 72 2114 842 MYSBootloader.elf
-
@tekka Just wanted to check if the above log looks okay, currently rolling the bootloader out to 14 nodes (painful process!) and wanted to check if it looks okay before I do.
I'm also using this board.txt, I made a separate entry for my Uno's, do they all look okay? I basically used the fuses from the standard Arduino boards.txt with the change of 0x05 to 0x06 for the BOD? I noticed in the makefile that you can specify the fuses, do I need to compile a bootloader for each device with the exact fuses, or will one bootloader for 16 / 8 / 1Mhz suffice?
Thank you very much in advance, the bootloader is amazing work.
menu.cpu=Processor ############################################################## pro.name=MySensors Bootloader for Pro Mini pro.upload.tool=arduino:avrdude pro.upload.protocol=arduino pro.upload.maximum_size=30720 pro.upload.maximum_data_size=2048 pro.bootloader.tool=arduino:avrdude pro.bootloader.unlock_bits=0x3F pro.bootloader.lock_bits=0x0F pro.build.mcu=atmega328p pro.build.board=AVR_PRO pro.build.core=arduino:arduino pro.build.variant=arduino:standard ## Arduino with MYSBootloader Beta 2 ## ------------------------------------------------- ## pro.menu.cpu.16MHzatmega328=ATmega328 16MHz (XTAL, BOD1V8) 1.3 Beta 2 ## pro.menu.cpu.16MHzatmega328.upload.speed=115200 ## pro.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF ## pro.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA ## pro.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x06 ## pro.menu.cpu.16MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B2_16Mhz.hex ## pro.menu.cpu.16MHzatmega328.build.f_cpu=16000000L ## pro.menu.cpu.8MHzatmega328=ATmega328 8MHz (RC, BOD1V8) 1.3 Beta 2 ## pro.menu.cpu.8MHzatmega328.upload.speed=38400 ## pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xE2 ## pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA ## pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x06 ## pro.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B2_8Mhz.hex ## pro.menu.cpu.8MHzatmega328.build.f_cpu=8000000L ## pro.menu.cpu.1MHzatmega328=ATmega328 1MHz (RC/8, BOD1V8) 1.3 Beta 2 ## pro.menu.cpu.1MHzatmega328.upload.speed=9600 ## pro.menu.cpu.1MHzatmega328.bootloader.low_fuses=0x62 ## pro.menu.cpu.1MHzatmega328.bootloader.high_fuses=0xDA ## pro.menu.cpu.1MHzatmega328.bootloader.extended_fuses=0x06 ## pro.menu.cpu.1MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B2_1Mhz.hex ## pro.menu.cpu.1MHzatmega328.build.f_cpu=1000000L ## Arduino with MYSBootloader Beta 3 ## ------------------------------------------------- pro.menu.cpu.16MHzatmega328=ATmega328 16MHz (XTAL, BOD1V8) 1.3 Beta 3 pro.menu.cpu.16MHzatmega328.upload.speed=115200 pro.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF pro.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA pro.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x06 pro.menu.cpu.16MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B3_16Mhz.hex pro.menu.cpu.16MHzatmega328.build.f_cpu=16000000L pro.menu.cpu.8MHzatmega328=ATmega328 8MHz (RC, BOD1V8) 1.3 Beta 3 pro.menu.cpu.8MHzatmega328.upload.speed=38400 pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x06 pro.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B3_8Mhz.hex pro.menu.cpu.8MHzatmega328.build.f_cpu=8000000L pro.menu.cpu.1MHzatmega328=ATmega328 1MHz (RC/8, BOD1V8) 1.3 Beta 3 pro.menu.cpu.1MHzatmega328.upload.speed=9600 pro.menu.cpu.1MHzatmega328.bootloader.low_fuses=0x62 pro.menu.cpu.1MHzatmega328.bootloader.high_fuses=0xDA pro.menu.cpu.1MHzatmega328.bootloader.extended_fuses=0x06 pro.menu.cpu.1MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B3_1Mhz.hex pro.menu.cpu.1MHzatmega328.build.f_cpu=1000000L ############################################################## ############################################################## ############################################################## ############################################################## ############################################################## menu.cpu=Processor ############################################################## uno.name=MySensors Bootloader for Uno uno.upload.tool=arduino:avrdude uno.upload.protocol=arduino uno.upload.maximum_size=32256 uno.upload.maximum_data_size=2048 uno.bootloader.tool=arduino:avrdude uno.bootloader.unlock_bits=0x3F uno.bootloader.lock_bits=0x0F uno.build.mcu=atmega328p uno.build.board=AVR_UNO uno.build.core=arduino:arduino uno.build.variant=arduino:standard ## Arduino with MYSBootloader Beta 2 ## ------------------------------------------------- ## uno.menu.cpu.16MHzatmega328=ATmega328 16MHz (XTAL, BOD1V8) 1.3 Beta 2 ## uno.menu.cpu.16MHzatmega328.upload.speed=115200 ## uno.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF ## uno.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA ## uno.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x06 ## uno.menu.cpu.16MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B2_16Mhz.hex ## uno.menu.cpu.16MHzatmega328.build.f_cpu=16000000L ## Arduino with MYSBootloader Beta 3 ## ------------------------------------------------- uno.menu.cpu.16MHzatmega328=ATmega328 16MHz (XTAL, BOD1V8) 1.3 Beta 3 uno.menu.cpu.16MHzatmega328.upload.speed=115200 uno.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF uno.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA uno.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0x06 uno.menu.cpu.16MHzatmega328.bootloader.file=MYSBootloader/MYSBootloader_B3_16Mhz.hex uno.menu.cpu.16MHzatmega328.build.f_cpu=16000000L
-
@Mark-Swift What changes did you make to the bootloader - the code size seems increased
-
@tekka None that I'm aware of?
I just changed the fuses in the makefile to match the ones in my boards.txt, not sure if that's required, can you take a look at my questions above, I really want to be sure I'm doing all of this right before deploying.
To recap with regards the bootloader.
- Installed Windows 7
- Installed mingw (core and c++ compiler)
- Installed Arduino IDE and MySensors library (Installed at the same location as you, at c drive root)
- Downloaded bootloader from github
- Edited the fuses and clock speed at the top of the makefile to match my boards.txt
- Ran makefile from cmd
-
@Mark-Swift ok, most probably a false alarm. I assume you tested it after compilation?
-
@tekka It seems to work? I guess if there was an issue it wouldn't work at all?
Please can you conform my fuses look okay in the boards.txt I posted above? Also, do I need to change the fuses in the makefile and make a file for each device, or just 1 x 16Mhz and 1 x 8Mhz for example?
-
@Mark-Swift I'm not at my workstation right now - you have to adjust the fuse settings according to your HW configurations and preferences. The fuse settings in the makefile are obsolete if you use the Arduino IDE / boards.txt for flashing. Please use the AVR fuse calculator to calculate to correct fuse settings:
-
I @tekka, I thought as much, so basically I just need a bootloader with the right Mhz and then set fuses in the Arduino IDE boards.txt.
I used the fuse settings from the original boards.txt included with the Arduino IDE, but adjusted the extended one to 0x06 (Adjust BOD).
I noticed you used slightly different fuses to the Arduino IDE, you're using fuses that indicate a floating crystal or something?
-
First of all, thanks for working so hard on the new version of the BL.
My setup:
- MYSBootloader 1.3.0-beta3 (md5 49ef3dc263110613c9c25ac21a8c3d83)
- MYSController 1.0.0.beta (updated to latest version)
- GW on Arduino Nano
- Node on Arduino Pro Mini @ 5V 16 Mhz with MockMySensors sketch running
What I did:
- Flashed latest bootloader version from github on the Pro Mini ATMEGA328P (using AVRDUDESS 2.4 & USBasp, fuses L: 0xFF, H: 0xDA, E: 0x05)
- Flashed latest mysensors lib on both node & gw (tested with both 2.0.0 & 2.1) on the Nano
What I got:
- FW upgrade through MYSController: Working
- Reboot through MYSController: Working
- Serial flashing with Arduino IDE: Working
- Request presentation through MYSController: Working
Request heartbeat through MYSController: Working
But...
Reassign ID through MYSController: NOT WORKING (the node reboots but still preserves the old ID)
(MY_NODE_ID IS NOT DEFINED / THUS SET AS AUTO AS PER MYSENSORS DEFAULTS)
Clear EEPROM through MYSController: NOT WORKING (the node reboots but still holds the value saved in EEPROM using saveState)Node bootlog after Clear EEPROM from MYSBootloader (you can see my debug LOADSTATE which still loads the value 123 from EEPROM):
Starting sensor (RNNNA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=4) TSM:FPAR TSP:MSG:SEND 4-4-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 150-150-255 s=255,c=3,t=7,pt=0,l=0,sg=0: TSP:MSG:BC TSP:MSG:READ 0-0-4 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSM:CHKID:OK (ID=4) TSM:UPL TSP:PING:SEND (dest=0) TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-4 s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSP:MSG:PONG RECV (hops=1) TSP:CHKUPL:OK TSM:UPL:OK TSM:READY GW Started LOADSTATE 123
And...is it expected that the "Info" tab on my node shows bootloader version 1.2?
Is there anything I'm missing to have these features working?
Thanks in advance
-
@andreground Yes, re-assigning can be done nowadays with the MySensors framework, i.e. send a C_INTERNAL/I_ID_RESPONSE/<NEW ID> message to the (active) node.
-
@tekka is it okay to use the bootloader on the gateway?
-
@Mark-Swift That depends on the use case - what do you have in mind?
-
@tekka I'd like to put my gateway in quite an isolated place and update the sketches OTA, but I presume that's not possible as without the gateway live, there's nothing to action the OTA
I've tried the ESP as it allows OTA updates, but the ESP still has blocking code and it can't handle all my nodes without dropping messages.
-
I don't know if it the right place to ask, but I am planning to make a wired sensor network (I already have cables) like an RS485 or whatever better technology, so is there any good solution to implement OTA updates? Thanks
-
@tekka thanks, it works.
2 more questions:
- Should the clearing eeprom function in MYSBootloader be working?
- From what I understand, Watchdog is enabled by default (8S timeout) in the bootloader; that means that I've to either call wdt_reset in my loop or call wdt_disable in setup to prevent unexpected reboots. Am i right?
-
@andreground said in MYSBootloader 1.3.0-beta.3:
@tekka thanks, it works.
2 more questions:
- Should the clearing eeprom function in MYSBootloader be working?
No, this has also been moved to the MySensors framework:
Add:
If MY_DEBUG is disabled, you can add
#define MY_SPECIAL_DEBUG
and then send a C_INTERNAL / I_DEBUG / E to the node. For the sake of completeness, here are the special debug commands:
E: Clear EEPROM (node replies with OK and reboots)
V: Report CPU voltage in mV (if supported)
F: Report frequency in cHz
M: Report free memory
R: Report routing table (if node is a repeater/gateway)- From what I understand, Watchdog is enabled by default (8S timeout) in the bootloader; that means that I've to either call wdt_reset in my loop or call wdt_disable in setup to prevent unexpected reboots. Am i right?
wdt_reset() is called within the framework, so no need to call it unless you have blocking code of >8s. Alternatively, you can also disable it (AVR: if the wdton fuse is cleared).
-
I've never used the clear EEPROM feature but would like to.
I've added:
#define MY_SPECIAL_DEBUG
To my sketches. Using the latest MYSController, will the menu option 'Clear EEPROM' still do the trick, or does the application need some updates?
-
Hi,
Is there going to be 1 and 8MHz MySBootloader hex files?
Thanks!
-
@tekka, I tested this bootloader and facing an issue.
https://github.com/mysensors/MySensorsBootloaderRF24/issues/7
-
How do I do a remote reboot of a node? Node is not responding to MYSController command (I think due to changed things as with reassigning node-ID). DO I have to write a receive event or enable it somehow? Node is sleeping most time, maybe that's a problem.
-
I'm very interested in testing your development for the latest MYSBootloader as the bootloader for OTA updates on my new hardware designs that i'm starting to design, but i would like a stable one first to make sure my system and setup are working fine with the stable. Is the stable bootloader the one in the master branch of https://github.com/mysensors/MySensorsBootloaderRF24/tree/master. The MYSBootloader.hex file or does this still need to be compiled for use?
Or do you happen to have a download link for the stable version, should we be using the one that you bundle together with MYSController?
Also, @tekka - Do you advise a stable one that works for MyController.org please?
-
With this bootloader, i can not upload scetch with serial or USB.
Where does i made a mistake?
Is there a configuration that is specific to the bootloader?
Thanks
-
@Nicolas-Charrier Welcome to MySensors. Please do not post the same question in different threads. Maybe you can give additional information that help to understand what you tried so far (logs, screenshots, HW configuration, CPU frequency, etc.). Did you follow the OTA/bootloader instructions here?
-
@tekka
I can now program my board with serial line. It's work perfectly.
It's an issue with my serial converteur and an usb hub. The usb hub add a delay that is not compatible with the bootloader.
Sorry for the question.
Nico
-
@Nicolas-Charrier Good to know, thanks for your feedback
-
Excuse me for beeing an idiot. But how do you compile the bootloader from source? Do you do it from Atmel studio or from Arduino IDE. And how is it done? When I compile it in Atmel studio it gets an base adress of 0x0000 which is wrong.
I am used to program in assembler in Atmel studio and when I program in C i don't touch anyting else than the .c file. So some form of tutorial kind of thing would be helpful.
Thank you
-
Hey all,
I've compiled the bootloader and was able to install it with Arduino as ISP to a Nano. I couldn't find the lines necessary for the Nano in boards.txt so I created this:
############################################################## nanomysbootloader.name=Arduino Nano MYSBootloader nanomysbootloader.upload.tool=avrdude nanomysbootloader.upload.protocol=arduino nanomysbootloader.bootloader.tool=avrdude nanomysbootloader.bootloader.unlock_bits=0x3F nanomysbootloader.bootloader.lock_bits=0x0F nanomysbootloader.build.f_cpu=16000000L nanomysbootloader.build.board=AVR_NANO nanomysbootloader.build.core=arduino nanomysbootloader.build.variant=eightanaloginputs ## Arduino Nano w/ ATmega328 ## ------------------------- nanomysbootloader.menu.cpu.atmega328=ATmega328 nanomysbootloader.menu.cpu.atmega328.upload.maximum_size=30720 nanomysbootloader.menu.cpu.atmega328.upload.maximum_data_size=2048 nanomysbootloader.menu.cpu.atmega328.upload.speed=115200 nanomysbootloader.menu.cpu.atmega328.bootloader.low_fuses=0xFF nanomysbootloader.menu.cpu.atmega328.bootloader.high_fuses=0xDA nanomysbootloader.menu.cpu.atmega328.bootloader.extended_fuses=0xFD nanomysbootloader.menu.cpu.atmega328.bootloader.file=MySensors/MYSBootloader.hex nanomysbootloader.menu.cpu.atmega328.build.mcu=atmega328p
Is this correct? Besides, on some devices I cannot program over serial anymore now, only through another ISP. Could that be caused by incorrect settings? Is it possible to recover from that?
The error I'm getting is this one:
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x32Thanks and happy easter!
Rene
-
Hi All,
I'm currently upgrading to MySensors 2.0.0 and it would make sense to change over to the MYSBootloader as I upgrade each node. (I'd like to be able to use the remote re-boot command from MYSController).
I have been reading about the MYSBootloader and have some questions . . .
Q1 - My nodes are a mixture of Pro-Micro's, Leonardo's, Mega 2560's and the odd UNO. From what I can see, the MYSbootloader.hex file is for the Mega328p, is this correct, or can the same bootloader be adjusted (fuse settings etc) for others like the Leonardo processor?
Q2 - One post I read seemed to imply that to use the remote reboot feature you needed 'either' the MYSBootloader OR OptiBoot. In the OptiBoot readme, it doesn't mention reboot as a feature, so I am wondering if it really does support reboot - can anyone please confirm?
Many thanks,
Paul
-
Q1) Yes, correct.
Q2) The reboot is handled automatically when new firmware has been downloaded by the library. Note: When using DualOptiboot you must also enable the MY_OTA_FIRMWARE_FEATURE when compiling the sketch to allow updates.
-
Hi,
Is it possible to add support for rs485 network? In my opinion bootloader which exists need only de-pin management. I'm using hardware serial (rx tx) in nod's.
-
Can someone please tell me how long it is supposed to take to upload a hex file with MYSBootloader. I am trying out OTA Updates with the latest dev branch of MYSBootloader and it takes almost 2 hours to upload a 64k hex file. Is this normal or should it be a lot quicker?
-
How far is the node from gateway? It should take much less time actually
-
@gohan I have tried 2 different nodes in 2 different locations. The one node is about 8m away from the gateway. The other node is around 12m away.
-
Ok, if you put it like 2 meters away do you notice any difference?
-
@gohan Seems to be taking the same time at 2 meters apart. Can you tell me how long it should take to do an OTA update? You say "much less time" .. what should it take for a 64k update?
-
I don't have direct experience (I am waiting for my mini pro to be delivered) but I read other sending in around 10 minutes but I don't know what was the hex file size.
I asked for the distance just to make sure it wasn't related to range issues.
-
I am getting good range here. I have a repeater node (not using MYSBootloader yet) that is 100m away and works fine and another node 200 to 300m away (hence the repeater at 100m). The far node was dropping some messages but that is not too critical as its only a water tank level sensor. I plan to put in a long range PA+SMA type nrf24L01 on that one. The gateway and repeater already have the long range nrf's. I am now testing OTA to a weather station node that is just outside - around 10m from gateway. And I have a test node on my desk around 8m from the gateway. Both the weather station and the test node on my desk give same results for OTA - around 30min or so for every 20k of hex file.
-
how long is the sleep time of your nodes?
-
@gohan The weather station does not sleep - it uses wait() and does so for 5 seconds every loop. The test node first waits for 5 seconds then sleeps for 55 seconds. Both these node seem to update at the same rate. However, it also seems MYSBootloader does the firmware update then launches the sketch code, so the wait / sleep cycle is irrelevant as it first updates the bootloader then runs the sketch
-
it is relevant because if it is long, the node will start the ota update only when it exits the sleep, so I was just making sure you didn't overlooked that
-
@gohan not overlooked All seems to be working - range is good, MYSBootloader and OTA updates work. It just incredibly slow. It seems to do some message updates then pause for maybe 5 seconds or so, then carry on going. So when there are 1000 messages - these 5 sec pauses probably add up to what is making it take hours instead of minutes
-
@slt1 If you are using
wait()
to repeat some function. I recommend using http://playground.arduino.cc/Code/SimpleTimer, to avoid complete blocking when executingwait()
.
-
@jkandasa Thanks for the help, but the problem I am having cannot be in the sketch. The firmware update does gets started after a reboot. So that part is all working fine. Once the firmware is updating then no sketch code runs until it completes. The firmware updating is what is very very slow
-
@slt1 I hope you are also facing this kind of issue: https://github.com/mysensors/MySensorsBootloaderRF24/issues/12
-
@jkandasa I added some basic shielding around NRF's and now getting the 60Kb hex file transferred in around 15 minutes (was 2 hours!), and a 30Kb hex file transferred in about 7 minutes (prev was about 1 hour). So its a lot better, but still rather slow ! I am not sure if that is a good transfer rate for OTA and if what I am now getting can still be improved. I cannot find any information on what transfer speeds one should expect with OTA updates.
I am also using MyController, but using the 5V / 16Mhz MySBootloader file in development branch. So I am not sure if my issue is same as yours.
-
@slt1 Thanks for the detailed information. If you have enough time would you mind to give a try to https://forum.mysensors.org/topic/4991/mysbootloader-1-3pre2-testing ?
Bootloader link: https://forum.mysensors.org/uploads/files/1475275020003-mysbootloader_v13pre2.zip
-
@jkandasa Using the bootloader in your zip file link I get the same result - around 15 minutes for a 60KB hex sketch file. I used MyController - not MYSController.
Can you please tell me how long it takes you to do an OTA update - the time + hex file size?
-
@slt1 Thanks for the report. I tested on two different nodes. Controller: MyController.org. Gateway MQTT(ESP8266), Radio: NRF24L01+
- 8 MHz internal crystal on the noisy environment: for 47K hex file takes 6 minutes and 42 seconds
- 16 MHz external crystal on clean environment: for 26K hex file takes 36 seconds
Bootloaders I use: https://forum.mysensors.org/uploads/files/1475275020003-mysbootloader_v13pre2.zip
Initial days I face coverage problem with NRF24L01+. I changed my antenna as per this specification, from this point I see notable improvement on coverage.
-
@jkandasa Thank you very much ! That is very helpful. It seems like you are getting excellent update speed.
For my testing of OTA the test sensor node is about 8m away from Gateway.
I am also using MyController.org, Gateway is ESP8266 (Ethernet), Radio NRF24L01+ (PA+LNA 1.1km range like the one shown here)
Current "live" sensor nodes are ...
Gateway (with PA+LNB) <------ 100 to 120m -----> Repeater Node / Pump Control Sensor (with PA+LNB) <-------- 120m to 150m -------> Water Tank Level Sensor (PCB antenna nrf24l01)To get that range it needs good line of sight which luckily I have.
I will look into the antenna mod as well though, so thank you for the tips. I would be very happy if I can get about 1 to 2 minutes for updates on 16Mhz sensors.
-
@jkandasa I tried the modified antenna out and also removed the adapter board for the nrf and soldered a header in close to the arduino pro mini to insert the nrf24l01. And after doing, with all other sensor nodes turned off I can now get around 5 seconds for blink, about 30 seconds for TimeReporter and about 60 seconds for the 60kb custom sketch.
So thank you for the tip on antenna mod. That does help. The major issue I think though was the adapter board for the nrf24l01 - for some reason that was causing lots of pauses in the OTA updates.The tests were all using MYSController - the windows app.
I am having a few strange issues MYController.org. It appears to be getting stuck when doing a few updates in a row and also I can't seem to roll back to a previous version.
-
What adapter were you using?
-
@gohan The manufacturer on the bottom of the board says robotdyn.com - lookinf at their website this is the exact one : http://robotdyn.com/catalog/adaptors/socket_adapter_for_nrf24l01_with_regulator_3_3v/
-
that is missing the decoupling capacitor. Did you solder one yourself?
-
@gohan I soldered a 4.7uF tantulum capacitor directly onto the nrf24L01. Didn't help !
-
did you try a bigger one like 47uF? Or maybe that voltage regulator is just rubbish
-
I use these adaptor boards, I presumed they worked okay, what is missing @gohan, are the capacitors present on other adapter boards do you know? BTW the robotdyn stuff seems very well made but I've actually found their NRF's to perform very poorly.
-
@gohan The regulator is an AMS1117 on the one I got here. I will try them again as they are useful for prototyping. It was working fine for a regular sensor sending updates, but got into the issues when using OTA and trying to get some decent speed of updates going. I also thought perhaps it was a dud unit - so i tried a few others and all gave same results. So perhaps a bigger capacitor will do the trick.
-
I got some adapters on gearbest (there is only one model available) and they have also caps and so far they are working, but haven't stressed them much because my nrf modules are rubbish and I am waiting for some new ones
-
This is my first post in this forum - so hello everyone! And many kudos for all developers and contributors.
I am on my way of building distributed sensors and actuators system for astroimagers, and would love to have OTA firmware update possibility. I use nR24L01 radio and each node will be based on Atmega328 working at internal 8MHz and 3V, and have two questions:- which bootlader hex should I write?
- does MYSbootloader support programming via serial? I tried several hex files with several fuses combinations and never succeeded to program Atmega328P via serial
-
Welcome @jolo !
All you need should be available at https://www.mysensors.org/about/ota
If it isn't, feel free to ask awaySounds like a cool project. Can you share more details?
-
Ok, what I've done so far according to https://www.mysensors.org/about/ota:
- connected USBasp to Arduino Pro Mini and set fuses to 16MHz external oscillator (using AVRDUDESS)
- then tried to upload MYSbootlader using Arduino IDE (versions 1.6.11 and 1.8.1) but it failed with some "cannot set sck period"
- so I uploaded bootloader with AVRDUDESS
Question is - at this stage should I be able to program Arduino Pro Mini with serial programmer, or now it can be done only using OTA? Because I am not able to do it with serial programmer and Arduino IDE.
Burning bootloader with AVRDUDESS works fine because I changed it many times from original to MYSbootlader, also programming Arduino with precompiled sketch works fine.
I will describe my project little bit later, when I will have more nodes working Currently I am on stepper motor controller node.
-
@jolo yes, MYSbootlader supports only ota. No serial.
I have updated the ota page to mention the lack of serial.