Server sent events os Micropython.

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
Osipov Andrey
Posts: 9
Joined: Mon Apr 06, 2020 12:16 pm
Location: Saint-Petersburg, Russia

Server sent events os Micropython.

Post by Osipov Andrey » Mon Apr 13, 2020 4:06 pm

Hello everyone!

I use PICOWEB https://github.com/pfalcon/picoweb/blob ... webapp2.py
for start HTTP-server on my micropython-device.

And next i need to made SSE-server on this device.

How could i do that?

I try to translate https://github.com/boppreh/server-sent-events for micropython, but this Python library needs Queue.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Server sent events os Micropython.

Post by jimmo » Tue Apr 14, 2020 5:12 am

I think that library is fairly tied to flask, but should be fairly easy to move over to any of the HTTP server libraries. I'm not aware of an existing MicroPython queue.Queue implementation, however you might be able to either write the most basic possible thing that does what that library needs yourself, otherwise the CPython implenentation of that class is at https://github.com/python/cpython/blob/ ... b/queue.py

User avatar
Osipov Andrey
Posts: 9
Joined: Mon Apr 06, 2020 12:16 pm
Location: Saint-Petersburg, Russia

Re: Server sent events os Micropython.

Post by Osipov Andrey » Thu Apr 16, 2020 2:02 pm

If someone needs this: https://github.com/osipov-andrey/variou ... icropython

I made this app for OD LAN-RFID device (https://open-dev.org/).

I use picowed and translate https://github.com/boppreh/server-sent-events to micropython with async-logic.

class Queue are hardcoded in program because device does't have async.queues and upip.

Post Reply