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. Controllers
  3. MYSController supports Sensebender Micro OTA FW updates

MYSController supports Sensebender Micro OTA FW updates

Scheduled Pinned Locked Moved Controllers
20 Posts 4 Posters 9.0k Views 4 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.
  • scalzS scalz

    @tekka: thank you for helping, cool!
    Oki, maybe I will use MYSBootloader next, if I can't get it working. I am testing this because I designed some boards that I am debugging and I have eeprom on it (and I would like to have both ota and usb bootloading, I don't remember if there is ubs bootloading on MYSbootloader..).
    But for moment I am debuggin this on breadboard, I have a small breadboard with atsha& eeprom only for testings (but in these tests, atsha is not connected).

    My eeprom ref is : AT25DF512C-SSHN-B. I think it is same on Sensebender. But not the same on moteino (W25X40CLSNIG).

    I have done two tests : one with 56k pullup on CSN, and next without pullups. I got same things. Strange.. In the two tests, it did not started FW upload each time. Sometimes I needed to reset arduino : there was init flash error.
    And when FW ulpoad started, it took maybe 15minutes to upload...and then I got fw crc check error.. (the GW and nodes are maybe 2feets each others, and I use nrf24 for the moment)
    If you want MYSController logs, I can give them.
    Here my serial monitor log for the node : you will see I have tried few times, then it started, and at the end crc check error. Do you think it is my eeprom, which ref do you use?
    serial monitor log_node.txt

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

    @scalz indeed, the log says that there is a problem initializing the ext. flash:

    read: 0-0-10 s=0,c=4,t=1,pt=6,l=8,sg=0:6E00010000031413
    fw update
    > flash init fail

    Maybe @tbowmo can give you some hints how the flash chip is wired?

    1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by tbowmo
      #7

      @scalz

      What pin did you use as CS for the flash? (DualOptiboot for the sensebender defaults to D8)

      Have you tried to make a sketch that writes / reads data from the external flash, to verify that you can communicate with it?

      f.ex. the following code:

      #include <SPIFlash.h>
      #include <SPI.h>
      
      SPIFlash sp(8, 0xEF30);
      #define testpin A2
      
      void setup() {
        // put your setup code here, to run once:
        Serial.begin(115200);
        //  pinMode(1,OUTPUT);
        pinMode(testpin, OUTPUT);
      //  gw.begin();
        Serial.print("Flash test program");
        sp.initialize();
        Serial.print(sp.readDeviceId);
        Serial.print(sp.readUniqueId);
      }
      
      void loop() {
        delay(500);
        digitalWrite(testpin, HIGH);
        delay(500);
        digitalWrite(testpin, LOW);
      }
      
      

      The pullup is there, to make sure that the flash is disabled, when doing FW upload via ISP. As ISP is using the same pins as the SPI interface for nrf / flash chip. @blacey had found that the pullup is needed in some cases, otherwise programming via ISP could fail.

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

        @tekka: yes, strange, but then it started.
        @tbowmo: thx. I will try your code. CS on D8. My test breadboard:
        2015-07-30_23-49-23.png
        I tried spiflash sample code in the lib. Init fail too, I needed to do this to have init ok. But when I hit 'i' for device it I get 0 or ff. And if I erase 'e' then read dump it seems that is not erased (I should see ff or 00 only I think).

        //SPIFlash flash(FLASH_SS, 0xEF30);
        //SPIFlash flash(FLASH_SS, 0x1F44);
        //SPIFlash flash(FLASH_SS, 0x1F65);
        SPIFlash flash(FLASH_SS);
        

        Tomorrow I will recheck my breadboard and wiring. strange. I was just looking into Mysensors dev libs to learn how all is done when I saw your msg. thx

        oh and I tried with 56k pullups too. nothing better...

        tekkaT 2 Replies Last reply
        1
        • scalzS scalz

          @tekka: yes, strange, but then it started.
          @tbowmo: thx. I will try your code. CS on D8. My test breadboard:
          2015-07-30_23-49-23.png
          I tried spiflash sample code in the lib. Init fail too, I needed to do this to have init ok. But when I hit 'i' for device it I get 0 or ff. And if I erase 'e' then read dump it seems that is not erased (I should see ff or 00 only I think).

          //SPIFlash flash(FLASH_SS, 0xEF30);
          //SPIFlash flash(FLASH_SS, 0x1F44);
          //SPIFlash flash(FLASH_SS, 0x1F65);
          SPIFlash flash(FLASH_SS);
          

          Tomorrow I will recheck my breadboard and wiring. strange. I was just looking into Mysensors dev libs to learn how all is done when I saw your msg. thx

          oh and I tried with 56k pullups too. nothing better...

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

          @scalz said:

          @tekka: yes, strange, but then it started.

          I see, the OTA code should abort if the flash init fails. Will post a PR.

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

            ok. so it seems to be an electronical problem. I have to get init ok. I will check this tomorrow.
            So if I understand right, init was nok, but it transmitted all fw. and about the crc check error at the end. is it calculated from eeprom fw or during transfer in memory? I have not checked yet in the lib.

            tekkaT 1 Reply Last reply
            0
            • scalzS scalz

              ok. so it seems to be an electronical problem. I have to get init ok. I will check this tomorrow.
              So if I understand right, init was nok, but it transmitted all fw. and about the crc check error at the end. is it calculated from eeprom fw or during transfer in memory? I have not checked yet in the lib.

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

              @scalz CRC is calculated from flash after all FW blocks are transmitted. In your case the FW blocks were not written resulting in CRC mismatch.

              1 Reply Last reply
              0
              • scalzS scalz

                @tekka: yes, strange, but then it started.
                @tbowmo: thx. I will try your code. CS on D8. My test breadboard:
                2015-07-30_23-49-23.png
                I tried spiflash sample code in the lib. Init fail too, I needed to do this to have init ok. But when I hit 'i' for device it I get 0 or ff. And if I erase 'e' then read dump it seems that is not erased (I should see ff or 00 only I think).

                //SPIFlash flash(FLASH_SS, 0xEF30);
                //SPIFlash flash(FLASH_SS, 0x1F44);
                //SPIFlash flash(FLASH_SS, 0x1F65);
                SPIFlash flash(FLASH_SS);
                

                Tomorrow I will recheck my breadboard and wiring. strange. I was just looking into Mysensors dev libs to learn how all is done when I saw your msg. thx

                oh and I tried with 56k pullups too. nothing better...

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

                @scalz btw. is this s typo or are you connecting MISO to SI and MOSI to SO on the ext. flash? This may be the issue...

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

                  @tekka: sorry I think i don't understand? what is s typo, do you mean ref of eeprom (AT25DF512C-SSHN-B)? and yes MISO to SI on ext flash, MOSI-SO...is it wrong? how should it be?

                  tekkaT 1 Reply Last reply
                  0
                  • scalzS scalz

                    @tekka: sorry I think i don't understand? what is s typo, do you mean ref of eeprom (AT25DF512C-SSHN-B)? and yes MISO to SI on ext flash, MOSI-SO...is it wrong? how should it be?

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

                    @scalz have a look at http://forum.mysensors.org/topic/510/minimal-design-thoughts/25
                    MISO to SO and MOSI to SI

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

                      @tekka: waaw. too strong! I didn't see it! too bad :flushed: :flushed:. you saved me..tomorrow I will check all of this. thank you guys :thumbsup:
                      I think it will be ok now. Hopefully it was just my first batch and I have some changes, so. but it is good to know. next time I'll be much more careful. it's first time I use ext eeprom, so you are right about typo...

                      tekkaT 1 Reply Last reply
                      0
                      • scalzS scalz

                        @tekka: waaw. too strong! I didn't see it! too bad :flushed: :flushed:. you saved me..tomorrow I will check all of this. thank you guys :thumbsup:
                        I think it will be ok now. Hopefully it was just my first batch and I have some changes, so. but it is good to know. next time I'll be much more careful. it's first time I use ext eeprom, so you are right about typo...

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

                        @scalz no problem. Good luck!

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

                          @tekka @tbowmo: I inverted MOSI and MISO wire on my breadboard. Now with SPIFlash example, it looks ok with Jedec id 1F65. So I retried ota (and I keep only gw.process in main loop now so transfer is faster of course). Unfortunately "fw checksum fail" at the end..
                          my log here if you want :logs1.txt
                          Maybe tomorrow I will be luckier and will find what happens now..

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

                            and now the good news for me is ... it is working, yeah! A small break with my mookjong, it gave me an idea:smiley:. And if my previous mistakes have done wrong config in eeprom???maybe I am wrong, but I have changed eeprom and ota is working very well now! So cool!
                            thank you for your patience...

                            1 Reply Last reply
                            0
                            • tbowmoT Offline
                              tbowmoT Offline
                              tbowmo
                              Admin
                              wrote on last edited by
                              #19

                              Good to hear @scalz, congratulations on getting it to work :)

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

                                yes, I am very happy. I can finish the design of my ultra low power node now! it is a camel like (sub-uA) :smiley:

                                I have just a last question for @hek about ota:
                                I looked into the lib. And of course, ota is not interfered by sleeping. But it can be interfered by some process in main loop like sensors, delays... And it can take very long time for ota in these case if we don't optimize our loop. It is logic I understand. So I am looking for a way of preventing this because for a battery-powered node it could be problematic to have an ota transferring for minutes (15min for DHT sketch for example).

                                I saw you use fwUpdateOngoing for this in class, and it is protected, and I understand why. But it could be useful if we could have read access to it like a Get/IsOtaPending() Method. Just a get, not a set of course. Do you think you could add this feature? Or do I need to make my own class and derive it from Mysensors class?
                                Just a thought...What do you think about this?

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


                                17

                                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