Some time ago I have made a controller based on ESP32 that was changing PWM based on some parameters (voltage and current at the input and at the output). I wanted to observe these values during the work. One of the ways is to send these data via serial port and read them but - as you can imagine - is not the perfect way. Then I found an app for PC called Serial Studio which shows the data either as a chart or as nicely formatted data. It works well except for one thing - on the laptop that I use for outdoor tests - it was simply too resource-hungry (Ok - the problem could be also my laptop which has 2GB RAM and 1.6 GHz Atom processor) :) Data were displayed with a too big latency etc. Even my smartphone has more RAM and faster core(s)...
That's how I came to the conclusion that I could use my mobile instead of a laptop. I have it all the time with me, it can be used as a power source for my ESP32. All I had to do was an app that will display the data :D
I wanted my app to be backward compatible with data format as in Serial Studio (you can read about it here ). In general, the data format is stored in JSON file. That file is used to translate a stream of data coming from the serial port into each field with a title, widget type, minimum and maximum values, etc. I did some simplifaction as not all widgets (like map or gyroscope I needed - at least in that version). The application is made in Flutter and allows some customization - you can display multiple charts, you can set minimum/maximum values even if it's not already configured, you can rename titles etc. So in my case, the JSON file looks like that:
{
"t":"DTD",
"g":[
{
"t":"MPPT Controller Status",
"d":[
{
"t":"Runtime",
"v":"%1",
"u":"ms"
},
{
"t":"Input Voltage",
"v":"%2",
"g":true,
"u":"V",
"w":"bar",
"min":0,
"max":30
},
{
"t":"Output Voltage",
"v":"%3",
"g":true,
"u":"V",
"w":"bar",
"min":0,
"max":30
},
{
"t":"Input Current",
"v":"%4",
"g":true,
"u":"A",
"w":"bar",
"min":0,
"max":100
},
{
"t":"Output Current",
"v":"%5",
"g":true,
"u":"A",
"w":"bar",
"min":0,
"max":100
},
{
"t":"PWM duty cycle",
"v":"%6",
"g":true,
"u":"%",
"w":"bar",
"min":0,
"max":100
},
{
"t":"Frequency",
"v":"%7",
"g":true,
"u":"rpm",
"w":"bar",
"min":0,
"max":1000
},
{
"t":"Input Power",
"v":"%8",
"g":true,
"u":"W",
"w":"bar",
"min":0,
"max":2000
},
{
"t":"Output Power",
"v":"%9",
"g":true,
"u":"W",
"w":"bar",
"min":0,
"max":2000
},
{
"t":"Efficiency",
"v":"%10",
"g":true,
"u":"%",
"w":"bar",
"min":0,
"max":100
}
]
}
]
}
and data sent from ESP32 looks like that:
/*994,58.781939398085356,80.89921878856322,1491,49700,49700,994,1491,3479,4721.5*/
/*996,99.83436270438855,-5.753261979833145,1494,49800,49800,996,1494,3486,4731.0*/
The app is quite simple - you have 3 tabs - JSON, where you pick your JSON file (either locally or like in my case on my Google Drive), Ports - where you will see a list of recognized devices (just press CONNECT), Charts - tab where all
charts/gauges are displayed.
You can make any chart fullscreen - then you have access to each chart's setup where you can configure it.
The app is free - no ads etc. available here on Google Play Store
Looking forward to your comments any suggestions :)
Comments
Please log in or sign up to comment.