Asynchronous JSON Request

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
django
Posts: 1
Joined: Wed Jan 19, 2022 10:49 pm

Asynchronous JSON Request

Post by django » Wed Jan 19, 2022 11:01 pm

Hi there,

Im working on a project where i'm fetching some numbers from a public endpoint (e.g. https://www.bitstamp.net/api/v2/ticker/ETHUSD).
This numbers will be evaluated and splitted so that i can display them on a Neopixel Device. This part of the project is running quite ok, just some unregular timeouts from the endpoint.

But now comes the part where i don't have a real solution so far and hope you can help me out. I'd like to have tiny configuration webpage where i can change the displayed value from e.g. Bitcoin to Etherum (see above the endpoint). I've managed it to make the website via sockets etc. - but i'm stuck in doing all of these things in paralell and non blocking. The urequests module seems not to work with asyncio and vice versa if i'm not using asyncio the website is not loading correctly and the requests get stuck.

From my point of view only thing i'm missing is something like an implementation of arequests for Micropython. Do you have any ideas? All approaches are welcome - i'm not stuck to any approach :)

Thanks a lot!

Django

Post Reply