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. MYSController REQUEST_PRESENTATION thing on build 3314

MYSController REQUEST_PRESENTATION thing on build 3314

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 3 Posters 1.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.
  • dougD Offline
    dougD Offline
    doug
    wrote on last edited by
    #1

    One for @TEKKA I suppose

    I'm having a problem getting request_presentation to work it looks like that if you have more than one send command it transmits over the request presentation message and hence you never receive it.

    This code dosen't work

    send(rtc.set(timeBuff));
    send(temp.set(celsius, 2));
    send(vbattery.set(voltage, 2));
    sendBatteryLevel(batLevel);

    smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

    This code does work

    send(rtc.set(timeBuff));
    wait(100);
    send(temp.set(celsius, 2));
    send(vbattery.set(voltage, 2));
    sendBatteryLevel(batLevel);

    smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

    It seems that the wait I have put in there between the sends allows the presentation message through as it seems to be sent after the first message is received and maybe it should be sent after the I_HEARTBEAT_RESPONSE instead.

    Got any thoughts on this

    mfalkviddM tekkaT 2 Replies Last reply
    0
    • dougD doug

      One for @TEKKA I suppose

      I'm having a problem getting request_presentation to work it looks like that if you have more than one send command it transmits over the request presentation message and hence you never receive it.

      This code dosen't work

      send(rtc.set(timeBuff));
      send(temp.set(celsius, 2));
      send(vbattery.set(voltage, 2));
      sendBatteryLevel(batLevel);

      smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

      This code does work

      send(rtc.set(timeBuff));
      wait(100);
      send(temp.set(celsius, 2));
      send(vbattery.set(voltage, 2));
      sendBatteryLevel(batLevel);

      smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

      It seems that the wait I have put in there between the sends allows the presentation message through as it seems to be sent after the first message is received and maybe it should be sent after the I_HEARTBEAT_RESPONSE instead.

      Got any thoughts on this

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @doug could be related to https://forum.mysensors.org/topic/4450/sensor-presentation-failure/2

      1 Reply Last reply
      1
      • dougD doug

        One for @TEKKA I suppose

        I'm having a problem getting request_presentation to work it looks like that if you have more than one send command it transmits over the request presentation message and hence you never receive it.

        This code dosen't work

        send(rtc.set(timeBuff));
        send(temp.set(celsius, 2));
        send(vbattery.set(voltage, 2));
        sendBatteryLevel(batLevel);

        smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

        This code does work

        send(rtc.set(timeBuff));
        wait(100);
        send(temp.set(celsius, 2));
        send(vbattery.set(voltage, 2));
        sendBatteryLevel(batLevel);

        smartSleep(digitalPinToInterrupt(INTERRUPT_PIN),FALLING,0);

        It seems that the wait I have put in there between the sends allows the presentation message through as it seems to be sent after the first message is received and maybe it should be sent after the I_HEARTBEAT_RESPONSE instead.

        Got any thoughts on this

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

        @doug This is not MYSController related, but as @mfalkvidd hinted at, a GW speed issue (RX FIFO full & GW too slow to process all messages)

        1 Reply Last reply
        0
        • dougD Offline
          dougD Offline
          doug
          wrote on last edited by
          #4

          My apologies I'm not sure I explained the issue very well can I try again.

          What happens on MYSController 3314 is that the request presentation message is sent after the first message has been received. Hence it is transmitting at the same time as the node sends/transmits the next sensors data.

          I guess the code extract from MySensorsCore.cpp below shows that the waiting period for the presentation message from the controller starts after the heartbeat is sent. This methodology of sending the heartbeat after all the messages have been sent tells the controller that it is ok now to respond as I'm not going to send anything else and its safe to send me something.

          int8_t smartSleep(unsigned long ms) {
          // notify controller about going to sleep
          sendHeartbeat();
          // listen for incoming messages
          wait(MY_SMART_SLEEP_WAIT_DURATION);
          return sleep(ms);
          }

          Hence I guess any controller should really wait until the heartbeat is sent before transmitting the request presentation message rather than replying after the first send is received.

          The messing around with the wait(100) between sends was really just to confirm that the request presentation message was being received before the heartbeat was being sent which it confirms as it works. I.e it gives a window where the message can be received before the second sensor sends its data.

          I must say though that I do love this application and thanks for putting the effort into creating it.

          tekkaT 1 Reply Last reply
          1
          • dougD doug

            My apologies I'm not sure I explained the issue very well can I try again.

            What happens on MYSController 3314 is that the request presentation message is sent after the first message has been received. Hence it is transmitting at the same time as the node sends/transmits the next sensors data.

            I guess the code extract from MySensorsCore.cpp below shows that the waiting period for the presentation message from the controller starts after the heartbeat is sent. This methodology of sending the heartbeat after all the messages have been sent tells the controller that it is ok now to respond as I'm not going to send anything else and its safe to send me something.

            int8_t smartSleep(unsigned long ms) {
            // notify controller about going to sleep
            sendHeartbeat();
            // listen for incoming messages
            wait(MY_SMART_SLEEP_WAIT_DURATION);
            return sleep(ms);
            }

            Hence I guess any controller should really wait until the heartbeat is sent before transmitting the request presentation message rather than replying after the first send is received.

            The messing around with the wait(100) between sends was really just to confirm that the request presentation message was being received before the heartbeat was being sent which it confirms as it works. I.e it gives a window where the message can be received before the second sensor sends its data.

            I must say though that I do love this application and thanks for putting the effort into creating it.

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

            @doug I see, there are still some changes pending to rhe smartsleep function and a dedicated message type indicating the node is going to sleep (and waiting for a short time for commands). I will adjust MYSController thereafter.

            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