urequests and Raspberry Pi Pico W
Posted: Wed Jul 20, 2022 7:40 pm
Hello,
I would like to build a Telegram chatbot on the Raspberry Pi Pico W. This should only be able to send sensor values and not process incoming messages. I know that this Pi is not quite suitable for this, but maybe someone can help me with this problem.
To send a message I wrote this:
This works fine, but every time after 4 sent messages this error comes up:
I found out that this error means that the RAM is full. I tried to clear the RAM after each message sent with this piece of code:
This worked with a request from another URL where the same error came up after a few requests. After I implemented the clearram() this error did not come with the other URL any more. But with the Telegram URL this error still comes unchanged after 4 sent messages.
I am grateful for any help!
I would like to build a Telegram chatbot on the Raspberry Pi Pico W. This should only be able to send sensor values and not process incoming messages. I know that this Pi is not quite suitable for this, but maybe someone can help me with this problem.
To send a message I wrote this:
Code: Select all
requests.post("MyURLForTelegram")
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 25, in <module>
File "urequests.py", line 120, in post
File "urequests.py", line 62, in request
OSError: [Errno 12] ENOMEM
Code: Select all
def clearram():
gc.collect()
gc.mem_free()
I am grateful for any help!