Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

MicroPython • Re: Web page re-direct from Pico?

$
0
0
OK, it may be a bit of brute force and not elegant, but it works.

I found an HTML command to redirect the page periodically to another page. I added this line to my HTML string:

Code:

<meta http-equiv="refresh" content="1; URL=http://mywebpage/" />
In my Pico code I did a search and replace of the html string with

Code:

html1 = webpage()html1=html1.replace("mywebpage",status[0])
after it connects to the website and I know the URL. stutus[0] is the ip address.
Now the page updates once a second and goes back to the original URL and refreshes the page once a second.
I send html1 back:

At least it works.

Statistics: Posted by badflash — Sat Mar 16, 2024 6:56 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles