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 3.4k 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 BulldogLowellB 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?

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

        Is it impossible?

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

          BulldogLowellB Offline
          BulldogLowellB 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
          • BulldogLowellB 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.

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

                funky81F Offline
                funky81F 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);
                  }

                  funky81F 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);
                    }

                    funky81F Offline
                    funky81F 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
                    • funky81F 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
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      13

                      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