Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. DualOptiboot Bootloader (Solved)

DualOptiboot Bootloader (Solved)

Scheduled Pinned Locked Moved Troubleshooting
17 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TakeroT Offline
    TakeroT Offline
    Takero
    Hardware Contributor
    wrote on last edited by
    #7

    I found that Sketch now . . SPIFlash_ReadWrite.ino

    Start...Init FAIL!
    

    I use AT25DF512C-SSHN-B

    1 Reply Last reply
    0
    • scalzS Offline
      scalzS Offline
      scalz
      Hardware Contributor
      wrote on last edited by scalz
      #8

      Search -> https://forum.mysensors.org/topic/3503/sensebender-dualoptiboot-ota-howto-in-mysensors/11

      TakeroT 1 Reply Last reply
      0
      • scalzS scalz

        Search -> https://forum.mysensors.org/topic/3503/sensebender-dualoptiboot-ota-howto-in-mysensors/11

        TakeroT Offline
        TakeroT Offline
        Takero
        Hardware Contributor
        wrote on last edited by Takero
        #9

        @scalz

        That works, i think ;-)

        Init OK!
        Start...Init OK!
        Flash content:
        0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
        Erasing Flash chip ... DONE
        DeviceID: 0
        

        But OTA does not work . . .

        My Test-Sketch:

        /**
         * 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.
         *
         *******************************
         *
         * DESCRIPTION
         *
         * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
         * http://www.mysensors.org/build/temp
         */
        
        
        // Enable debug prints to serial monitor
        #define MY_DEBUG 
        
        // Enable and select radio type attached
        #define MY_RADIO_NRF24
        #define MY_RF24_PA_LEVEL RF24_PA_MAX
        #define MY_BAUD_RATE 115200
        #define MY_NODE_ID 50
        #define MY_RF24_CHANNEL 105
        #define MY_OTA_FIRMWARE_FEATURE
        #define MY_OTA_FLASH_SS   8     // EEprom CS pin
        //#define OTA_WAIT_PERIOD 300
        
        //#define ATSHA204_PIN      12    // A3 Arduino Digital I/O pin number for ATSHA204A sot23 ic (for authentication)
        //#define MY_SIGNING_SOFT
        //#define MY_SIGNING_ATSHA204
        //#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
        //#define MY_SIGNING_REQUEST_SIGNATURES
        //#ifndef MY_SIGNING_SOFT_RANDOMSEED_PIN
        //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
        //#endif
        //#ifndef MY_SIGNING_ATSHA204_PIN
        //#define MY_SIGNING_ATSHA204_PIN 17
        //#endif
        
        #include <SPI.h>
        #include <MySensors.h>  
        #include <DallasTemperature.h>
        #include <OneWire.h>
        
        #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
        
        #define ONE_WIRE_BUS 4 // Pin where dallase sensor is connected 
        #define MAX_ATTACHED_DS18B20 16
        unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
        OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
        DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
        float lastTemperature[MAX_ATTACHED_DS18B20];
        int numSensors=0;
        bool receivedConfig = false;
        bool metric = true;
        // Initialize temperature message
        MyMessage msg(0,V_TEMP);
        
        void before()
        {
          // Startup up the OneWire library
          sensors.begin();
        }
        
        void setup()  
        { 
          // requestTemperatures() will not block current thread
          sensors.setWaitForConversion(false);
        }
        
        void presentation() {
          // Send the sketch version information to the gateway and Controller
          sendSketchInfo("Temperature Sensor", "1.1");
        
          // Fetch the number of attached temperature sensors  
          numSensors = sensors.getDeviceCount();
        
          // Present all sensors to controller
          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
             present(i, S_TEMP);
          }
        }
        
        void loop()     
        {     
          // Fetch temperatures from Dallas sensors
          sensors.requestTemperatures();
        
          // query conversion time and sleep until conversion completed
          int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
          // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
          //sleep(conversionTime);
        
          // Read temperatures and send them to controller 
          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
        
            // Fetch and round temperature to one decimal
            float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
        
            // Only send data if temperature has changed and no error
            #if COMPARE_TEMP == 1
            if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
            #else
            if (temperature != -127.00 && temperature != 85.00) {
            #endif
        
              // Send in the new temperature
              send(msg.setSensor(i).set(temperature,1));
              // Save new temperatures for next compare
              lastTemperature[i]=temperature;
            }
          }
        }
        

        MYSController log Node 50:

        21.10.2016 12:25:37	NODE	New node discovered, node id=50
        21.10.2016 12:25:37	CHILD	New child discovered, node id=50, child id=internal
        21.10.2016 12:25:37	INFO	BL version=768
        21.10.2016 12:25:37	INFO	No FW assigned
        21.10.2016 12:25:37	RX	50;255;4;0;0;0A000200B004B6D30300
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=0,t=17,pt=0,l=5,sg=0:2.0.0
        21.10.2016 12:25:37	DEBUG	Update child id=255, type=ARDUINO_NODE
        21.10.2016 12:25:37	RX	50;255;0;0;17;2.0.0
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
        21.10.2016 12:25:37	TX	50;255;3;0;6;M
        21.10.2016 12:25:37	RX	50;255;3;0;6;0
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=ok:M
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Sensor
        21.10.2016 12:25:37	RX	50;255;3;0;11;Temperature Sensor
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
        21.10.2016 12:25:37	RX	50;255;3;0;12;1.1
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=0,c=0,t=6,pt=0,l=0,sg=0:
        21.10.2016 12:25:37	CHILD	New child discovered, node id=50, child id=0
        21.10.2016 12:25:37	DEBUG	Update child id=0, type=TEMP
        21.10.2016 12:25:37	RX	50;0;0;0;6;
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=3,t=26,pt=1,l=1,sg=0:2
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=ok:1
        21.10.2016 12:25:37	RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=0,c=1,t=0,pt=7,l=5,sg=0:25.3
        

        If i assigning new FW, following in log, but nothing happens . . ..

        21.10.2016 12:28:43	INFO	FW "Test02" assigned to node 50
        21.10.2016 12:28:43	INFO	Send FW info to node 50: type=A, version=2, blocks=0x04B0, CRC=0xD3B6
        21.10.2016 12:28:43	TX	50;0;4;0;1;0A000200B004B6D3
        21.10.2016 12:28:43	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=0,c=4,t=1,pt=6,l=8,sg=0,ft=0,st=ok:0A000200B004B6D3
        
        1 Reply Last reply
        0
        • TakeroT Offline
          TakeroT Offline
          Takero
          Hardware Contributor
          wrote on last edited by Takero
          #10

          OK . . . The Upload is successful right now, dont know why but it works.

          Now i have the Problem after transfer Data it stops at "Ongoing 100%" and nothing happens anymore. The Node needs Powercycle, Resetbutton has no effect.... (scalz Rollershutter HW)

          alt text

          1 Reply Last reply
          0
          • TakeroT Offline
            TakeroT Offline
            Takero
            Hardware Contributor
            wrote on last edited by
            #11

            Works right now. . . my faulty was to flash the first Programm with the wrong Bootloader. :rage:

            1 Reply Last reply
            0
            • scalzS Offline
              scalzS Offline
              scalz
              Hardware Contributor
              wrote on last edited by scalz
              #12

              why i told you to read the howto, because you would have burnt the right BL (sensebender in boards) ;)
              great you got it working :)

              TakeroT 1 Reply Last reply
              0
              • scalzS scalz

                why i told you to read the howto, because you would have burnt the right BL (sensebender in boards) ;)
                great you got it working :)

                TakeroT Offline
                TakeroT Offline
                Takero
                Hardware Contributor
                wrote on last edited by
                #13

                @scalz yahh i know. I dit but i dont found the right bootloader and arduinos ide folder structure is horrorbil.

                Btw.... On the nrf24 Layout you have to remove the pullup R14

                1 Reply Last reply
                0
                • scalzS Offline
                  scalzS Offline
                  scalz
                  Hardware Contributor
                  wrote on last edited by scalz
                  #14

                  @Takero
                  why removing R14? then is avrspi still working?? it's a pull-up for CSN, and when you have multiple ic on SPI bus, it's good practice to have it, and avoid some dumb issue..it didn't work with R14?? perhaps..

                  TakeroT 1 Reply Last reply
                  0
                  • TakeroT Offline
                    TakeroT Offline
                    Takero
                    Hardware Contributor
                    wrote on last edited by
                    #15

                    I know but i had Trouble with the nrf is it pluged. I will try it again and give you a Feedback.

                    1 Reply Last reply
                    0
                    • scalzS scalz

                      @Takero
                      why removing R14? then is avrspi still working?? it's a pull-up for CSN, and when you have multiple ic on SPI bus, it's good practice to have it, and avoid some dumb issue..it didn't work with R14?? perhaps..

                      TakeroT Offline
                      TakeroT Offline
                      Takero
                      Hardware Contributor
                      wrote on last edited by
                      #16

                      @scalz
                      OK, tested with R14 again and it works :+1:

                      Thanks again for the PCB and help!!

                      1 Reply Last reply
                      0
                      • TakeroT Offline
                        TakeroT Offline
                        Takero
                        Hardware Contributor
                        wrote on last edited by
                        #17

                        I does not work again . . . i dont know why :-(

                        After Upload new Firmware, the device wont reboot and hanging in an bootloop.

                        Log from MYSController:

                        [2016-10-29 14:30:37.589 Info] RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=ok:6400020001000C941F040C941F040C9409140C941F04
                         [2016-10-29 14:30:37.602 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-0 s=255,c=4,t=2,pt=6,l=6,sg=0:640002000000
                         [2016-10-29 14:30:37.612 Info] TX	50;255;4;0;3;6400020000000C94F7030C94A3190C947C190C941F04
                         [2016-10-29 14:30:37.622 Info] RX	50;255;4;0;2;640002000000
                         [2016-10-29 14:30:37.641 Info] RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=ok:6400020000000C94F7030C94A3190C947C190C941F04
                         [2016-10-29 14:30:40.031 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                         [2016-10-29 14:30:40.046 Info] RX	0;255;3;0;9;TSP:MSG:BC
                         [2016-10-29 14:30:40.060 Info] RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=50)
                         [2016-10-29 14:30:40.069 Info] RX	0;255;3;0;9;TSP:CHKUPL:OK
                         [2016-10-29 14:30:40.077 Info] RX	0;255;3;0;9;TSP:MSG:GWL OK
                         [2016-10-29 14:30:40.576 Info] RX	0;255;3;0;9;!TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                         [2016-10-29 14:30:40.594 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                         [2016-10-29 14:30:40.606 Info] RX	0;255;3;0;9;TSP:MSG:BC
                         [2016-10-29 14:30:40.615 Info] RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=50)
                         [2016-10-29 14:30:40.624 Info] RX	0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                         [2016-10-29 14:30:40.633 Info] RX	0;255;3;0;9;TSP:MSG:GWL OK
                         [2016-10-29 14:30:40.643 Info] RX	0;255;3;0;9;TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=ok:0
                         [2016-10-29 14:30:40.653 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                         [2016-10-29 14:30:40.662 Info] RX	0;255;3;0;9;TSP:MSG:BC
                         [2016-10-29 14:30:40.673 Info] RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=50)
                         [2016-10-29 14:30:40.682 Info] RX	0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                         [2016-10-29 14:30:40.692 Info] RX	0;255;3;0;9;TSP:MSG:GWL OK
                         [2016-10-29 14:30:40.774 Info] RX	0;255;3;0;9;!TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                         [2016-10-29 14:30:40.784 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                         [2016-10-29 14:30:40.794 Info] RX	0;255;3;0;9;TSP:MSG:BC
                         [2016-10-29 14:30:40.806 Info] RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=50)
                         [2016-10-29 14:30:40.815 Info] RX	0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                         [2016-10-29 14:30:40.825 Info] RX	0;255;3;0;9;TSP:MSG:GWL OK
                         [2016-10-29 14:30:41.089 Info] RX	0;255;3;0;9;!TSP:MSG:SEND 0-0-50-50 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                         [2016-10-29 14:30:41.110 Info] RX	0;255;3;0;9;TSP:MSG:READ 50-50-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                         [2016-10-29 14:30:41.120 Info] RX	0;255;3;0;9;TSP:MSG:BC
                         [2016-10-29 14:30:41.129 Info] RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=50)
                         [2016-10-29 14:30:41.139 Info] RX	0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                         [2016-10-29 14:30:41.148 Info] RX	0;255;3;0;9;TSP:MSG:GWL OK
                        
                        

                        Any Tips?

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        19

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.1k

                        Posts


                        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • MySensors
                        • OpenHardware.io
                        • Categories
                        • Recent
                        • Tags
                        • Popular