UPDATE:
Moving the wifi connection and adding the try/finally to main.py worked. The code ran as expected. @hippy alluded to the next problem; it kept running out of memory. So, I added the micropython gc package and reduce the delay between requests down to 15 seconds and printed gc.alloc() and gc.free(). After about 15 request it ran out of memory. Adding the gc.collect() after every request kept the allocated and free memory pretty consistent. Fingers crossed this does it!
Thanks to everyone that offered suggestions! It is always good to know that there is someone out there willing to offer some help.
Moving the wifi connection and adding the try/finally to main.py worked. The code ran as expected. @hippy alluded to the next problem; it kept running out of memory. So, I added the micropython gc package and reduce the delay between requests down to 15 seconds and printed gc.alloc() and gc.free(). After about 15 request it ran out of memory. Adding the gc.collect() after every request kept the allocated and free memory pretty consistent. Fingers crossed this does it!
Thanks to everyone that offered suggestions! It is always good to know that there is someone out there willing to offer some help.
Statistics: Posted by TomCamp — Thu Feb 01, 2024 2:08 am