#Sending data toAdaFruit IO feed - help

1 messages · Page 1 of 1 (latest)

uncut sierra
#

Hello Guys,

Hope you're all doing well.
I recently got the Circuit Playground express and implemented some basic code ( turning LEDs - using the accelerometer sensor , etc..)
However, i am trying to send some data to the adafruit io platform but whenever i import for example the following library "import adafruit_requests as requests" my code stops working and I my circuit playground will start blinking red...

any idea ?
any guidance or help would be highly appreciated.

open osprey
#

Do you have a serial output?

uncut sierra
#

Hello Hem

#

Yes i have my serial port connected to Node RED server

open osprey
#

Can you copy the serial output when the error occurs?

uncut sierra
#

So as i was saying i already implemented a code to turn on some LEDS and use the accelerometer sensor and everything is working fine.
But what i am trying to do now is to send some data to the adafruit IO feed. To do so i read that i need to import some additional libraries such as "import adafruit_requests as requests"

#

but whenever i import this library and save my code, my circuit playground stops functioning as it should and all the pixels start blinking red

#

I am not sure why this is happening... but if i remove the added line "import adafruit_requests as requests", everything will go back to normal

open osprey
#

Right, but does the serial monitor give you an error when you try to run the code?

uncut sierra
#

oh i just double checked

#

i am getting the following error:

open osprey
#

I believe that means your board doesn't have enough memory to handle that last import.

uncut sierra
#

Oh this makes sense, because the memory is almost full

#

I'll try to clear some space out and provide feedback

open osprey
#

A lot of SAMD21 boards are having issues with not enough memory on CircuitPython IIRC

#

Make sure you're using mpy files in your lib and not importing more than you need to run your code.

uncut sierra
#

yeah the thing is that i am still not sure what libraries I need , but I think I'll just remove most of them and add only the one needed each time

open osprey
#

Wait, memory, not FLASH. You're out of RAM, not disk space.

#

mpy shouldn't matter, it's just a matter of optimizing your imports

uncut sierra
#

OH !

#

thank you so much for clarifying this out

#

these are the libraries i am using

#

i am trying to figure out how to optimize them

open osprey
#

Usually it's a matter of figuring how much of each library you're using, and if you're only using one or two functions, you use from X import Y, Z

uncut sierra
#

okay i see what you mean

#

is there any good documentation that explains about each library in details ?

open osprey
#

If there isn't anything you can do to reduce your imports, you may need to upgrade to a board with more memory.

uncut sierra
#

oh yep that's where i found the link to this discord server

#

Okay.. now i know what the issue is, i just need to spend some time looking at the documentations

open osprey
#

If you have any other questions, feel free to ask!

uncut sierra
#

Thank you so much, you were very helpful !