How does the mjpeg_streamer example generate this HTML page? Can it be overridden with my own or customized?
The code for the mjpeg streamer is sent I the packet it sends. I suspect the webpage layout code is generated by the browser. Myabe Ibrahim knows.
I don’t think so, we can just control the headers.
I’m trying to send my own HTML page, however, I get an exception when I try to use readline or write on the socket. It seems like I can only use the socket.send or socket.recv methods. Although your documentation list the write and read methods.
The exception occurs if I try this:
socket, sockaddr = server.accept()
(method, url, version) = socket.readline().split(b" ")
I get either:
‘socket’ object has no attribute ‘readline’
‘socket’ object has no attribute ‘write’
I think the docs are wrong. Those functions are not implemented in MicroPython STM socket module: