Getting ENOMEM error after several calls to urequests.post()

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
eradicatore
Posts: 52
Joined: Thu Apr 20, 2017 9:19 pm

Getting ENOMEM error after several calls to urequests.post()

Post by eradicatore » Fri May 05, 2017 3:32 am

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

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Getting ENOMEM error after several calls to urequests.post()

Post by pythoncoder » Fri May 05, 2017 6:39 am

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.

eradicatore
Posts: 52
Joined: Thu Apr 20, 2017 9:19 pm

Re: Getting ENOMEM error after several calls to urequests.post()

Post by eradicatore » Fri May 05, 2017 4:04 pm

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.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Getting ENOMEM error after several calls to urequests.post()

Post by deshipu » Fri May 05, 2017 8:38 pm

They are in the same repo as the rest of the micropython code.

Post Reply