Windows GUI/Controller for MySensors



  • This is the most helpful tool I used since I started messing around with mysensors.

    I hate to nag but this tool source code would be a giant step to someone looking to create a new controller by himself.
    .



  • Hello, how to verify right bootloader is uploaded to arduino?

    I'm using two Arduino Pro Mini 328 5.0V 16Mhz, one as ArduinoISP programmer and one as sensor node to upload bootloader and firmware.

    I followed manual (http://forum.mysensors.org/topic/838/windows-gui-controller-for-mysensors/76) step by step.

    I have tried MYSBootloader.hex coming from latest MYSController 0.1.2.280 and MYSBootloader.hex (1.1) from github with same results.

    Upload log is here:

    C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM10 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x06:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xF7:m 
    
    avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
    
             Using Port                    : COM10
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f
    avrdude: erasing chip
    avrdude: reading input file "0x3F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.03s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    avrdude: reading input file "0x06"
    avrdude: writing efuse (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    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.01s
    
    avrdude: verifying ...
    avrdude: 1 bytes of efuse verified
    avrdude: reading input file "0xDA"
    avrdude: writing hfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.03s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of hfuse verified
    avrdude: reading input file "0xF7"
    avrdude: writing lfuse (1 bytes):
    
    C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM10 -b19200 -Uflash:w:C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex:i -Ulock:w:0x0F:m 
    
    avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Writing | ################################################## | 100% 0.02s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lfuse verified
    
    avrdude done.  Thank you.
    
    Wunsch
    
             System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
    
             Using Port                    : COM10
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.06s
    
    avrdude: Device signature = 0x1e950f
    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: reading input file "C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex"
    avrdude: writing flash (32722 bytes):
    
    Writing | ################################################## | 100% -0.00s
    
    avrdude: 32722 bytes of flash written
    avrdude: verifying flash memory against C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex:
    avrdude: load data flash data from input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex:
    avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex contains 32722 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.02s
    
    avrdude: verifying ...
    avrdude: 32722 bytes of flash verified
    avrdude: reading input file "0x0F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.05s
    
    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.01s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    
    avrdude done.  Thank you.
    
    

    Fuses looks like right:

    avrdude: Device signature = 0x1e950f
    avrdude: safemode: lfuse reads as F7
    avrdude: safemode: hfuse reads as DA
    avrdude: safemode: efuse reads as 6
    

    MYSController log after node with new bootloader start:

    14.06.2015 10:14:46	STARTUP	Initialize message logging
    14.06.2015 10:14:46	STARTUP	MYSController 0.1.2.280
    14.06.2015 10:14:46	STARTUP	FPC 2.6.4 / Lazarus 1.4
    14.06.2015 10:14:46	STARTUP	still under development :) tekka 2015
    14.06.2015 10:14:46	STARTUP	Load INI file...
    14.06.2015 10:14:46	STARTUP	INI version 0.1.2.280
    14.06.2015 10:14:46	INFO	*** Logging START ***
    14.06.2015 10:14:46	VERSION	MYSController 0.1.2.280
    14.06.2015 10:14:46	STARTUP	INI file loaded
    14.06.2015 10:14:46	STARTUP	Loading FW repository...
    14.06.2015 10:14:46	REPO	FW "Blink" loaded. t=10, v=1, blocks=72, crc=0xD098
    14.06.2015 10:14:46	REPO	FW "TimeReporter" loaded. t=20, v=1, blocks=840, crc=0x4AC5
    14.06.2015 10:14:46	REPO	FW repository loaded. Items=2
    14.06.2015 10:14:46	STARTUP	Initialize message types
    14.06.2015 10:14:46	NODE	New node discovered, node id=0
    14.06.2015 10:14:46	NODE	New node discovered, node id=255
    14.06.2015 10:14:49	INFO	Connected to 192.168.0.1:12345
    14.06.2015 10:14:59	UPDATE	4295098648
    14.06.2015 10:21:26	CHILD	New child discovered, node id=0, child id=0
    14.06.2015 10:21:26	RX	0;0;3;0;9;read: 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
    14.06.2015 10:21:26	RX	0;0;3;0;9;send: 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,st=bc:0
    14.06.2015 10:21:28	RX	0;0;3;0;9;read: 3-3-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
    14.06.2015 10:21:28	RX	0;0;3;0;9;send: 0-0-3-3 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0
    14.06.2015 10:21:30	RX	0;0;3;0;9;read: 3-3-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
    14.06.2015 10:21:30	NODE	New node discovered, node id=3
    14.06.2015 10:21:30	CHILD	New child discovered, node id=3, child id=internal
    14.06.2015 10:21:30	TX	3;255;3;0;6;M
    14.06.2015 10:21:30	RX	3;255;3;0;6;0
    14.06.2015 10:21:30	RX	0;0;3;0;9;send: 0-0-3-3 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=255,c=3,t=11,pt=0,l=7,sg=0:Balcony
    14.06.2015 10:21:32	RX	3;255;3;0;11;Balcony
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    14.06.2015 10:21:32	RX	3;255;3;0;12;1.0
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=1,c=0,t=16,pt=0,l=20,sg=0:Photoconductive Cel
    14.06.2015 10:21:32	CHILD	New child discovered, node id=3, child id=1
    14.06.2015 10:21:32	DEBUG	Update child id=1, type=LIGHT_LEVEL
    14.06.2015 10:21:32	RX	3;1;0;0;16;Photoconductive Cell
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=2,c=0,t=6,pt=0,l=3,sg=0:ds0
    14.06.2015 10:21:32	CHILD	New child discovered, node id=3, child id=2
    14.06.2015 10:21:32	DEBUG	Update child id=2, type=TEMP
    14.06.2015 10:21:32	RX	3;2;0;0;6;ds0
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=3,c=0,t=6,pt=0,l=3,sg=0:ds1
    14.06.2015 10:21:32	CHILD	New child discovered, node id=3, child id=3
    14.06.2015 10:21:32	DEBUG	Update child id=3, type=TEMP
    14.06.2015 10:21:32	RX	3;3;0;0;6;ds1
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=4,c=0,t=6,pt=0,l=3,sg=0:ds2
    14.06.2015 10:21:32	CHILD	New child discovered, node id=3, child id=4
    14.06.2015 10:21:32	DEBUG	Update child id=4, type=TEMP
    14.06.2015 10:21:32	RX	3;4;0;0;6;ds2
    14.06.2015 10:21:32	RX	0;0;3;0;9;read: 3-3-0 s=5,c=0,t=6,pt=0,l=3,sg=0:ds3
    14.06.2015 10:21:32	CHILD	New child discovered, node id=3, child id=5
    14.06.2015 10:21:32	DEBUG	Update child id=5, type=TEMP
    14.06.2015 10:21:32	RX	3;5;0;0;6;ds3
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=6,c=0,t=6,pt=0,l=3,sg=0:ds4
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=6
    14.06.2015 10:21:33	DEBUG	Update child id=6, type=TEMP
    14.06.2015 10:21:33	RX	3;6;0;0;6;ds4
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=7,c=0,t=6,pt=0,l=3,sg=0:ds5
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=7
    14.06.2015 10:21:33	DEBUG	Update child id=7, type=TEMP
    14.06.2015 10:21:33	RX	3;7;0;0;6;ds5
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=8,c=0,t=6,pt=0,l=3,sg=0:ds6
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=8
    14.06.2015 10:21:33	DEBUG	Update child id=8, type=TEMP
    14.06.2015 10:21:33	RX	3;8;0;0;6;ds6
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=9,c=0,t=6,pt=0,l=3,sg=0:ds7
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=9
    14.06.2015 10:21:33	DEBUG	Update child id=9, type=TEMP
    14.06.2015 10:21:33	RX	3;9;0;0;6;ds7
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=10,c=0,t=6,pt=0,l=3,sg=0:ds8
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=10
    14.06.2015 10:21:33	DEBUG	Update child id=10, type=TEMP
    14.06.2015 10:21:33	RX	3;10;0;0;6;ds8
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=11,c=0,t=6,pt=0,l=3,sg=0:ds9
    14.06.2015 10:21:33	CHILD	New child discovered, node id=3, child id=11
    14.06.2015 10:21:33	DEBUG	Update child id=11, type=TEMP
    14.06.2015 10:21:33	RX	3;11;0;0;6;ds9
    14.06.2015 10:21:33	RX	0;0;3;0;9;read: 3-3-0 s=1,c=1,t=23,pt=2,l=2,sg=0:49
    14.06.2015 10:21:33	RX	3;1;1;0;23;49
    14.06.2015 10:21:36	RX	0;0;3;0;9;read: 3-3-0 s=3,c=1,t=0,pt=7,l=5,sg=0:26.5625
    14.06.2015 10:21:36	RX	3;3;1;0;0;26.5625
    14.06.2015 10:21:37	RX	0;0;3;0;9;read: 3-3-0 s=1,c=1,t=23,pt=2,l=2,sg=0:49
    14.06.2015 10:21:37	RX	3;1;1;0;23;49
    

    Node successfully start and connecting to gateway with new bootloader, but then I issue reboot command in MYSController, node hangs up completely, even reset button isn't working. Only power off, then power on helps. Assign firmware isn't working also (nothing happens).


  • Admin

    @robosensor said:

    The MYSBootloader.hex file you are flashing has a wrong file size (=32722 bytes) in your post:

    avrdude: reading input file "C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/MySensors/MYSBootloader.hex"
    avrdude: writing flash (32722 bytes):

    MYSBootloader 1.1 should have ~2kb

    From your log I assume, that you flashed the sketch instead of the bootloader.

    Please pay attention to steps 3 and 13 from the step-by-step manual.



  • @tekka I have noticed this, but I thought that this is due to the peculiarities of bootloader upload process (upper end of memory).

     Directory of C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders\MySensors
    
    14.06.2015  00:08    <DIR>          .
    14.06.2015  00:08    <DIR>          ..
    14.06.2015  09:59             5 548 MYSBootloader.hex
                   1 File(s)          5 548 bytes
    

    For sketch size is too big (32722 bytes), real sketch size is 19928 bytes.

    In any case, thanks for the help, I'll try to figure it out or try to download it manually using avrdude.



  • @tekka
    Hello, could you help me with uploading bootloader. I stuck on Step 5 step-by-step manual and get error

    Arduino: 1.6.4 (Mac OS X), Плата"ATmega328 16Mhz MYSBootloader"
    avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
    
    

    I`m using 16Mhz pro mini clone and FTDI232



  • @tekka I have googled for [avrdude bootloader "bytes of flash written"] and found many answers about big upload size for bootloader (> 32000 bytes). It seems that big size is the way it should be.

    I have solved problem. I must power up node with newly burned bootloader but without sensor node firmware and upload firmware using MYSController

    Incorrect way is: burn bootloader, burn sensor node firmware, powerup sensor.

    Thank you for great software! 🙂


  • Admin

    @NewFolk You'll need e.g. USBasp or ArduinoISP to flash a new bootloader. If you have a spare Arduino and FTDI232, follow this tutorial to program a new bootloader using the Arduino IDE.

    Good luck! 🙂


  • Admin

    @robosensor Yes, the sensor firmware is uploaded OTA via MYSController.



  • Hi - I need some clarification.
    I have mysensors connected to my vera lite (working)
    I bought 3 of the sensebender micro boards and got them talking with the gateway (working)
    loaded up myscontroller it's running and see the gateway and all 3 nodes.
    yay!
    the issue is the sensors are reporting in C instead of F, so i modified the sketch, compiled it, found the hex file (66k)
    and moved it to the correct folder per instructions.
    when i says "assign FW" nothing happens.
    am i understanding correctly that "firmware" is just a compiled sketch?
    if i need to make changes to my device, is this the correct way?
    modify sketch - > compile -> move hex to myscontroller folder - > edit firmware_config file -> right click assign fw -> pick new firmware
    is that correct?
    nothing is happening for me when i do that..
    please clarify.
    thanks!

    edit: file size says 66k in win7
    but in the compiler it says
    Sketch uses 23,724 bytes (77%) of program storage space. Maximum is 30,720 bytes.
    Global variables use 822 bytes (40%) of dynamic memory, leaving 1,226 bytes for local variables. Maximum is 2,048 bytes.

    the file i grabbed was SensebenderMicro.cpp.hex


  • Admin

    @mvader said:

    when i says "assign FW" nothing happens.
    am i understanding correctly that "firmware" is just a compiled sketch?
    if i need to make changes to my device, is this the correct way?
    modify sketch - > compile -> move hex to myscontroller folder - > edit firmware_config file -> right click assign fw -> pick new firmware
    is that correct?
    nothing is happening for me when i do that..

    For OTA updates you need to burn the MYSBootloader (instructions here). Once done, assign FW, reboot node and wait until FW is transferred.

    edit: file size says 66k in win7
    but in the compiler it says
    Sketch uses 23,724 bytes (77%) of program storage space. Maximum is 30,720 bytes.

    Yup, because the .hex file is not binary but a hex (hence the suffix) format with headers and checksums.



  • @tekka said:

    @mvader said:

    when i says "assign FW" nothing happens.
    am i understanding correctly that "firmware" is just a compiled sketch?
    if i need to make changes to my device, is this the correct way?
    modify sketch - > compile -> move hex to myscontroller folder - > edit firmware_config file -> right click assign fw -> pick new firmware
    is that correct?
    nothing is happening for me when i do that..

    For OTA updates you need to burn the MYSBootloader (instructions here). Once done, assign FW, reboot node and wait until FW is transferred.

    edit: file size says 66k in win7
    but in the compiler it says
    Sketch uses 23,724 bytes (77%) of program storage space. Maximum is 30,720 bytes.

    Yup, because the .hex file is not binary but a hex (hence the suffix) format with headers and checksums.

    I thought i read those sensebender boards were going to come pre-burned with the MYSBootloader from the mfg? that why you wouldn't need a programmer. i'll check with those folks..

    edit: i found where they said it was pre-programmed..

    @hek said:

    Yes, FTDI, ISCP or over-the-air updates.

    It comes pre-programmed with MySensors variant of the DualOptiboot-bootloader.
    https://github.com/mysensors/DualOptiboot
    Which can take advantage of the extra flash memory to do a safe over-the-air firmware update.
    It comes pre-programmed with MySensors variant of the DualOptiboot-bootloader.
    https://github.com/mysensors/DualOptiboot
    Which can take advantage of the extra flash memory to do a safe over-the-air firmware update.



  • This post is deleted!


  • I have a some questions. Couldnt find answer anywhere.

    If I am using an arduino connected to the serial port on a Raspberry pi (w/openhab) How do I assign fw, reboot, etc?

    Do I need to disconnect the GW and use windows temporarily to reboot, update fw? or can I have 2 GW's?

    I updated my nano with the MYS bootloader, and after I power it on, it never shows up in MYSController.



  • @tekka Hey, it seems like the downloadlink is broken. Can you check?



  • i dont understand how to use this...
    Can somebody explain it?


  • Admin



  • Yes I tried now again an now it works. Maybe something temporary with Dropbox yesterday



  • It is possible to burn the bootloader to an Arduino Uno right? (if not please skip below and I will rtfm some more)

    Could anyone please explain me what I am doing wrong here? I use avrdudess (http://blog.zakkemble.co.uk/avrdudess-a-gui-for-avrdude/) to program the bootloader.hex (also tried the supplied method) but no dice;

    Writing the bootloader seems to work;

    Detected 1e950f = ATmega328P
    MYSBootloader.hex: 2.002 / 32.768 Bytes (6,11%)
    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
    
    avrdude.exe: set SCK frequency to 1500000 Hz
    avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude.exe: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: Device signature = 0x1e950f
    avrdude.exe: erasing chip
    avrdude.exe: set SCK frequency to 1500000 Hz
    avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude.exe: reading input file "C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex"
    avrdude.exe: input file C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex auto detected as Intel Hex
    avrdude.exe: writing flash (32722 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude.exe: 32722 bytes of flash written
    avrdude.exe: verifying flash memory against C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex:
    avrdude.exe: load data flash data from input file C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex:
    avrdude.exe: input file C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex auto detected as Intel Hex
    avrdude.exe: input file C:\Users\codar\Desktop\MYSController_0_1_2_280\Bootloader\MYSBootloader.hex contains 32722 bytes
    avrdude.exe: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: 32722 bytes of flash verified
    

    However tech life wouldn't be techlife without days of endless debugging

    Setting the extended fuse fails verification

    avrdude.exe: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: 32722 bytes of flash verified
    avrdude.exe: reading input file "0xF7"
    avrdude.exe: writing lfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude.exe: 1 bytes of lfuse written
    avrdude.exe: verifying lfuse memory against 0xF7:
    avrdude.exe: load data lfuse data from input file 0xF7:
    avrdude.exe: input file 0xF7 contains 1 bytes
    avrdude.exe: reading on-chip lfuse data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: 1 bytes of lfuse verified
    avrdude.exe: reading input file "0xDA"
    avrdude.exe: writing hfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude.exe: 1 bytes of hfuse written
    avrdude.exe: verifying hfuse memory against 0xDA:
    avrdude.exe: load data hfuse data from input file 0xDA:
    avrdude.exe: input file 0xDA contains 1 bytes
    avrdude.exe: reading on-chip hfuse data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: 1 bytes of hfuse verified
    avrdude.exe: reading input file "0xFE"
    avrdude.exe: writing efuse (1 bytes):
    
    Writing |  ***failed;  
    ################################################## | 100% 0.03s
    
    avrdude.exe: 1 bytes of efuse written
    avrdude.exe: verifying efuse memory against 0xFE:
    avrdude.exe: load data efuse data from input file 0xFE:
    avrdude.exe: input file 0xFE contains 1 bytes
    avrdude.exe: reading on-chip efuse data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: verification error, first mismatch at byte 0x0000
                 0x06 != 0xfe
    avrdude.exe: verification error; content mismatch
    
    avrdude.exe done.  Thank you.
    

    This last error is giving me headaches, why the "first mismatch at byte 0x0000 0x06 != 0xfe" error?

    Really hope someone can enlighten me...


  • Admin

    @cdr the efuse only uses the lower 3 bits: with AVRDude set 0x06, with AVRStudio set 0xFE. You can verify this with the fuse calculator.



  • I try to uplaod sketch via OTA but it doesn''t work.
    I have sensebender with stock bootloader. Gateway is connect to an ODROID C1 with ser2net and i connect to ser2net. I can see all incoming traffic for my sensors.
    I upload sensebender default sketch from dev branch using MySensors dev branch too.
    I tell MYSController sensors is battery powered.
    I try with the two provided example but nothing happen in log or anything else



  • @Fabien said:

    I try to uplaod sketch via OTA but it doesn''t work.
    I have sensebender with stock bootloader. Gateway is connect to an ODROID C1 with ser2net and i connect to ser2net. I can see all incoming traffic for my sensors.
    I upload sensebender default sketch from dev branch using MySensors dev branch too.
    I tell MYSController sensors is battery powered.
    I try with the two provided example but nothing happen in log or anything else

    check in the sensebender announcement thread. I had the same question. Hek responded with what needed to be done to make it work.
    I didn't get a chance to try his solutions yet to see if it works. if you do, post and let us know.

    edit: here
    http://forum.mysensors.org/topic/1345/sensebender-micro/139


  • Contest Winner

    @Fabien
    I dont understand what you mean by "I told MysController" that the node is battery powered. It should find that out automatically I think. Anyway I'm pretty sure that I read somewhere that battery powered sensors cant be updated OTA. (If it relly is battery powered). I think I read a define somewhere that disables the firmware low level commands in the MySensors Library if the Node is battery powered.


  • Admin

    @Dirk_H said:

    I think I read a define somewhere that disables the firmware low level commands in the MySensors Library if the Node is battery powered.

    No there isn't. But battery powered sensors most likely sleep most of the time so they won't receive any update command. And a fw updates over-the-air would probably drain batteries pretty quick.



  • @tekka I feel really, really, REALLY stupid;

    I changed the channel in the mysensors config.h to 77, this was the reason no node would ever show up since the default mysbootloader uses the default channel 76.

    D'OH

    Thanks for your patience and help, everything is working now and I'm really happy!
    👍



  • Hi. I was wondering if someone could get the irrigation controller working with this program?
    I'm new to this all, and so far this the easiest controller that I came across. ( got the gateway etc working with almost no effort)



  • Hi, nice work. Is there any chances that you add the possibility to log the nodes information to a mysql database ?



  • Hi @tekka
    I am having trouble understanding the error codes on this gui.

    It is the solar mini weather stn on proto board and it is not working properly.

    At this minute I see that the g/w code is telling me 4-4-5-0 ,there was a node 5 in my My Sensors package and it was configured as a repeater but it is not here as it connected laptop> usb port/cord> ftdi 3.3v> 3.3 v promini.
    As the code cannot get to and from node 5 it is a down as a st=fail

    Is there a why to change this in your program to allow continuing debugging my sketch?

    Am I again missing something?
    Thanks



  • Sorry @tekka forgot the pic.Screenshot (62).png


  • Admin

    @5546dug the log looks like a sensor log, try connecting MYSController to the gateway...


  • Hero Member

    Hello guys, I'm trying to burn the MYSBootloader.hex into some Pro minis (clones) here, however after burning it, they get somehow 'bricked' :

    • I'm using my Uno "as ISP" on IDE 1.6.4
    • I've followed the step-by-step tutorial posted above by @tekka
    • My pro-minis are 5V, 16Mhz, external clock , 328p, supposedly a perfect match with 'boards.txt' info...
    • "Burn bootloader" ends successful, with "Done burning boot loader" message.
    • After that, the pro-mini pin 13 led flashes in a kind of random pattern, and it is not possible to upload any sketch, nor any kind of serial monitor on any speed.
    • I can revert it, by selecting the standard 'Arduino Pro or Pro Mini' board , and burn boot loader again. It makes the pro-mini gets back to live, I can upload my sketches and serial monitor it.

    So my questions:

    • I don't have extra eprom connected --- Is it mandatory? I've read somewhere that it can be disabled, but can't find the instructions anymore...
    • Fuse adjustments?
    • What else can I do in order to troubleshooting it?

    Thanks!


  • Hardware Contributor

    @rvendrame: it seems to be wrong fuses. MYSBootloader does not use extra eeprom. It's DualOptiboot which uses one. You need to set fuses. Then burn bootloader. For fuses you need to look in boards.txt . It should work. For setting fuses, I use usbasp. I never tried with uno.


  • Hero Member

    @scalz, thanks for the reply. BTW, did you see this?

    Well, with standard bootloader (working), my pro-minis have fuses as FF DA 05 (Low/High/Ext).

    The MYSBootloader.hex boot loader (not working) is set in boards.txt with F7 DA 06.

    I have played with all possible combinations (including changing values in boards.txt), no luck.

    Maybe I have to compile my own version of MYSBootloader? Sorry, this is all new to me...

    Thx again


  • Hardware Contributor

    @rvendrame: Hi I don't have a mac. But I use a similar tool for win (avrdudess). but your link seems ok.
    You don't have to recompile MYSBootloader. MYSBootloader needs to match fuses. If not, it will blink like you have seen. Do you have an usbasp? very useful. So you need to burn fuses F7 DA 06. Did you try that? And then burn bootloader.
    Be careful when burning fuses, don't try combination or you will semi-brick atmel chip (meaning you could not be able to reprogram it normal spi way). Never enable RSTDISBL and DWEN bits in fuse. You can see all of this here http://www.engbedded.com/fusecalc/ very useful too!

    If in future you want to test new ota, I have made a small breadboard to test it. You can find it here : https://oshpark.com/profiles/scalz You will need to solder eeprom and atsha.


  • Hero Member

    @scalz, yes I have tried to burn fuses F7 DA 06, and then MYSBootloader, no joy.

    Maybe the main diference is the low fuse F7 ( = Ext.Clock full-swing Crystal ) , as my pro-minis run fine with FF ( = Ext. Crystal Osc 8.MHz ) ?


  • Hero Member

    @scalz , one more thing: What speed did you set? The AVRFuses seems to work on at 19200 bps --- Could this be a problem?
    And moreover --- You mentioned that extra eprom is not required --- But what about atsha? I don't have that either... (just pro-mini + radio ). Is it required for OTA?


  • Hardware Contributor

    @rvendrame: I am not at home at this moment. but I will check. baudrate is already set up in .hex and in boards.txt . So I think it should work..strange thing. I don't know MYSBootloader so. maybe grandmaster @Tekka have an idea😀 maybe something has changed. I don't know.

    extra eeprom is for new ota in mysensors 1.5
    ATSHA is optional, it is just on the board too. It is for authentication in 1.5 too.


  • Hero Member

    @scalz said:

    extra eeprom is for new ota in mysensors 1.5

    I'm using 1.5 --- So do I need the extra eprom ?


  • Hardware Contributor

    no. you don't need it.
    two ota bootloaders are available for mysensors. MYSBootloader and Dualoptiboot. MYSBootloader does not require extra eeprom. Dualoptiboot needs it. sorry for confusion😏


  • Hero Member

    @scalz said:

    MYSBootloader does not require extra eeprom.

    No problem, that's clear. Any other idea? The only thing I could progress was to catch the firmware upload in verbose mode (see bellow, it looks ok to me).

    One question: Is it okay to have "Boot Flash size = 1024 words" , and the .hex file having ~32Kb ? More strange is that file has 5.676 bytes when I check it via Mac finder.

    avrdude: input file /Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex contains 32722 bytes    <<<<<<< ????? 
    
    
    /Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodem1421 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x06:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xF7:m 
    
    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/i007897/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
             Using Port                    : /dev/cu.usbmodem1421
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f
    avrdude: erasing chip
    avrdude: reading input file "0x3F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    avrdude: reading input file "0x06"
    avrdude: writing efuse (1 bytes):
    
    Writing | ################################################## | 100% 0.06s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of efuse verified
    avrdude: reading input file "0xDA"
    avrdude: writing hfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of hfuse verified
    avrdude: reading input file "0xF7"
    avrdude: writing lfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.06s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lfuse verified
    
    Fuse burn: 
    
    avrdude done.  Thank you.
    
    
    /Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodem1421 -b19200 -Uflash:w:/Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex:i -Ulock:w:0x0F:m 
    
    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/i007897/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
             Using Port                    : /dev/cu.usbmodem1421
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f
    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: reading input file "/Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex"
    avrdude: writing flash (32722 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 32722 bytes of flash written
    avrdude: verifying flash memory against /Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex:
    avrdude: load data flash data from input file /Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex:
    avrdude: input file /Users/i007897/Dropbox/Bench/Arduino/hardware/MySensors/avr/bootloaders/MySensors/MYSBootloader.hex contains 32722 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 32722 bytes of flash verified
    avrdude: reading input file "0x0F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.05s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    
    avrdude done.  Thank you.
    
    
    

    And


  • Admin

    @rvendrame weird...the .hex file size is 5676 bytes (this is the intel hex format and MYSBootloader is under 2kb, so 1024 words are ok). The 32722 bytes are the cause of the problem...
    You mentioned that burning the standard bootloader revives your Arduino - can you post the verbose mode output as comparison?


  • Hero Member

    @tekka said:

    an you post the verbose mode output as comparison?

    Sure, here it is. Very similar (including the size of .hex file)... strange...

    /Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodem1421 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 
    
    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/i007897/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
             Using Port                    : /dev/cu.usbmodem1421
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f
    avrdude: erasing chip
    avrdude: reading input file "0x3F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    avrdude: reading input file "0x05"
    avrdude: writing efuse (1 bytes):
    
    Writing | ################################################## | 100% 0.06s
    
    avrdude: 1 bytes of efuse written
    avrdude: verifying efuse memory against 0x05:
    avrdude: load data efuse data from input file 0x05:
    avrdude: input file 0x05 contains 1 bytes
    avrdude: reading on-chip efuse data:
    
    Reading | ################################################## | 100% 0.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of efuse verified
    avrdude: reading input file "0xDA"
    avrdude: writing hfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of hfuse verified
    avrdude: reading input file "0xFF"
    avrdude: writing lfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.06s
    
    avrdude: 1 bytes of lfuse written
    avrdude: verifying lfuse memory against 0xFF:
    avrdude: load data lfuse data from input file 0xFF:
    avrdude: input file 0xFF contains 1 bytes
    avrdude: reading on-chip lfuse data:
    
    Reading | ################################################## | 100% 0.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lfuse verified
    
    avrdude done.  Thank you.
    
    /Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodem1421 -b19200 -Uflash:w:/Applications/Arduino 1.6.4.app/Contents/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m 
    
    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
    
             System wide configuration file is "/Applications/Arduino 1.6.4.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/i007897/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
             Using Port                    : /dev/cu.usbmodem1421
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             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 : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.05s
    
    avrdude: Device signature = 0x1e950f
    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: reading input file "/Applications/Arduino 1.6.4.app/Contents/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex"
    avrdude: writing flash (32670 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 32670 bytes of flash written
    avrdude: verifying flash memory against /Applications/Arduino 1.6.4.app/Contents/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:
    avrdude: load data flash data from input file /Applications/Arduino 1.6.4.app/Contents/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:
    avrdude: input file /Applications/Arduino 1.6.4.app/Contents/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex contains 32670 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 32670 bytes of flash verified
    avrdude: reading input file "0x0F"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.05s
    
    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.02s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    
    avrdude done.  Thank you.
    

  • Hardware Contributor

    @rvendrame: when you try to upload a sketch, do you use ftdi? because I think you can't upload with ftdi in MYSBootloader. just ota. I looked quickly at the code. Am I right @tekka ? If you want ota+ftdi options, you must use dualoptiboot.


  • Admin

    @scalz: for flashing bootloaders you have to communicate to the MCU via SPI (e.g. via USBasp, ArduinoISP, Atmel STK500, etc.) but not the usual (ftdi) serial interface.
    MYSBootloader 1.1 supports only OTA sketch uploads (at the moment), this is right - but not related to the issue of @rvendrame


  • Hero Member

    @scalz , @tekka, I'm using "Arduino as ISP" to burn the bootloader. I have my arduino Uno connected to mac via USB, and running on it the "ArduinoISP" sketch delivered with IDE.

    The pins VCC, GND, 11, 12, 13 from Uno are connected to same pins of the pro-mini (the one being programmed). Pin 10 from uno goes to pro-mini's reset pin.

    In summary, this scenario. It works perfectly for the standard pro-mini bootloader. I had success with both 3.3V and 5V versions.

    To upload my sketches: I understand that I have to compile it, move the generated .hex file to the MYSController "Firmware" folder, and load it via 'Node -> Assign FW' . I did it this part with some sense benders that I have here, and it worked perfectly --- That made me thinking in re-flashing all pro-minis that I have with MYSbootloader 😉

    The problem is that my pro-minis get 'bricked' after burning the MYSbootloader --- pin led flashes randomly , no serial-monitor, I don't think they are really running.

    Just to be 100% sure --- I just need the pro-mini itself connected during the "Tools -> Burn bootloader" ? No radio, no extra eprom, no atsha, ... right?

    I tried to connect the radio to pro-mini after I burned the MYS, as a last desperated try (who know it would 'wake up' ). But no joy 😉

    Thx!


  • Hero Member

    @scalz, @tekka, maybe if I re-compile the MYSbootloader to match my current fuses? I was trying to find a how-to, but could not find anything related. Perhaps you can give me some guidance on that too?



  • Very interesting, I´m having the exact issues with my pro minis.. It would be very helpful with a " how-to" to compile the Mysbootloader for pro minis 3.3V 8mhz.

    Kindly


  • Hero Member

    @f1dev, I'm just trying to thinking 'out of the box'. I really don't know why the MYSBootloader doesn't work (while the original arduino bootloader does).

    @scalz, @tekka, looking at MYSBootloader makefile at github, I noticed you are using

    ISP_PORT = com5
    ISP_SPEED = 115200
    ISP_PROTOCOL = stk500v2
    ISP_MCU = m328p 
    
    

    Well, my 'Arduino as ISP' only work as 'stk500v1' and 19200 bps --- Any other combination causes the "Yikes! invalid signature found" in avrdude, or no response at all (time-out). Could be that a different avr itself would introduce "strange bytes" during bootloader burning?


  • Admin

    @rvendrame let me try some things here - can you make sure, that the MYSBootloader your are trying to flash is the one from the library and/or MYSController folder (maybe you can upload it here)?
    Importantly, there is no need to re-compile MYSBootloader as it has been successfully tested down to 3.3V and 125kHz pro-minis (!). Can you please update your Arduino IDE to 1.6.5 so that we both run the same version?


  • Admin

    @rvendrame the speed is not really an issue here - the bytes are verified after flashing...


  • Hero Member

    @tekka, thank you so much. I have downloaded the .hex again from github, just for the sake. Anyway it is here MYSBootloader.hex I'm using.


  • Admin

    @rvendrame said:

    Hello guys, I'm trying to burn the MYSBootloader.hex into some Pro minis (clones) here, however after burning it, they get somehow 'bricked' :

    • I'm using my Uno "as ISP" on IDE 1.6.4
    • I've followed the step-by-step tutorial posted above by @tekka
    • My pro-minis are 5V, 16Mhz, external clock , 328p, supposedly a perfect match with 'boards.txt' info...
    • "Burn bootloader" ends successful, with "Done burning boot loader" message.
    • After that, the pro-mini pin 13 led flashes in a kind of random pattern, and it is not possible to upload any sketch, nor any kind of serial monitor on any speed.
    • I can revert it, by selecting the standard 'Arduino Pro or Pro Mini' board , and burn boot loader again. It makes the pro-mini gets back to live, I can upload my sketches and serial monitor it.

    So my questions:

    • I don't have extra eprom connected --- Is it mandatory? I've read somewhere that it can be disabled, but can't find the instructions anymore...
    • Fuse adjustments?
    • What else can I do in order to troubleshooting it?

    Thanks!

    How do you know that the bootloader is not functioning properly? you connected the RF module as mentioned earlier? The led is blinking irregularly due to SPI...Do you get a startup message (from MYSBootloader) in MYSController?

    The 327xx bytes mentioned in verbose mode are correct - the entire flash is overwritten...


  • Hero Member

    Yes, I connect the radio and start the node, but nothing happens --- No serial monitor, nothing in MYSController. Just the pin 13 led flashing randomly.


  • Admin

    @rvendrame said:

    Yes, I connect the radio and start the node, but nothing happens --- No serial monitor, nothing in MYSController. Just the pin 13 led flashing randomly.

    Just flashed MYSController.hex on my Arduino pro mini 3V3 and the fuses as mentioned in the boards.txt (L: 0xF7 E: 0x06 H: 0xDA), using USBasp and everything works smoothly...

    Please keep in mind: There is no serial monitor for MYSBootloader and the 13 led flashing is normal

    Can you try this (in the indicated order):
    0) Update Arduino IDE to 1.6.5

    1. burn the original bootloader and upload the clear eeprom sketch
    2. burn MYSController, disconnect flasher and connect nRF24L01+ module
    3. download the most recent MySensors 1.5 library and upload the GW sketch
    4. launch MYSController 0.1.2.282, activate AutoID, Logging and connect to the serial GW
    5. let it run for a few mins and upload the log-file here

  • Hero Member

    @tekka, just to clarify, in step 4 above - the 'upload GW sketch' should be OTA? Or via regular FT232 adapter?


  • Hardware Contributor

    @rvendrame: I think it is ota. With MYSBootloader you can't use ftdi for uploading sketch.


  • Hero Member

    @scalz, thx. I will give it a try tonight.


  • Admin

    @rvendrame said:

    @tekka, just to clarify, in step 4 above - the 'upload GW sketch' should be OTA? Or via regular FT232 adapter?

    I meant to update the Gateway node with the most recent Serialgateway sketch...


  • Hero Member

    @tekka said:

    I meant to update the Gateway node with the most recent Serialgateway sketch...

    Yep, I'm already on latest version on GW. My GW runs on a pro-mini, with standard bootloader --- I guess this is not a issue?


  • Admin

    @rvendrame said:

    @tekka said:

    I meant to update the Gateway node with the most recent Serialgateway sketch...

    Yep, I'm already on latest version on GW. My GW runs on a pro-mini, with standard bootloader --- I guess this is not a issue?

    and MYSController is connected via USB/FTDI to the GW...?


  • Hero Member

    @tekka said:

    and MYSController is connected via USB/FTDI to the GW...?

    It is connected via USB/FTDI into a mac-mini running a TCP-to-serial SW. (so both Vera and MYSController can reach it using IP address). Works like a charm, I can see all nodes and messages, no connection issues so far.

    Is it required the GW running on MYSBootloader? I hope not...


  • Admin

    @rvendrame Sensor nodes with MYSBootloader (unless they are Sensebender boards) and GW with original bootloader. Curious to see your logs.


  • Hero Member

    EDIT: @tekka, @scalz , after so many tries, I don't know why I decided to replace the nRF radio , and guess what?

    Captura de tela 2015-08-13 09.56.54.png

    Funny thing is that the previous radio is working with regular bootloader. Dam fake chips! But I will sort it out later, now I want to play with my OTA 😉

    Thanks a lot!


  • Hardware Contributor

    @rvendrame: so cool. I am happy for you!
    See you soon



  • @tekka do MYSBootloader also work with the RFM69 radios?


  • Admin

    @rvendrame excellent 🙂


  • Admin

    @Francois No, in it's current stage only nRF24L01+, but porting to RFM69 should not be too difficult...



  • @tekka silly ?

    But still last night changed from serial to Ethernet gw using iboard wiz5100 and the h/w changes.

    No issues but for later problems do I ---use myscontroller by way of FTDI connector>usb or

    -- continue to plug the original serial gw into laptop leaving Ethernet still in use ( plugged in).


  • Admin

    @5546dug said:

    @tekka silly ?

    But still last night changed from serial to Ethernet gw using iboard wiz5100 and the h/w changes.

    No issues but for later problems do I ---use myscontroller by way of FTDI connector>usb or

    -- continue to plug the original serial gw into laptop leaving Ethernet still in use ( plugged in).

    I'm not quite sure I understand your question. Are you having issues with the EthernetGW?



  • @tekka No everything is ok now but there will be problems in the future to sort out if history repeats itself.

    So it is just a learning question for troubleshooting later.

    To "see" Ethernet gw in your gui use FDTI>usb>laptop (with gw still connected to the router) or use the serial gw I had from before connected remotely to laptop via usb..

    As of now I use only Ethernet gw plugged into router and the serial gw is no longer plugged into my vera.



  • @cdr said:

    @tekka I feel really, really, REALLY stupid;

    I changed the channel in the mysensors config.h to 77, this was the reason no node would ever show up since the default mysbootloader uses the default channel 76.

    D'OH

    Thanks for your patience and help, everything is working now and I'm really happy!
    👍

    @tekka is there a way to change the default channel in MYSbootloader ?



  • What ware the designed values for "type" in the fimware_config.csv?
    Can I use this variable for my sensor IDs?


  • Hero Member

    @tekka, I've being playing with MYSController and MYSBootloader over last days, I'm totally amazed by them 😉 Thank you so much for developing such nice tool!

    If you allow me, I have only one ask for the santa-claus list: Perhaps it is possible for MYSBootloader capture serial output from a node, allowing OTA Serial monitor via MYSController? I know you guys are doing a miracle within 2KB, but who knows...

    Again, thanks a lot!


  • Admin

    @NewFolk said:

    @tekka is there a way to change the default channel in MYSbootloader ?

    Yes, but for that you'll have to re-compile it.


  • Admin

    @Pendragon said:

    What ware the designed values for "type" in the fimware_config.csv?
    Can I use this variable for my sensor IDs?

    Yes, but this is only an internal reference and not being used for AutoFW assignment


  • Hero Member

    This sounds like a great app! What is the current status? I clicked on the link in the OP expecting it would connect with GitHub (where there might be a ReadMe.txt which tells what the current status is), but instad of that it just downloaded the app right then and there! There are now 197 posts on this thread, which is a bit many to sort through to find the status....

    Move it to Github?


  • Admin

    @rvendrame said:

    @tekka, I've being playing with MYSController and MYSBootloader over last days, I'm totally amazed by them 😉 Thank you so much for developing such nice tool!

    If you allow me, I have only one ask for the santa-claus list: Perhaps it is possible for MYSBootloader capture serial output from a node, allowing OTA Serial monitor via MYSController? I know you guys are doing a miracle within 2KB, but who knows...

    Again, thanks a lot!

    Thanks, I'm glad you like the tools. 🙂
    Unfortunately your suggestion is not possible: bootloader and sketch run sequentially, not in parallel, and thus, cannot communicate with each other.


  • Admin

    @NeverDie said:

    This sounds like a great app! What is the current status? I clicked on the link in the OP expecting it would connect with GitHub (where there might be a ReadMe.txt which tells what the current status is), but instad of that it just downloaded the app right then and there! There are 197 posts on this thread, which is a bit many to sort through to find the status....

    Move it to Github?

    The first post is updated once a new version is released 🙂


  • Hero Member

    @tekka said:

    @NeverDie said:

    This sounds like a great app! What is the current status? I clicked on the link in the OP expecting it would connect with GitHub (where there might be a ReadMe.txt which tells what the current status is), but instad of that it just downloaded the app right then and there! There are 197 posts on this thread, which is a bit many to sort through to find the status....

    Move it to Github?

    The first post is updated once a new version is released 🙂

    So then, as far as status goes, based on the version number, I guess it's still an unstable alpha release? Am I reading between the lines correctly?

    I did download it, and I can see that the files are from 7/25/2015, but there's no readme or other indication as to its status.

    I imagine others probably have the same question....


  • Admin

    @NeverDie No, just never felt to change the major version number...I'll add it to the feature requests 🙂


  • Hero Member

    @tekka said:

    Unfortunately your suggestion is not possible: bootloader and sketch run sequentially, not in parallel, and thus, cannot communicate with each other.

    Maybe by re-implementing serial.print methods, in order to first checking which FW is installed, and if MYSBootloader, re-direct the output to a internal radio message? Just brainstorming....



  • @tekka

    @tekka said:

    @NewFolk said:

    @tekka is there a way to change the default channel in MYSbootloader ?

    Yes, but for that you'll have to re-compile it.

    Could you help me to find where to change channel? It is in MYSBootloaderHW.h ?



  • Du you all connect the controller direct to the gateway?

    I have a serial gateway which is connected directly to a raspberry running domoticz. I can rum ser2net and then connect the MYSController via ethernet. While ser2net is running, domoticz does not get any data from the gateway.

    Has anyone found a solution to use both, MYSController and a controller software (e.g. domoticz) in parallel?


  • Admin

    @NewFolk said:

    Could you help me to find where to change channel? It is in MYSBootloaderHW.h ?

    No, it's defined in MyConfig.h (see here)


  • Admin

    @rvendrame said:

    @tekka said:

    Unfortunately your suggestion is not possible: bootloader and sketch run sequentially, not in parallel, and thus, cannot communicate with each other.

    Maybe by re-implementing serial.print methods, in order to first checking which FW is installed, and if MYSBootloader, re-direct the output to a internal radio message? Just brainstorming....

    I like the idea, but again, the bootloader cannot handle that.
    However, we may think about implementing an OTA serial monitor in the library, let's say re-routing the serial output and transmit it via a dedicated debug sensor instance back to the GW...@hek, what do you think about that?


  • Admin

    Hmm.. One idea is that you could enable nodes to broadcast (they are not being routed/retransmitted) log data as internal (I_LOG) messages.

    Gateway would pick up these messages if node is in range and just log them to controller.



  • Hi Tekka.
    Great software, thanks for sharing.

    I 've being doing some tests and found a problem that seems to be related to my own sketches.

    When I upload through OTA the TimeReporter sketch, it uploads fine, and I am able to change the firmware afterward for another one.
    But when I upload my own sketch, It uploads fine, and works fine, but it stops to answer MYScontroller commands, such as reboot or assing firmware. So I am stuck with that sketch in that node. To flash another sketch in that node, I have to reflash MYSBootloader again via usbASP and later on, upload the desire sketch wit MYSController.

    Am I skiping something in my code that allows MYSBootloader to respond to MYSController commands?
    Could you please upload the TimeReporter.ino sketch as example of a working sketch with MYSController/MYSBootloader?

    Thanks, regards!

    Gonzalo


  • Admin

    @gonzalonal said:

    Hi Tekka.
    Great software, thanks for sharing.

    I 've being doing some tests and found a problem that seems to be related to my own sketches.

    When I upload through OTA the TimeReporter sketch, it uploads fine, and I am able to change the firmware afterward for another one.
    But when I upload my own sketch, It uploads fine, and works fine, but it stops to answer MYScontroller commands, such as reboot or assing firmware. So I am stuck with that sketch in that node. To flash another sketch in that node, I have to reflash MYSBootloader again via usbASP and later on, upload the desire sketch wit MYSController.

    Am I skiping something in my code that allows MYSBootloader to respond to MYSController commands?
    Could you please upload the TimeReporter.ino sketch as example of a working sketch with MYSController/MYSBootloader?

    Thanks, regards!

    Gonzalo

    There is nothing special about the sketch, except of calling gw.process() as often as possible. If you have delay() call gw.wait() instead.

    For the sake of completeness, here you go:

    #include <SPI.h>
    #include <MySensor.h>  
    #include <Time.h>  
    #include <avr\wdt.h> 
    
    #define NODE_ID AUTO
    #define CHILD_ID_GENERAL 0
    #define CHILD_ID_POWER 1
    #define CHILD_ID_TEMPERATURE 2
    #define SketchName "TimeReporter"
    #define SketchVersion "20150826"
    
    #define UPDATE_TIME 100000L
    #define REPORT_TIME 5000L
    
    MySensor gw;
    boolean timeReceived = false;
    unsigned long ms_now;
    unsigned long lastUpdate=0, lastRequest=0;
    
    MyMessage msgGeneral(CHILD_ID_GENERAL, V_VAR1);
    MyMessage msgPower(CHILD_ID_POWER, V_VOLTAGE);
    MyMessage msgTemperature(CHILD_ID_TEMPERATURE, V_TEMP);
    
    void setup()  
    {  
      // watchdog 8s
      wdt_enable(WDTO_8S);
      // repeater mode on
      gw.begin(NULL,NODE_ID,true);
      // Send sketch version and information
      gw.sendSketchInfo(SketchName, SketchVersion);
      // Register sensors to gateway
      gw.present(CHILD_ID_GENERAL, S_ARDUINO_NODE,"Main node"); 
      gw.present(CHILD_ID_POWER, S_POWER,"ADC power",true); 
      gw.present(CHILD_ID_TEMPERATURE, S_TEMP,"Chip temp"); 
      // request time
      gw.requestTime(receiveTime);
        
    }
    
    // time callback
    void receiveTime(unsigned long time) {
      // Ok, set incoming time 
      setTime(time);
      timeReceived = true;
    }
    
    long readMUX(uint8_t aControl) {
      long result;
      
      ADMUX = aControl;
      delay(20); // Wait for Vref to settle
      ADCSRA |= _BV(ADSC); // Convert
      while (bit_is_set(ADCSRA,ADSC));
      result = ADCL;
      result |= ADCH<<8;
      return result;
    }
    
    long readVcc() {
     // Read 1.1V reference against AVcc
      return 1126400L / readMUX(_BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1));  
    }
    
    float readTemp() {
     // Read 1.1V reference against MUX3  
      return (readMUX(_BV(REFS1) | _BV(REFS0) | _BV(MUX3)) - 125) * 0.1075; 
    }
     
    void loop()     
    {     
      // watchdog reset
      wdt_reset();
      // process incoming messages and repeater function
      gw.process();
      // get millis since start
      ms_now = millis();
      // time update needed?
      if (timeReceived && ms_now-lastRequest > UPDATE_TIME) {
        // Request time from controller. 
        gw.requestTime(receiveTime);  
        lastRequest = ms_now;
      }
      
      // report time
      if (timeReceived && ms_now-lastUpdate > REPORT_TIME) {
        
        gw.send(msgGeneral.set(ms_now));  
        char Output[10];
        String OutStr = String(hour()) + ":" + String(minute()) + ":" + String(second());
        OutStr.toCharArray(Output,10);
        
        gw.send(msgGeneral.set(Output));
        gw.send(msgTemperature.set(readTemp(),1));
        gw.send(msgPower.set(readVcc()),true);
        lastUpdate = ms_now;
      }
    
    }
    


  • Thanks Tekka for replying.

    Just another silly question.
    How should I compile my sketch to later be uploaded into a MYSBootloader Arduino Nano?
    Should I compile for "Arduino Nano" or for "ATMega328 16Mhz MYSBootloader"?

    Thanks, regards.

    Gonzalo


  • Admin

    @gonzalonal Assuming that you have the Nano 3.0, you should be good to go with "ATMega328 16Mhz MYSBootloader"...



  • Ok, thanks for that.

    I finally found my problem.
    The Node was sleeping most of the time. In spite of waking up twice per second, it was not enough to enter the uploading mode in the mysbootloader, so the node wasn't answering back to the gateway, nor MYSController.

    Now I have a questions

    How can I OTA update/upload the firmware of a sleeping node? Should the gateway, or a relay node, send the upload message to the sleeping node as soon as it wakes up for transmiting its data?
    I guess that in order to do that, the sleeping node should always wait for an aknowledge or some kind of message after waking up. I mean:

    Sleeping node wakes up
    Then, it send its data to controller or to relay node
    Afterwards, it wait for the controller to acknoledge the data just send, and to tell him (sleeping node) if there is a firmware upgrade for it.
    If there's not, go back to sleep. If there is, go to OTA upgrade routine.

    Thanks, regards.


  • Admin

    @gonzalonal
    OTA updates for sleeping nodes with MYSBootloader:

    • add gw.wait(200) after the gw.send() (=node processes incoming messages for 200ms after sending a message)
    • In MYSController, right-click on the node, select "Battery-powered / sleeping", then assign FW, confirm to reboot node (reboot request is now queued)

    MYSController will now wait until it receives a message from that node, send the reboot command and hence, initiate OTA update.



  • @tekka Great Tekka, thanks again. I will try that.
    Regards.



  • Hi,

    I am trying to debug a mysensors temp. sensor using this tool (it is not detected by Domoticz). I connected the serial gateway to your program and when I turn the temperature sensor, I see that there is traffic back and forth between the gateway and the sensor. But my knowledge stops there.... any pointers? I can upload a screenshot of the log if it helps.

    Thanks
    Z.


  • Admin

    @zuru screenshots and/or log files are always good starting points 😉



  • I found my problem.... so everything is fine now.
    Thanks
    Z.



  • Hey guys,
    maybe anyone can help. I tried to debug my sensors, but didn't got MYSController to talk with my gateway.
    I have the NRF24L01+ directly connected to my rPi and can use the Gateway with Pimatic plugin. Then I tried different ways to give MYSController access:

    1. redirecting the serial gateway to tcp port (tried ser2net and socat) to use ethernet option, but didn't got this to work.
    2. creating a new gateway using a spare nano with NRF24L01+ at my PC. This one worked, but the gateway didn't noticed my nodes. Are they somehow coded to only talk with the gateway they know? I waited serveral minuters (sensors reporting each minute), but didn't got any readings. I assume this programm has an auto update to show now nodes, right?

    Hope someone can help, I would realy love the option to debug using my windows PC and in future upload new sketches OTA (with new bootloader).

    Regards,
    Anduril



  • I have followed the procedure listed and that mentioned in post 77. Pro Mini 3.3v 8mhz Arduino.

    I keep getting the following message in the debug window every few minutes. Have repeated the process in post 77 several times however get the same results.

    [2015-09-01 18:09:17.276 Info] DEBUG Undefined firmware/type for node=2
    [2015-09-01 18:09:17.323 Info] INFO BL version=257
    [2015-09-01 18:09:17.354 Info] INFO Send FW info to node 2: type=A, version=1, blocks=0x0048, CRC=0xD098
    [2015-09-01 18:09:17.386 Info] TX 2;0;4;0;1;0A000100480098D0
    [2015-09-01 18:09:17.417 Info] RX 2;255;4;0;0;FFFFFFFFFFFFFFFF0101

    Any pointers??


  • Admin

    @allysmith please provide more information about the setup and upload the MYSController log for further troubleshooting



  • @tekka What kind of SPI flash is needed for this OTA stuff? Can you provide part numbers?


  • Admin

    @ericvdb MYSBootloader works without external flash, in contrary to the sensebender board and dualoptiboot bootloader


Log in to reply
 

Suggested Topics

  • 13
  • 3
  • 24
  • 73
  • 6
  • 2
  • 2
  • 37

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts