GUI for serial data representation/control

Post here first, or if you can't find a relevant section!
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

GUI for serial data representation/control

Post by mebab »

My STM32 based system creates serially printed outputs (sensor data and photo data) visible by USB connection to the computer. What can be the best program language or other tools suitable to build a GUI to have control over the input data of the program and also represent the results graphically?

Many thanks for your help
by mrburnette » Fri Nov 19, 2021 2:34 am
mebab wrote: Thu Nov 18, 2021 10:07 pm I would like to use a computer to see the graphical results and control how the system works. By this, do you think Adafruit's relevant products are what I need?
Look into NodeRED. It is "free" and supports Win, Linux (Raspberry Pi, Orange), and IOS.

https://nodered.org/docs/faq/interacting-with-arduino

Then there is Processing ...
https://processing.org/
Go to full post
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GUI for serial data representation/control

Post by ag123 »

Adafruit shares quite a few graphics libraries e.g.
https://github.com/adafruit/Adafruit_ILI9341
i tried 'porting' one of them, this is 'imperfect' though and works only on specific stm32 mcus (partly a s i used bid banding, certain mcus don't have it)
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino
note that it is feasible to use the Adafruit's library directly
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: GUI for serial data representation/control

Post by mebab »

The proposed touch shield of Adafruit is nice. However, my data size might not be shown in that tiny display. I would like to use a computer to see the graphical results and control how the system works. By this, do you think Adafruit's relevant products are what I need?
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: GUI for serial data representation/control

Post by mrburnette »

mebab wrote: Thu Nov 18, 2021 10:07 pm I would like to use a computer to see the graphical results and control how the system works. By this, do you think Adafruit's relevant products are what I need?
Look into NodeRED. It is "free" and supports Win, Linux (Raspberry Pi, Orange), and IOS.

https://nodered.org/docs/faq/interacting-with-arduino

Then there is Processing ...
https://processing.org/
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: GUI for serial data representation/control

Post by mebab »

Look into NodeRED...
Thanks, mrburnette!
I would give Node-red a try.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: GUI for serial data representation/control

Post by mrburnette »

mebab wrote: Fri Nov 19, 2021 9:36 am ...
I would give Node-red a try.
A simple overview of my prior usage:
viewtopic.php?t=959

One of the great benefits, everything graphical is automatically accessible on the LAN by a modern browser; the webserver is just a free byproduct of using the tool.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GUI for serial data representation/control

Post by ag123 »

mebab wrote: Thu Nov 18, 2021 10:07 pm The proposed touch shield of Adafruit is nice. However, my data size might not be shown in that tiny display. I would like to use a computer to see the graphical results and control how the system works. By this, do you think Adafruit's relevant products are what I need?
if cabled usb is adequate for the purpose, then you have many options, as you can send the results back to the host using a simple Serial.println(value);
then there are many more options to explore from there, e.g. a raspberry Pi3 model B can be used to host 4 stm32 connected across usb, that Rpi itself can connect a display, or otherwise, you could have multiple raspberry Pi3 model B each connecting say 4 stm32s and they can host that over wifi to a central control say using mqtt etc. by doing that you could literally extend that to lots of sensors.

Rpi can also host a web site over wifi, with that you'd be able to monitor that on the web. I'd think it is a common use case scenario these days.
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: GUI for serial data representation/control

Post by mebab »

You are right ag123.
In fact, my device is a central node, developed on an STM32-based platform equipped with an ESP8266. There are some online tools like Blynk, Adafruit, etc to make some kind of data visible through the web. However, in the free versions of tools, you are limited to using just a few feeds and small bandwidth. In my case, I have to use VPN to connect to some of the mentioned tools with even less bandwidth and more latencies.

I already used Labview and could make the panel. However, I gave it up because of the complexity. I also built a simple version of the graphical webpage by using Phyton that could work online with connections from the same local IP addresses.

Creating a local panel on the Node-red might be a good practice toward a professional remote online version.
mebab
Posts: 115
Joined: Mon Aug 24, 2020 12:42 pm
Answers: 4

Re: GUI for serial data representation/control

Post by mebab »

A simple overview of my prior usage....
Thanks again mrburnette for the great link to your post!
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GUI for serial data representation/control

Post by ag123 »

esp8266 is a little cool wifi comms but that there are some limits using it with mcus.
1) bandwidth is limited, "slow", in part by serial etc
2) some stm32 mcus has limited sram e.g. stm32f103c8 20k sram for everything, and that can be a serious challenge e.g. if you want to put a whole web server on it. I ran out of memory parsing just the *http headers* trying to make a web server.

So i'd guess an 'optimium' way to access more memory at a low cost is use a board like RPi with Wifi, with that you have megabytes to gigabytes of memory and connect stm32 over usb-serial. It is nearly a perfect match.

depending on your use case, hacking up something with python and javascript or even for that matter using java (e.g. tomcat) may fulfil 'simple' use cases of a web based control panel hosted from a single R-Pi. They can be pretty elaborate, though.
there are some pretty interesting stuff I stumbled into in a few google searches
https://github.com/w3c/web-of-things-framework
https://awesomeopensource.com/projects/ ... javascript
https://github.com/thingsboard/thingsboard
(that 'iot rule engine', seemed to be basically an implementation (copy?) of the node-red concept)

just this python, javascript, Rpi - usb-serial - mcu, concept literally run a good 'market share' of 3d printers in the world, with all the fancy print simulations and web based control (throwing in web cams etc)
https://octoprint.org/

this 'web of things' concept is apparently being aggressively developed
https://www.w3.org/WoT/documentation/
probably another overzealous / ambitious effort to define an interface / protocol for *all things*
the notion is probably that if you program a stm32 to speak the 'thing description' protocol.
so maybe you could have a 'gui' (say written in javascript for web) that 'binds' to it and you'd save that custom programming.
so the protocol is just like click oscilloscope, link it to adc pa0 on stm32, and there you have it an oscilloscope across the web from stm32 pa0
Post Reply

Return to “General discussion”