web page with cauges and info

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ikkeT
Posts: 17
Joined: Sat Mar 06, 2021 7:01 pm

web page with cauges and info

Post by ikkeT » Sat Apr 03, 2021 9:14 pm

Hi,

I have been building simple moped computer with my son using micropython on NodeMCU. One of the old boards I had in my box, with esp8266. I had small display on it. But now we'd like to get rid of the display, and use mobile instead.

Any recommendations how to create a web page that would pull stats from esp8266 for small set of values, like speed, RPM, and temp, gas/oil levels? So how to create web page with cauges, and keep updating them over wlan?

I have the stats running with display, so that's not concern. Probably I'd need to change it use uasyncio somehow, having two loops: One taking stats and checking for button push, and another one handling some socket query for stats. Or better yet just keep pushing stats.

I get the AP working ok, but then everything is hazy...

Perhaps like this:

1. If button pressed X times, enable wlan AP and wait Y seconds for socket bind.
2. Once bound, send some json with stats.
3. Somehow keep sending, unless disconnect

I have no glue yet how to do that, nor how to make such web page. And if such web page should be sent from 8266 flash, or somehow load it from net in mobile before connecting to AP.

Any ideas and help appreciated 😁

Post Reply