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

    Buffer size **SOLVED**

    Scheduled Pinned Locked Moved LoPy
    lopylorasolved
    4 Posts 3 Posters 2.2k 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.
    • T Offline
      timeb
      last edited by livius

      Hello,

      I was using struct to unpack a message with destination, source address, length of Ack and Ack as the following *** _LORA_ACK_FORMAT = "!4s4sBB"
      *** recv_pkg = lora_sock.recv(512)
      *** dest_addr,src_addr,pkg_len msg = struct.unpack(_LORA_PKG_FORMAT % recv_pkg_len, recv_pkg) . I get ValueError: buffer too small. What might be causing this? Any suggestion?

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @timeb
        last edited by livius

        solved by chat

        reason was in

        recv_pkg_len = recv_pkg[1]
        

        but package was modified by different device_ID length
        and for modified device length - data length was in different place

        recv_pkg_len = recv_pkg[8]
        

        and in

        struct.unpack(_LORA_PKG_FORMAT % recv_pkg_len, recv_pkg)
        

        instead recv_pkg_len=4 recv_pkg_len got value 164
        caused ValueError: buffer too small

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • J Offline
          JeromeMaquoi
          last edited by

          Hello livius,

          I have the same problem but I don't understand what you said about it. How can I fix this problem?

          Have a nice evening,

          Jérôme Maquoi

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @JeromeMaquoi
            last edited by

            @jeromemaquoi
            really better if you show some sample what do.
            As you can read here detail was provided by chat
            but better is write on the forum and ask question with sample and exact error message.

            think about people first, then computers

            1 Reply Last reply Reply Quote 0

            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