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. Hardware
  3. Sensebender/Dualoptiboot OTA HowTo in Mysensors

Sensebender/Dualoptiboot OTA HowTo in Mysensors

Scheduled Pinned Locked Moved Hardware
25 Posts 10 Posters 12.9k Views 18 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.
  • ahmedadelhosniA Offline
    ahmedadelhosniA Offline
    ahmedadelhosni
    wrote on last edited by
    #2

    Great tutorial. It is now more clear for me.
    I'll update you with my results within 2 weeks... i hope :)

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

      @tekka I have updated the first part of this howto. Can you just tell me if it looks ok for you, less ambiguous, missing important notes, please ?? Thx in advance :)

      1 Reply Last reply
      0
      • carlierdC Offline
        carlierdC Offline
        carlierd
        wrote on last edited by
        #4

        @scalz

        Nice tutorial.
        I already bought and received your eval board. I ordered it more for ATSHA204A but OTA is interesting.
        Is OTA using eeprom possible with RFM69 ? I imagine that it's the case.
        Thanks.

        David.

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

          @carlierd: hi. thx :) Yes you're right, you can use both nrf or rfm69 radio with this dualoptiboot ota (no radio code in bootloader).

          1 Reply Last reply
          0
          • E Offline
            E Offline
            emc2
            Hardware Contributor
            wrote on last edited by
            #6

            @scalz Great tutorial thanks. I plan to give it a try this week end but I was wondering if you had any test sketch to check if the arduino can talk to the flash.

            Just a quick way to test, before flashing a new bootloader, if all pins are correctly soldered.

            So far I know that ATSHA204A is recognized as I can read the config but no luck finding anything similar for the eeprom.

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

              @emc2
              thx.
              you can use example sketch from spiflash lib ;)

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

                This one? https://github.com/mysensors/Arduino/blob/development/libraries/SPIFlash/examples/SPIFlash_ReadWrite/SPIFlash_ReadWrite.ino

                Great I will give it a try tonight!

                By the way, is it me or in the current dev branch lost https://github.com/mysensors/Arduino/tree/fb1c542862221f0678485a553b46120bf09c6a91/libraries/MySensors/examples/Sha204Personalizer at some point?

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  emc2
                  Hardware Contributor
                  wrote on last edited by
                  #9
                  Start...Init FAIL!
                  

                  Well I guess something is wrong

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

                    @emc2
                    depending on the eeprom you're using, you may need to change the corresponding jedec code in the sketch (I don't remember well). you can find the eeprom jedec code in datasheet if not the same. but in mysensors it should work. or you have a bad wiring perhaps..

                    1 Reply Last reply
                    1
                    • E Offline
                      E Offline
                      emc2
                      Hardware Contributor
                      wrote on last edited by
                      #11

                      Got it, thanks @scalz !

                      I had indeed to remove the ID from

                      SPIFlash flash(FLASH_SS, 0xEF30);
                      

                      and leave it blank (or use 0x1F65 for the AT25DF512C):

                      SPIFlash flash(FLASH_SS);
                      

                      Next step OTA flashing... but tomorrow.

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

                        :thumbsup:

                        1 Reply Last reply
                        0
                        • alexsh1A Offline
                          alexsh1A Offline
                          alexsh1
                          wrote on last edited by
                          #13

                          I have AT25512N-SH-T SOIC-8 -> http://www.mouser.com/ds/2/36/Atmel-5165-SEEPROM-AT25512-Datasheet-476711.pdf
                          I so have a different bootloader - http://www.boardstuff.co.uk. I think I can use it with the flash as it does have 8 pins socket.

                          However, I am a complete noob when it comes to the OTA. Is this the way to do it:

                          1. Burn Optiboot onto the Sensebender
                          2. Why do you have external eeprom board? I think the Sensebender has 64kb SPI flash / e2prom onboard.

                          Thanks for an excellent tutorial.

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

                            @alexsh1
                            i don't know for your eeprom, i don't have time right now, but that need to check datasheet, same pin footprint is not enough.

                            1. you need to burn DualOptiboot, it's not optiboot. Optiboot does not handle ota.
                            2. The board is an eval board for ota/auth. that's all. it could be used in some diy projects but i integrate the eeprom on my pcbs of course.
                            1 Reply Last reply
                            0
                            • alexsh1A Offline
                              alexsh1A Offline
                              alexsh1
                              wrote on last edited by
                              #15

                              @scalz Thanks! The sensebender had already the eeprom IC right? So no need to do anything external

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

                                @alexsh1 yes, no need. thx for feedback. I will modify my howto and add a link to the post relating eeprom compatibility too.

                                alexsh1A 1 Reply Last reply
                                0
                                • scalzS scalz

                                  @alexsh1 yes, no need. thx for feedback. I will modify my howto and add a link to the post relating eeprom compatibility too.

                                  alexsh1A Offline
                                  alexsh1A Offline
                                  alexsh1
                                  wrote on last edited by
                                  #17

                                  @scalz only the bootloader change to Dualoptiboot on a node is required with some change of code, right? Does eeprom IC have to be programed as well or it is fully changed by Dualoptiboot + sketch?

                                  1 Reply Last reply
                                  0
                                  • KoreshK Offline
                                    KoreshK Offline
                                    Koresh
                                    Contest Winner
                                    wrote on last edited by Koresh
                                    #18

                                    Thanks for this incredible tutorial. :thumbsup:
                                    I've found almost all answers here and now I want only confirmation of my thoughts :)
                                    I am prepearing my Wall Socket insertable node for production so I am making latest changes on the board. I decided to add SPI flash to implement OTA ability (see picture - U5). I plan to use dualboot.
                                    alt text
                                    As I understand the sketch works during loading firmware over the air, so it doesn't matter how much time it takes because my sketch can send heartbeat impulses to external watchdog during updating. Is it correct?
                                    Second, I didn't want to add spi flash to Wall switch insertable node, but now I am having doubts. If I understand correctly there is no problem to update sleeping node because it will get update messages when it wakes up. Is it true? :)
                                    Thanks!

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

                                      @koresh thx i'm glad if it helped you.

                                      1. not sure what you mean with "how much time... because external wdt". I was referring about the time it could take for battery powered device. because some sensors lib can have delays for instance, and keeping the readings process during ota could slow ota reception. but I have not checked the behaviour in the new lib yet.
                                      2. I think so, depending of the controller used.
                                      1 Reply Last reply
                                      0
                                      • KoreshK Koresh

                                        Thanks for this incredible tutorial. :thumbsup:
                                        I've found almost all answers here and now I want only confirmation of my thoughts :)
                                        I am prepearing my Wall Socket insertable node for production so I am making latest changes on the board. I decided to add SPI flash to implement OTA ability (see picture - U5). I plan to use dualboot.
                                        alt text
                                        As I understand the sketch works during loading firmware over the air, so it doesn't matter how much time it takes because my sketch can send heartbeat impulses to external watchdog during updating. Is it correct?
                                        Second, I didn't want to add spi flash to Wall switch insertable node, but now I am having doubts. If I understand correctly there is no problem to update sleeping node because it will get update messages when it wakes up. Is it true? :)
                                        Thanks!

                                        martinhjelmareM Offline
                                        martinhjelmareM Offline
                                        martinhjelmare
                                        Plugin Developer
                                        wrote on last edited by
                                        #20

                                        @Koresh

                                        Make sure you wait for a little bit (~300 ms) before going back to sleep in the sketch, to give the controller time to send the reboot command to the node. The firmware config request is sent from the node in the begin method.

                                        When I implemented firmware updates in the pymysensors library I made sure to only send the reboot command after receiving a set command from a node. That way the node should be awake to receive the reboot command if it waits a bit before going back to sleep. I'm not sure how the other controllers that support ota firmware updates have solved this.

                                        1 Reply Last reply
                                        0
                                        • V Offline
                                          V Offline
                                          vikasjee
                                          wrote on last edited by vikasjee
                                          #21

                                          Any sample optimised sketch for the OTA enabled sketch?

                                          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