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. Get string data

Get string data

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 4 Posters 4.1k Views 2 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.
  • C Offline
    C Offline
    C.r.a.z.y.
    wrote on last edited by
    #1

    String sentData = ""
    send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1

    How can i put this serial monitor print to sentData ?

    C B 2 Replies Last reply
    0
    • C C.r.a.z.y.

      String sentData = ""
      send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1

      How can i put this serial monitor print to sentData ?

      C Offline
      C Offline
      C.r.a.z.y.
      wrote on last edited by
      #2

      Is it impossible?

      H 1 Reply Last reply
      0
      • C C.r.a.z.y.

        Is it impossible?

        H Offline
        H Offline
        hek
        Admin
        wrote on last edited by
        #3

        @C.r.a.z.y.

        Sorry, I don't understand.

        1 Reply Last reply
        0
        • C C.r.a.z.y.

          String sentData = ""
          send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1

          How can i put this serial monitor print to sentData ?

          B Offline
          B Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #4

          @C.r.a.z.y. said:

          String sentData = ""
          send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1

          How can i put this serial monitor print to sentData ?

          are you looking to log these serial outputs as Strings?

          C 1 Reply Last reply
          0
          • B BulldogLowell

            @C.r.a.z.y. said:

            String sentData = ""
            send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:1

            How can i put this serial monitor print to sentData ?

            are you looking to log these serial outputs as Strings?

            C Offline
            C Offline
            C.r.a.z.y.
            wrote on last edited by
            #5

            @BulldogLowell Yes :+1:

            1 Reply Last reply
            0
            • C Offline
              C Offline
              C.r.a.z.y.
              wrote on last edited by
              #6

              Maybe i am asking wrong;
              If there is "fail"

              send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0

              it will reboot

              if (re.indexOf("fail") >=0)
              {
              asm volatile (" jmp 0"); //reboot
              }

              Why i need this; because i cant turn on or off my lights when sketch failed.

              F 1 Reply Last reply
              0
              • C C.r.a.z.y.

                Maybe i am asking wrong;
                If there is "fail"

                send: 51-51-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:0

                it will reboot

                if (re.indexOf("fail") >=0)
                {
                asm volatile (" jmp 0"); //reboot
                }

                Why i need this; because i cant turn on or off my lights when sketch failed.

                F Offline
                F Offline
                funky81
                wrote on last edited by
                #7

                @C.r.a.z.y.

                @C.r.a.z.y. said:

                if (re.indexOf("fail") >=0)
                {
                asm volatile (" jmp 0"); //reboot
                }

                sorry for asking this, but is this the code for reboot?
                does it work?

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  C.r.a.z.y.
                  wrote on last edited by
                  #8

                  Maybe one day someone will use this;

                  **When sketch fails second push will work without gateway and it will restart
                  **

                  void loop()
                  {
                  gw.process();
                  debouncer.update();
                  value = debouncer.read();

                  if (value != oldValue && value==0) {
                  if (re!="1")
                  {
                  int oku=digitalRead(RELAY_PIN);
                  if(oku==1)
                  {
                  digitalWrite(RELAY_PIN,0);
                  }
                  else
                  {
                  digitalWrite(RELAY_PIN,1);
                  }
                  asm volatile (" jmp 0"); //reboot
                  }
                  gw.send(msg.set(state?false:true),true); // Send new state and request ack back
                  re="";
                  }
                  oldValue = value;
                  }

                  void incomingMessage(const MyMessage &message) {
                  state = message.getBool();
                  digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
                  gw.saveState(CHILD_ID, state);
                  Serial.print("Incoming change for sensor:");
                  Serial.print(message.sensor);
                  Serial.print(", New status: ");
                  Serial.println(message.getBool());
                  re=String(message.sensor);
                  }

                  F 1 Reply Last reply
                  1
                  • C C.r.a.z.y.

                    Maybe one day someone will use this;

                    **When sketch fails second push will work without gateway and it will restart
                    **

                    void loop()
                    {
                    gw.process();
                    debouncer.update();
                    value = debouncer.read();

                    if (value != oldValue && value==0) {
                    if (re!="1")
                    {
                    int oku=digitalRead(RELAY_PIN);
                    if(oku==1)
                    {
                    digitalWrite(RELAY_PIN,0);
                    }
                    else
                    {
                    digitalWrite(RELAY_PIN,1);
                    }
                    asm volatile (" jmp 0"); //reboot
                    }
                    gw.send(msg.set(state?false:true),true); // Send new state and request ack back
                    re="";
                    }
                    oldValue = value;
                    }

                    void incomingMessage(const MyMessage &message) {
                    state = message.getBool();
                    digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
                    gw.saveState(CHILD_ID, state);
                    Serial.print("Incoming change for sensor:");
                    Serial.print(message.sensor);
                    Serial.print(", New status: ");
                    Serial.println(message.getBool());
                    re=String(message.sensor);
                    }

                    F Offline
                    F Offline
                    funky81
                    wrote on last edited by
                    #9

                    @C.r.a.z.y. Thanks for the code, very useful, coz I've found out is that i have to restart my pro mini every couple of days...

                    C 1 Reply Last reply
                    0
                    • F funky81

                      @C.r.a.z.y. Thanks for the code, very useful, coz I've found out is that i have to restart my pro mini every couple of days...

                      C Offline
                      C Offline
                      C.r.a.z.y.
                      wrote on last edited by
                      #10

                      @funky81 Hek can make better but he didnt understand as you see :-1:

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      14

                      Online

                      12.1k

                      Users

                      11.2k

                      Topics

                      113.4k

                      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