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

    errno 12 ENOMEM ?

    Scheduled Pinned Locked Moved LoPy
    bluetoothenomembeaconslopyerrno 12
    21 Posts 7 Posters 8.0k Views 7 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.
    • A Offline
      alvaroav @alvaroav
      last edited by

      @alvaroav

      Dear all,

      Some advances by the end of the week.
      I have tried from a clean code, just building a new program. I come back to the option to open the socket, send all data in a loop, and at the end of the loop, close the socket.
      I am not so sure why, BUT now the ENOMEM error just appears from time to time. Moreover, I don't need any server (blocking or non-blocking) running.
      Moreover, I place this exception into the loop, and allow me to "reconnect" and continue the program even if an error appers.

      flag = 1
      Nerrors = 0;
      socketUDP = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      
      while (flag<200):
          time.sleep(0.05)
          data=bytes()
          data = data + b'counter = ' + bytes(str(flag),'utf-8')
          try:
              sent = socketUDP.sendto(data, addr)
              print(data)
              led.toggle()
              flag=flag+1
          except OSError:
              Nerrors+=1
              print('error ', Nerrors)
              continue
      socketUDP.close()
      

      I am thinking that the problem might come from the wifi connection to the router... I will check this next week.

      BR

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

      Pycom on Twitter

      Pycom