Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    How to determine max LoRa transmit size?

    Scheduled Pinned Locked Moved LoPy
    2 Posts 2 Posters 189 Views 3 Watching
    Loading More Posts
    • 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.
    • P Offline
      philberingar
      last edited by

      We are using Lorawan with ADR (adaptive data rate = True).

      How we we determine the current data rate or spreading factor set by ADR so we can then look up the maximum size payload we can send (we know the conversion from data rate or SF to max payload once we have one of the former values).

      Have tried:

      1. Reading lora.sf() - always returns SF7 - docs note that only works in raw LoRa mode, so did not expect to work.
      2. Transmit packet about 70 bytes, catch EMSGSIZE exception and try to transmit again with smaller packet. Returns EAGAIN exception on trying to transmit packet smaller than 50 bytes.

      Any other ideas welcomed !
      Phil

      J 1 Reply Last reply Reply Quote 1
      • J Offline
        jcaron @philberingar
        last edited by

        @philberingar You may want to check lora.stats(), specifically sftx.

        The issue will be that this tells you the data rate of the last frame sent, not the next one, but IIRC ADR will only move the DR up or down by 1 at a time, so it might be a good starting point.

        1 Reply Last reply Reply Quote 1

        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
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom