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. Development
  3. MYSBootloader 1.3pre2 testing

MYSBootloader 1.3pre2 testing

Scheduled Pinned Locked Moved Development
otamyscontrollermysbootloader
73 Posts 25 Posters 30.6k Views 31 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.
  • jmkhaelJ jmkhael

    @mannkind : thank you for your message. I'll give that a go later on.

    @tekka , @anyone :)
    I am trying to make this work using MYSController (from MYSBootloader_V13pre2/). I've followed the instructions above from @tekka, but it feels like the OTA process kicks around quite quick, then it seems to block in a loop

     [2016-10-17 23:09:29.821 Info] RX	1;255;4;0;0;0A0001005000D4460102
     [2016-10-17 23:09:29.821 Info] INFO	BL version=258
     [2016-10-17 23:09:29.821 Info] INFO	Send FW info to node 1: type=A, version=1, blocks=0x0050, CRC=0x46D4
     [2016-10-17 23:09:29.822 Info] TX	1;0;4;0;1;0A0001005000D446
    

    I'll try to keep it going all night, but here are my full log till now.
    Any idea what is going wrong?
    0_1476738954886_MySensors_20161017-230018.log

    M Offline
    M Offline
    mannkind
    wrote on last edited by
    #16
    This post is deleted!
    1 Reply Last reply
    0
    • jmkhaelJ jmkhael

      @mannkind : thank you for your message. I'll give that a go later on.

      @tekka , @anyone :)
      I am trying to make this work using MYSController (from MYSBootloader_V13pre2/). I've followed the instructions above from @tekka, but it feels like the OTA process kicks around quite quick, then it seems to block in a loop

       [2016-10-17 23:09:29.821 Info] RX	1;255;4;0;0;0A0001005000D4460102
       [2016-10-17 23:09:29.821 Info] INFO	BL version=258
       [2016-10-17 23:09:29.821 Info] INFO	Send FW info to node 1: type=A, version=1, blocks=0x0050, CRC=0x46D4
       [2016-10-17 23:09:29.822 Info] TX	1;0;4;0;1;0A0001005000D446
      

      I'll try to keep it going all night, but here are my full log till now.
      Any idea what is going wrong?
      0_1476738954886_MySensors_20161017-230018.log

      tekkaT Offline
      tekkaT Offline
      tekka
      Admin
      wrote on last edited by
      #17

      @jmkhael Looks like a bad radio connection (GW too close / far, interference, power) What happens if you upload the FW via serial link?

      jmkhaelJ 1 Reply Last reply
      1
      • tekkaT tekka

        @jmkhael Looks like a bad radio connection (GW too close / far, interference, power) What happens if you upload the FW via serial link?

        jmkhaelJ Offline
        jmkhaelJ Offline
        jmkhael
        wrote on last edited by
        #18

        @mannkind : thanks for the clarifications. My problem is that the node seems to hang at the booting phase in MYSController sa per the screenshot.

        @tekka that should be it (gw in the 50 cm range). I'll try more tests and get back here in any case.

        @mannkind, @tekka: How do we interpret the OTA logs?

        0_1476786275039_MYSController 1.0.png

        jmkhaelJ 1 Reply Last reply
        0
        • jmkhaelJ jmkhael

          @mannkind : thanks for the clarifications. My problem is that the node seems to hang at the booting phase in MYSController sa per the screenshot.

          @tekka that should be it (gw in the 50 cm range). I'll try more tests and get back here in any case.

          @mannkind, @tekka: How do we interpret the OTA logs?

          0_1476786275039_MYSController 1.0.png

          jmkhaelJ Offline
          jmkhaelJ Offline
          jmkhael
          wrote on last edited by
          #19

          @tekka: it was probably a mix of power/distance. when change these two parameters, OTA went fine. thank you

          What is the best way to handle OTA for sleeping nodes? is there something else todo besides setting the property under settings in MYSController? Do I need to powercycle the node or will MYSController kicks in when the node sleeps/smartSleeps?
          thank you for your time

          tekkaT 1 Reply Last reply
          1
          • jmkhaelJ jmkhael

            @tekka: it was probably a mix of power/distance. when change these two parameters, OTA went fine. thank you

            What is the best way to handle OTA for sleeping nodes? is there something else todo besides setting the property under settings in MYSController? Do I need to powercycle the node or will MYSController kicks in when the node sleeps/smartSleeps?
            thank you for your time

            tekkaT Offline
            tekkaT Offline
            tekka
            Admin
            wrote on last edited by
            #20

            @jmkhael MYSController will reboot the node as soon as it wakes up, sends and processes incoming messages.

            jmkhaelJ 1 Reply Last reply
            1
            • tekkaT tekka

              @jmkhael MYSController will reboot the node as soon as it wakes up, sends and processes incoming messages.

              jmkhaelJ Offline
              jmkhaelJ Offline
              jmkhael
              wrote on last edited by
              #21

              @tekka my node wakes up every two minutes (or on pir movement) sends some messages (temperature, light level...) and sleeps right away. will MYSController be able to do that in this small time window? is there something i can code to help it? (heartBeat, wait, smartSomething?)
              (as i saw during my few tests, i had to powercycle my node, maybe i wasn't patient enough :))

              tekkaT 1 Reply Last reply
              0
              • jmkhaelJ jmkhael

                @tekka my node wakes up every two minutes (or on pir movement) sends some messages (temperature, light level...) and sleeps right away. will MYSController be able to do that in this small time window? is there something i can code to help it? (heartBeat, wait, smartSomething?)
                (as i saw during my few tests, i had to powercycle my node, maybe i wasn't patient enough :))

                tekkaT Offline
                tekkaT Offline
                tekka
                Admin
                wrote on last edited by
                #22

                @jmkhael place smartSleep() instead of sleep(), before sending any values to the controller - MYSController will pick this up and send a reboot command. Also, you need to mark the node as battery-powered/sleeping node...

                1 Reply Last reply
                0
                • JCLBJ Offline
                  JCLBJ Offline
                  JCLB
                  wrote on last edited by JCLB
                  #23

                  Just tried with this release, works great (had no problem with previous release)

                  The only drawback is the packet bitrate, around 40 per minute with 45 bytes each.
                  It takes 1h to flash a node. few minutes, just make sure of your wiring as this is a very intensive process compared to node's standard radio use.

                  Here is a flash running on a test network:

                  snip

                  Can we update many nodes at the same time ? haven't tried

                  tekkaT 1 Reply Last reply
                  0
                  • JCLBJ JCLB

                    Just tried with this release, works great (had no problem with previous release)

                    The only drawback is the packet bitrate, around 40 per minute with 45 bytes each.
                    It takes 1h to flash a node. few minutes, just make sure of your wiring as this is a very intensive process compared to node's standard radio use.

                    Here is a flash running on a test network:

                    snip

                    Can we update many nodes at the same time ? haven't tried

                    tekkaT Offline
                    tekkaT Offline
                    tekka
                    Admin
                    wrote on last edited by
                    #24

                    @JCLB This is unusual. A regular sketch ~20kB takes ~2mins. Maybe you are having issues with power supply, bad clones, or other sources of interference.

                    1 Reply Last reply
                    0
                    • JCLBJ Offline
                      JCLBJ Offline
                      JCLB
                      wrote on last edited by JCLB
                      #25

                      I can now gets dozen of packets at once, then hold, continues...depending of how I press the wires on radio side :sweat:
                      It's a wiring problem, will try this weekend with a soldered node.

                      Thank you

                      tekkaT 1 Reply Last reply
                      0
                      • JCLBJ JCLB

                        I can now gets dozen of packets at once, then hold, continues...depending of how I press the wires on radio side :sweat:
                        It's a wiring problem, will try this weekend with a soldered node.

                        Thank you

                        tekkaT Offline
                        tekkaT Offline
                        tekka
                        Admin
                        wrote on last edited by
                        #26

                        @JCLB Thanks for reporting, I'm using short dupont cables or have the radio fixed on a PCB.

                        1 Reply Last reply
                        0
                        • kk02067K Offline
                          kk02067K Offline
                          kk02067
                          wrote on last edited by
                          #27

                          I have also problem with speed of the upload. I get about 1 packet per 3 seconds. Is there a something in the code for the bootloader that has a waitingtime of 3 seconds? And if so, because of what? From that info we might be able to tell if it's a reception problem of the node or the gateway.

                          1 Reply Last reply
                          0
                          • pkuP Offline
                            pkuP Offline
                            pku
                            wrote on last edited by
                            #28

                            @tekka Thank you for great job on MYSBootloader. It works fine for me. Currently I'm testing it and have few questions.

                            • Please can you provide source code? Maybe then I can answer my questions myself :)
                            • Software signing doesn't work after firmware is uploaded. EEPROM is cleared. Is it possible to restore shared key HMAC after firmware is stored?
                            • Is possible to send firmware with signing to prevent loading from fake gateway? I thing signing of available firmware version and firmware CRC is enough ..?

                            Thank you for answers.

                            JCLBJ 1 Reply Last reply
                            0
                            • NiklasON Offline
                              NiklasON Offline
                              NiklasO
                              wrote on last edited by NiklasO
                              #29

                              I have changed the fuse settings for my setup. I don't know if it makes any difference but there is a fuse for "Preserve EEPROM memory through the Chip Erase cycle". Was noticing that my sensors was getting a new id every time I did some changes in my sketches and flashed using "Upload with programmer". I have not succeeded with OTA flashing yet.
                              I also use the external crystal present on the Pro Mini. Using 0xFF, 0xD2 and 0xFE.
                              Probably only used when programming using ICSP.

                              MYSBL13.menu.cpu.8MHzatmega328=ATmega328 8MHz (XTAL, BOD1V8)
                              MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_size=30720
                              MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048
                              MYSBL13.menu.cpu.8MHzatmega328.upload.speed=38400
                              MYSBL13.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF
                              MYSBL13.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xD2
                              MYSBL13.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0xFE
                              MYSBL13.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBL13pre_atmega328_8Mhz.hex
                              MYSBL13.menu.cpu.8MHzatmega328.build.mcu=atmega328p
                              MYSBL13.menu.cpu.8MHzatmega328.build.f_cpu=8000000L
                              
                              pkuP 1 Reply Last reply
                              0
                              • NiklasON NiklasO

                                I have changed the fuse settings for my setup. I don't know if it makes any difference but there is a fuse for "Preserve EEPROM memory through the Chip Erase cycle". Was noticing that my sensors was getting a new id every time I did some changes in my sketches and flashed using "Upload with programmer". I have not succeeded with OTA flashing yet.
                                I also use the external crystal present on the Pro Mini. Using 0xFF, 0xD2 and 0xFE.
                                Probably only used when programming using ICSP.

                                MYSBL13.menu.cpu.8MHzatmega328=ATmega328 8MHz (XTAL, BOD1V8)
                                MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_size=30720
                                MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048
                                MYSBL13.menu.cpu.8MHzatmega328.upload.speed=38400
                                MYSBL13.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF
                                MYSBL13.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xD2
                                MYSBL13.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0xFE
                                MYSBL13.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBL13pre_atmega328_8Mhz.hex
                                MYSBL13.menu.cpu.8MHzatmega328.build.mcu=atmega328p
                                MYSBL13.menu.cpu.8MHzatmega328.build.f_cpu=8000000L
                                
                                pkuP Offline
                                pkuP Offline
                                pku
                                wrote on last edited by
                                #30

                                @NiklasO I'm using Arduino Mini 5V, 16Mhz with fuses as you have. Except BODLEVEL 2.7V and EEPROM Cleared. OTA works fine, 21kB hex file is sent in cca 2-5 minutes (very depends on count of wrong packets, without 47uF capacitor on NRF24 or with low power supply it takes about 2 hours :) ). I started with MYSController and small and easy Blink.ino.hex from MYSController distribution. Now I use MyController and own firmwares...

                                1 Reply Last reply
                                0
                                • pkuP pku

                                  @tekka Thank you for great job on MYSBootloader. It works fine for me. Currently I'm testing it and have few questions.

                                  • Please can you provide source code? Maybe then I can answer my questions myself :)
                                  • Software signing doesn't work after firmware is uploaded. EEPROM is cleared. Is it possible to restore shared key HMAC after firmware is stored?
                                  • Is possible to send firmware with signing to prevent loading from fake gateway? I thing signing of available firmware version and firmware CRC is enough ..?

                                  Thank you for answers.

                                  JCLBJ Offline
                                  JCLBJ Offline
                                  JCLB
                                  wrote on last edited by
                                  #31

                                  @pku if your keys are in the sketch everything will work for signing.
                                  #define MY_SOFT_HMAC_KEY XXX... //signing key
                                  #define MY_AES_KEY XXX... // if you use encryption
                                  Of course if you want to use whitelisting then you need to compile each node sketch separately with it's serial.

                                  @NiklasO
                                  Personally I set the node ID manually to avoid this
                                  #define MY_NODE_ID 30 // Sets a static id for a node
                                  And I group tens so all my 3X nodes are in kitchen, 4X in office, 11X in bedroom 1 and so on.

                                  I would love to see a proxy mode in MYSController, in order to interface between a controller that doesn't support OTA and an Ethernet gateway :heart_eyes:

                                  Let say your LAN is the following:

                                  • MySensors gateway 192.168.0.1
                                  • controller (raspberry + Domoticz or else) 192.168.0.2
                                  • PC with MYSController 192.168.0.3

                                  Whenever you need to update a node, you launch MYSController but don't connect to the gateway, then you tells Domoticz .2 to connect to MYSController .3 instead of the gateway .1, at this point MYSController starts relaying everything between Domoticz and the gateway + provides you the ability to update a node.

                                  When you want to get back to normal operations, you set back 192.168.0.1 on Domoticz, MYSController receives a TCP reset and ends it's session with Domoticz and stop the session with the gateway.

                                  We would get a minimum downtime and can could use MYSController to update nodes and debug traffic while letting the normal controller...controlling

                                  NiklasON AndurilA 2 Replies Last reply
                                  0
                                  • JCLBJ JCLB

                                    @pku if your keys are in the sketch everything will work for signing.
                                    #define MY_SOFT_HMAC_KEY XXX... //signing key
                                    #define MY_AES_KEY XXX... // if you use encryption
                                    Of course if you want to use whitelisting then you need to compile each node sketch separately with it's serial.

                                    @NiklasO
                                    Personally I set the node ID manually to avoid this
                                    #define MY_NODE_ID 30 // Sets a static id for a node
                                    And I group tens so all my 3X nodes are in kitchen, 4X in office, 11X in bedroom 1 and so on.

                                    I would love to see a proxy mode in MYSController, in order to interface between a controller that doesn't support OTA and an Ethernet gateway :heart_eyes:

                                    Let say your LAN is the following:

                                    • MySensors gateway 192.168.0.1
                                    • controller (raspberry + Domoticz or else) 192.168.0.2
                                    • PC with MYSController 192.168.0.3

                                    Whenever you need to update a node, you launch MYSController but don't connect to the gateway, then you tells Domoticz .2 to connect to MYSController .3 instead of the gateway .1, at this point MYSController starts relaying everything between Domoticz and the gateway + provides you the ability to update a node.

                                    When you want to get back to normal operations, you set back 192.168.0.1 on Domoticz, MYSController receives a TCP reset and ends it's session with Domoticz and stop the session with the gateway.

                                    We would get a minimum downtime and can could use MYSController to update nodes and debug traffic while letting the normal controller...controlling

                                    NiklasON Offline
                                    NiklasON Offline
                                    NiklasO
                                    wrote on last edited by
                                    #32

                                    @NiklasO
                                    Personally I set the node ID manually to avoid this
                                    #define MY_NODE_ID 30 // Sets a static id for a node
                                    And I group tens so all my 3X nodes are in kitchen, 4X in office, 11X in bedroom 1 and so on.

                                    Ah, yes. Setting static id sound like a solution to my problem. Thanks.

                                    1 Reply Last reply
                                    0
                                    • JCLBJ JCLB

                                      @pku if your keys are in the sketch everything will work for signing.
                                      #define MY_SOFT_HMAC_KEY XXX... //signing key
                                      #define MY_AES_KEY XXX... // if you use encryption
                                      Of course if you want to use whitelisting then you need to compile each node sketch separately with it's serial.

                                      @NiklasO
                                      Personally I set the node ID manually to avoid this
                                      #define MY_NODE_ID 30 // Sets a static id for a node
                                      And I group tens so all my 3X nodes are in kitchen, 4X in office, 11X in bedroom 1 and so on.

                                      I would love to see a proxy mode in MYSController, in order to interface between a controller that doesn't support OTA and an Ethernet gateway :heart_eyes:

                                      Let say your LAN is the following:

                                      • MySensors gateway 192.168.0.1
                                      • controller (raspberry + Domoticz or else) 192.168.0.2
                                      • PC with MYSController 192.168.0.3

                                      Whenever you need to update a node, you launch MYSController but don't connect to the gateway, then you tells Domoticz .2 to connect to MYSController .3 instead of the gateway .1, at this point MYSController starts relaying everything between Domoticz and the gateway + provides you the ability to update a node.

                                      When you want to get back to normal operations, you set back 192.168.0.1 on Domoticz, MYSController receives a TCP reset and ends it's session with Domoticz and stop the session with the gateway.

                                      We would get a minimum downtime and can could use MYSController to update nodes and debug traffic while letting the normal controller...controlling

                                      AndurilA Offline
                                      AndurilA Offline
                                      Anduril
                                      wrote on last edited by
                                      #33

                                      @JCLB said:

                                      @pku if your keys are in the sketch everything will work for signing.
                                      #define MY_SOFT_HMAC_KEY XXX... //signing key
                                      #define MY_AES_KEY XXX... // if you use encryption
                                      Of course if you want to use whitelisting then you need to compile each node sketch separately with it's serial.

                                      but that would give a listener your full MY_SOFT_HMAC_KEY and signing would be useless in future. Therefor it is better to write the key in eeprom with cable and later only update firmware without key via OTA.

                                      pkuP 1 Reply Last reply
                                      0
                                      • AndurilA Anduril

                                        @JCLB said:

                                        @pku if your keys are in the sketch everything will work for signing.
                                        #define MY_SOFT_HMAC_KEY XXX... //signing key
                                        #define MY_AES_KEY XXX... // if you use encryption
                                        Of course if you want to use whitelisting then you need to compile each node sketch separately with it's serial.

                                        but that would give a listener your full MY_SOFT_HMAC_KEY and signing would be useless in future. Therefor it is better to write the key in eeprom with cable and later only update firmware without key via OTA.

                                        pkuP Offline
                                        pkuP Offline
                                        pku
                                        wrote on last edited by
                                        #34

                                        @Anduril

                                        1. I agree, keys located in sketch can be used as workaround only, because the security is broken.
                                        2. But I'm interesting in key located in EEPROM. How it is work during flashing? If Clear EEPROM fuse is not set then everybody can take my outside node, put his own firmware and it will work with keys from EEPROM. It is again a security issue (of course he must have physical access to my node).
                                          I thing it should work with this scenario:
                                        • reguest for new firmware
                                        • copy key, serial and rsa into RAM
                                        • flash new firmware (with fuse clear EEPROM)
                                        • copy key, serial and rsa back into EEPROM

                                        What do you thing?

                                        1 Reply Last reply
                                        0
                                        • AndurilA Offline
                                          AndurilA Offline
                                          Anduril
                                          wrote on last edited by
                                          #35

                                          For a node that is physically accessable it is realy hard. First: does this node needs signing? For sensor data you don't need in most cases. Maybe you should use the hardware chip, there you can't read out the key and if it was locked you also can't change it.
                                          If you still need to use softsigning you could use whitelisting and revoke the whitelist-entry in case of corruption.

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


                                          12

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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