Hi all,
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?
Justin
Getting ENOMEM error after several calls to urequests.post()
-
- Posts: 52
- Joined: Thu Apr 20, 2017 9:19 pm
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Getting ENOMEM error after several calls to urequests.post()
Are you closing sockets after use? A common error is to continually instantiate new sockets until RAM runs out. See viewtopic.php?f=16&t=3260.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 52
- Joined: Thu Apr 20, 2017 9:19 pm
Re: Getting ENOMEM error after several calls to urequests.post()
Nailed it. <embarrassed look> Thanks for helping me with the typical mistake. I'll try to take this to heart now and read my interfaces a bit more.
I was actually thinking they should update the i2c section of the help docs to mention the pull up resistors that are commonly needed and are NOT supplied by the nodeMCU. Any idea how to suggest updates to the help docs? I didn't see a link at the bottom.
I was actually thinking they should update the i2c section of the help docs to mention the pull up resistors that are commonly needed and are NOT supplied by the nodeMCU. Any idea how to suggest updates to the help docs? I didn't see a link at the bottom.
Re: Getting ENOMEM error after several calls to urequests.post()
They are in the same repo as the rest of the micropython code.