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. General Discussion
  3. Send msg in background

Send msg in background

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 1.2k Views 3 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.
  • zsakulZ Offline
    zsakulZ Offline
    zsakul
    wrote on last edited by
    #1

    Hello

    I'm writing program for work with my waterpump.

    If the waterlevel is rich I would to turn on relay and (maybe in background_ I would like to send information to domoticz.
    Normally it works fine but if it a problem with connection to the gateway the program don't start...

    I cut code about Pump to make it easy to understand . I should see in console: "PUMP WORK" and "START"

    I get in console:
    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    TSM:RADIO:OK
    TSP:ASSIGNID:OK (ID=1)
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    TSM:PDT

    My code:

    // Enable debug prints to serial monitor
    #define MY_DEBUG

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69

    // Enabled repeater feature for this node
    //#define MY_REPEATER_FEATURE

    #include <SPI.h>
    #include <MySensors.h>

    //#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
    #define MY_TRANSPORT_DONT_CARE_MODE

    #define CHILD_ID 1 // turn on pump

    MyMessage msg(CHILD_ID,V_LIGHT);

    void setup()
    {
    //Serial.begin(115200);
    Serial.println(" START ");
    }

    void presentation() {

    // Send the sketch version information to the gateway and Controller
    sendSketchInfo("Pump", "1.0");

    // Register all sensors to gw (they will be created as child devices)
    present(CHILD_ID, S_LIGHT);

    }

    void loop() {

    ////......SOME CODE
    Serial.println("PUMP WORK");
    send(msg.set(true), true);
    }

    1 Reply Last reply
    0
    • petewillP Offline
      petewillP Offline
      petewill
      Admin
      wrote on last edited by
      #2

      @zsakul I know this is really late but I was just doing a search and came across your post. Hopefully you have found the solution but if not you need to put "#define MY_TRANSPORT_DONT_CARE_MODE" above #include <MySensors.h> in your code. Also, MY_TRANSPORT_DONT_CARE_MODE has been replaced by MY_TRANSPORT_WAIT_READY_MS 1 in the most recent version.

      My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

      1 Reply Last reply
      1
      • zsakulZ Offline
        zsakulZ Offline
        zsakul
        wrote on last edited by
        #3

        It's not working.

        Can I change also something in Config.h ?

        petewillP 1 Reply Last reply
        0
        • zsakulZ zsakul

          It's not working.

          Can I change also something in Config.h ?

          petewillP Offline
          petewillP Offline
          petewill
          Admin
          wrote on last edited by
          #4

          @zsakul Try downloading the latest version from github. The master branch will be updated to version 2.1 very soon and I recommend waiting for that. https://github.com/mysensors/MySensors/tree/master

          Once you have updated you should be able to use MY_TRANSPORT_WAIT_READY_MS in your code. I have it working in my device.

          You could change MY_TRANSPORT_WAIT_READY_MS in the myconfig.h file but if you do it there every node you build will have this setting (which my not be desired).

          My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

          1 Reply Last reply
          1
          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.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