Plotting data on a webpage

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
exosequitur
Posts: 3
Joined: Sat Jul 02, 2022 5:38 pm

Plotting data on a webpage

Post by exosequitur » Sat Jul 02, 2022 5:55 pm

I would like to record sensor data elements to an array over time and plot the data on a web page served up by my mycropython board.

Previously I have done this in C++ / arduino with an ESP8266. I created an SVG from the data and served it up on the chip.

I would like to do something similar in mycropython - I'm new to python and have no real clue where to start except replicating my clunky, brittle C code in python - but I'm guessing that is not really the best option.

Anyone know any plotting graphing libraries that make SVGs, any "dashboard" kind of libraries, etc for web based GUI interfaces to IOT devices?

Thanks in advance for any help! Id hate to have to build another string builder for SVG's.

User avatar
curt
Posts: 25
Joined: Thu Jul 29, 2021 3:52 am
Location: Big Lake, Alaska

Re: Plotting data on a webpage

Post by curt » Sat Jul 02, 2022 6:59 pm

A better approach would probably be to let your browser do the plotting with an application like 'flot'. Flot used to require JQuery but it can be run stand alone. The micropython server would only have to return the data array (json).

Curt

exosequitur
Posts: 3
Joined: Sat Jul 02, 2022 5:38 pm

Re: Plotting data on a webpage

Post by exosequitur » Sun Jul 03, 2022 12:03 am

You obviously haven't seen my 1990-style web dev skills lol. (I'm pretty deeply burrowed into embedded stuff, but I'm willing to learn of course)

I can see some advantages to tha using flot - but can I serve that up only from the chip? It seems like it?

The system (and client) will not have internet connectivity or access to any other web server besides the chip itself.

exosequitur
Posts: 3
Joined: Sat Jul 02, 2022 5:38 pm

Re: Plotting data on a webpage

Post by exosequitur » Sun Jul 03, 2022 12:15 am

Also, Kurt, I see you are in big lake!

My family has a homestead out at the end of south BigLake road. Out towards Papoose twins. Small world. Im down in the Dominican republic on my coffee plantation. Im trying to upgrade my homebrew IOT agriculture/microgrid monitoring network to use upython to make my stuff more maintainable by future generations.

Thanks for the pointer, maybe flot will work? As long as its all self contained and not dependent on internet access or external servers it should I think.

It cant be any worse than hand building SVG files in C lol. Gotta love the printf%. I will probably have to learn what <div> means though lol. My web development is still grey background with blue text and buttons lmfao.

Thanks for any pointers.

Post Reply