Implementing Network API's in Micropython

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
WolleKette
Posts: 1
Joined: Tue Apr 12, 2022 8:24 am

Implementing Network API's in Micropython

Post by WolleKette » Tue Apr 12, 2022 10:20 am

Hello,

I’ve a general question about implementing network api's in Micropython and I hope very much, that someone can give me a tip.

I have a relatively complex application in Micropython, currently running on a LolinD32Pro board. This application provides an interface to send commands to the controller and send / receive data via WLAN from a PC. All inside a local LAN.

I tried some different variants, but I am relatively inexperienced in MicroPython or microcontroller programming. Currently I use MicroWebSrv2 with the websocket interface. This works reasonably well. Before I used the http interface with get and post. But I am not really satisfied with anything.

First, I often have a timeout problem when more than a few hundred bytes of data are to be sent. And second, MicroWebSrv2 is probably a bit overkill for this in general. But I also use it to provide one or two smaller status pages via html.

My question now is:
Can someone give me a hint how to implement such an interface most cleverly?
Are websockets even the right method for something like this?

On a PC I would use a serial interface. But in MicroPython via WLAN I haven't found anything yet.

Post Reply