Local web server display

Hi,
I am new to OpenMV and python in general. I would like to be able to display text and maybe graphs on my local web server.
When I try, nothing happens. All I always get is the photo from my OpenMV Cam H7 Plus on a black background.
For example here I have added the block “message”.

MJPEG Streaming

This example shows off how to do MJPEG streaming to a FIREFOX webrowser

Chrome, Firefox and MJpegViewer App on Android have been tested.

Connect to the IP address/port printed out from ifconfig to view the stream.

import sensor, image, time, network, usocket, sys, pyb
from pyb import Pin

SSID =’ … ’ # Network SSID
KEY =’ … ’ # Network key
HOST =’ … ’ # Use first available interface
PORT = 80 # Arbitrary non-privileged port

Reset sensor

sensor.reset()
sensor.set_framesize(sensor.QVGA)
sensor.set_pixformat(sensor.RGB565)

Init wlan module and connect to network

print(“Trying to connect… (may take a while)…”)
wlan = network.WINC()
wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)

We should have a valid IP now via DHCP

print(wlan.ifconfig())

Create server socket

s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)

Bind and listen

s.bind([HOST, PORT])
s.listen(5)

Set server socket to blocking

s.setblocking(True)

def start_streaming(s):
print (‘Waiting for connections…’)
client, addr = s.accept()

# set client socket timeout to 2s

client.settimeout(2.0)
print ('Connected to ' + addr[0] + ':' + str(addr[1]))

# Read request from client

data = client.recv(1024)

# Should parse client request here

# Send multipart header

client.send("HTTP/1.1 200 OK\r\n" \
            "Server: OpenMV\r\n" \
            "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
            "Cache-Control: no-cache\r\n" \
            "Pragma: no-cache\r\n\r\n")

# Start streaming images

pyb.LED(1).on()
sensor.skip_frames(time = 2000) # Give the user time to get ready.(delay)
LED2 = Pin('P4', Pin.OUT_PP)
LED2.high()
LED4 = Pin('P5', Pin.OUT_PP)
LED4.high()
sensor.skip_frames(time = 100) # Flash.(delay)
photo = sensor.snapshot()
sensor.skip_frames(time = 100) # Flash.(delay)
pyb.LED(1).off()
LED2.low()
LED4.low()

message = """<html>
<BODY BGCOLOR="WHITE">
<head></head>
<body><p>Hello World!</p></body>
</html>"""

while (True):
    cphoto = photo.compressed(quality=35)
    header = "\r\n--openmv\r\n" \
             "Content-Type: image/png\r\n"\
             "Content-Length:"+str(cphoto.size())+"\r\n\r\n"
    client.send(header)
    client.send(cphoto)
    client.send(message)

while (True):
start_streaming(s)

Thanking you in advance. (sorry it looks a mess don’t know how to change that.)