send() times out occasionally

Home Forums mDot/xDot send() times out occasionally

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11778
    Dejan Deletic
    Participant

    Helo mDot gurus,

    I was hoping someone can shed some light on some of the problems I’m having.

    When sending data from mDot to MultiConnect over the radio link, in ideal conditions – both units sitting next to each other in the lab, my mDot occasionally times out on send() for no apparent reason. What is causing this and what can be done to minimise/eliminate these timeouts?

    Also, it often takes more than 4 seconds before send() returns control to my application, during which everything else is blocked, including interrupts! Is there a way of sending data in a non-blocking mode?

    Thanks,
    Dejan

    #11779
    Jason Reiss
    Keymaster

    The network server will wait until the last moment before a packet needs to be sent in case the application has data to send with the current downlink. We have found that occasionally the network server cannot service the packet to be sent the radio before the timestamp expires.
    Increasing the priority of the network server and packet forwarder reduce the occurrence of a late packet. Our next release will contain this fix.

    renice -n -20 $(pgrep lora-network-se)
    renice -n -20 $(pgrep basic_pkt_fwd)

    mDot.h – you case pass false as the second parameter to do non-blocking send.

    /** Send data to the gateway
             * validates data size (based on spreading factor)
             * @param data a vector of up to 242 bytes (may be less based on spreading factor)
             * @returns MDOT_OK if packet was sent successfully (ACKs disabled), or if an ACK was received (ACKs enabled)
             */
            int32_t send(const std::vector<uint8_t>& data, const bool& blocking = true, const bool& highBw = false);
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.