esp32: UDP broadcast via sendto causes memory leaks/ENOMEM error
I described this in the uP forum:
https://forum.micropython.org/viewtopic.php?f=18&t=5063&p=28953#p28953
on further investigation, I found that commenting out
https://github.com/micropython/micropython/blob/master/ports/esp32/modsocket.c#L485
made the problem disappear - by disabling the actual functionality of course. To my uninitiated eye, this looks like a SDK issue, but at the same time there seems to be some dependency to the gc calls as documented in the forum post. Any suggestions on to get to the bottom of this?
Getting ENOMEM error after several calls to urequests.post()
I'm running a nodeMCU setup where every 30 seconds I'm calling urequests.post() to post a bit of data to influxdb running on a raspberry pi. It works great for 5-10 minutes and then it starts getting ENOMEM errors and resets eventually. I tried doing a gc.collect() along with my calls to post but didn't seem to help. Is there any other suggestions anyone can think of? Any debugging I should gather? gc.free_mem etc?
Please see if http://docs.micropython.org/en/latest/esp8266/esp8266/general.html#scarcity-of-runtime-resources rings a bell. If it doesn't, please explain way, and we'll try to improve it.
Sorry for jumping the gun on this. Got a reply on the forum that I probably made the common mistake and sure enough... I forgot to call res.close(). <embarrassed look>
problem is with urequests library, if you can switchback to usockets and close the socket before timeout then works fine.
Was also struggling with this one, but its actually outlined in the docs