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. Windows GUI/Controller for MySensors

Windows GUI/Controller for MySensors

Scheduled Pinned Locked Moved Controllers
myscontrollermysbootloader
486 Posts 101 Posters 348.4k Views 73 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.
  • rvendrameR rvendrame

    @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....

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

    @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?

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #208

      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.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gonzalonal
        wrote on last edited by gonzalonal
        #209

        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

        tekkaT 1 Reply Last reply
        1
        • G gonzalonal

          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

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

          @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;
            }
          
          }
          
          1 Reply Last reply
          0
          • G Offline
            G Offline
            gonzalonal
            wrote on last edited by gonzalonal
            #211

            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

            tekkaT 1 Reply Last reply
            0
            • G gonzalonal

              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

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

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

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gonzalonal
                wrote on last edited by
                #213

                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.

                tekkaT 1 Reply Last reply
                1
                • G gonzalonal

                  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.

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

                  @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.

                  G 1 Reply Last reply
                  0
                  • tekkaT tekka

                    @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.

                    G Offline
                    G Offline
                    gonzalonal
                    wrote on last edited by
                    #215

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

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      zuru
                      wrote on last edited by
                      #216

                      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.

                      tekkaT 1 Reply Last reply
                      0
                      • Z zuru

                        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.

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

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

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          zuru
                          wrote on last edited by
                          #218

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

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

                            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

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              allysmith
                              wrote on last edited by
                              #220

                              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??

                              tekkaT 1 Reply Last reply
                              0
                              • A allysmith

                                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??

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

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

                                A 1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  ericvdb
                                  wrote on last edited by
                                  #222

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

                                  tekkaT 1 Reply Last reply
                                  0
                                  • E ericvdb

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

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

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

                                    1 Reply Last reply
                                    0
                                    • tekkaT tekka

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

                                      A Offline
                                      A Offline
                                      allysmith
                                      wrote on last edited by
                                      #224

                                      @tekka Thanks for getting back to me. This is my my first go at this bootloader. Hope I am not doing something daft!

                                      I have Arduino IDE 1.6.5, MySensors 1.5, MYSBootloader 1.1, MYSController_0_1_2_282 running on Windows 8, USBasp to urn bootloader.

                                      Arduino Pro Mini 3.3v 8mhz board. I am using the standard settings in your write up for the boards.txt

                                      Log file hopefully attached.

                                      MySensors_20150901-185920.log

                                      tekkaT 1 Reply Last reply
                                      0
                                      • A allysmith

                                        @tekka Thanks for getting back to me. This is my my first go at this bootloader. Hope I am not doing something daft!

                                        I have Arduino IDE 1.6.5, MySensors 1.5, MYSBootloader 1.1, MYSController_0_1_2_282 running on Windows 8, USBasp to urn bootloader.

                                        Arduino Pro Mini 3.3v 8mhz board. I am using the standard settings in your write up for the boards.txt

                                        Log file hopefully attached.

                                        MySensors_20150901-185920.log

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

                                        @allysmith Try clearing EEPROM via MYSBootloader command, assign blink FW and upload the entire log again....

                                        A 1 Reply Last reply
                                        0
                                        • tekkaT tekka

                                          @allysmith Try clearing EEPROM via MYSBootloader command, assign blink FW and upload the entire log again....

                                          A Offline
                                          A Offline
                                          allysmith
                                          wrote on last edited by
                                          #226

                                          @tekka As requested, cleared EEPROM via MYSBootloader, assigned blink FW.
                                          Attached is the log.
                                          Device shows up in the nodes window as Booting: 65535:65535 (BL1.1)

                                          MySensors_20150902-055736.log

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


                                          14

                                          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