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

    [SOLVED] Error sending the same information several times

    Scheduled Pinned Locked Moved LoPy
    lopydataerror sendingloop
    4 Posts 2 Posters 1.3k Views 2 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.
    • B Offline
      bihut
      last edited by jmarcelino

      Hi guys!.

      I have a problem, that just started (I think) with the new upgrade (1.7.9.b1), because yesterday was working very good and this morning after upgrade the firmware stop working properly..

      Basically, I have the following source code (is a basic source code to send information through lora):

      lora = LoRa(mode=LoRa.LORAWAN)
      
      
      dev_addr = struct.unpack(">l", binascii.unhexlify('XXXXXblabla'.replace(' ','')))[0]
      nwk_swkey = binascii.unhexlify('YYYYYYYblabla'.replace(' ',''))
      app_swkey = binascii.unhexlify('ZZZZZblabla'.replace(' ',''))
      
      lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))
      while not lora.has_joined():
          pass
      soc = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
      soc.setsockopt(socket.SOL_LORA, socket.SO_DR, 5)
      soc.setblocking(False)
      
      def sender():
          soc.send('ping')
          print("send ping")
          time.sleep(3)
      

      Well, if I complete the code running the sender() function:

      sender()
      

      I get always the same result in my IoT platform (LoRa Server): baa527f5. That is, I always sent the 'ping' string and get always the same data (baa527f5), so that is fine.

      But If I put the sender() function in a loop, I get each time different information in my IoT backend: 25d1c825, 2352feeb, c073cbce

      while True:
          sender()
      

      So, how is possible sending the same information ('ping' in this case), I get different information just doing inside a loop?.

      Any thoughts?.

      Thanks in advance and best regards.

      1 Reply Last reply Reply Quote 0
      • B Offline
        bihut
        last edited by

        No one?No ideas?

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

          Update to 1.7.1.b3, there was a problem with LoRa on the earlier build.

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            bihut @jmarcelino
            last edited by

            @jmarcelino Yep, you're right. Know it works perfectly.

            I did not now that a new version was released! =).

            Thank you very much!

            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