Small and simple software for plotting data from serial port
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Well, it's been a while.
But I decided to finally put together a new release. There aren't any big news or changes. To be honest what pushed me to finally create a new release is that I forgot to move the "downloads' section from the bitbucket before they axed the mercurial repositories and as a result got a lot of mails/comments from people around to world. Sorry.
Here are some changes that come in v0.11:
Download links:
Linux AppImage (Ubuntu Trusty based, should work on anything newer):
https://serialplot.ozderya.net/downloads/serialplot-v0.11.0-x86_64.AppImage
Windows 32 bit (should work fine on 64 bit windows):
https://serialplot.ozderya.net/downloads/serialplot-0.11.0-win32.exe
Important: I didn't have time to test either of these images. Please let me know if you have any problems with them.
Building serialplot on windows isn't much different than building on linux. But it isn't as straightforward. Installing dependencies can be difficult. And it is also difficult to build a static EXE that doesn't require DLLs to keep it company. But most importantly it is difficult for me, because I don't use windows other than for gaming purposes. Unfortunately most users of SerialPlot use windows and as a result I can't ignore it.
Luckily there is MXE to my rescue. This is a cross compilation toolchain to build windows binaries (and more) on a linux (unix like) host. Whats more is that they also provide 'static' toolchains. When you build your project with a static toolchain it is easier to deploy and can be smaller in size.
So I prepared a dockerfile to make it even easier to build windows using docker. You can build this docker image on linux. AFAIK there are ways to run docker on windows host but I won't go into any details of that. It is also possible to use MXE in msys2, which is a layer to run unix programs on windows. In fact most of the windows releases until now has been built on windows using msys2 and mxe.
Dockerfile is already included in the serialplot source code called:
Dockerfile_mxe
Assuming you have already installed docker, download the serialplot source code using mercurial and build the docker image:
hg clone https://hg.sr.ht/~hyozd/serialplot/
cd serialplot
sudo docker build -t serialplot_mxe -f Dockerfile_mxe ./
Remember this might easily take a couple hours depending on your internet speed and cpu power. To give you an idea resulting docker image is around 5GB in size.
If all goes well you can get the built binary from inside the docker image with this command:
sudo docker run --rm --entrypoint cat serialplot_mxe /serialplot/build_docker_mxe/serialplot.exe > ../serialplot.exe
These are the steps for building SerialPlot on linux. I will also provide more detailed steps for Ubuntu and similar debian based distributions.
Building SerialPlot on linux is quite easy. Most difficult part (not really difficult) is gathering the dependencies. It is possible that you already have some of them installed such as a C++ compiler.
I've also described how to build with docker which might be the easiest method if you are familiar with it.
Install Dependencies
You should have following dependencies installed, preferably using your package manager:
On ubuntu or similar operating systems you can install these dependencies with the following command.
sudo apt install build-essential qtbase5-dev libqt5serialport5-dev cmake mercurial
Note: instead of 'qtbase5-dev' you can install 'qt5-default' package to make sure it is the default qt version.
Also note: SerialPlot doesn't build with Qt4, you need Qt5.
Also also note: you need internet access during build process. It is not necessary, but if you don't you have to also "QWT" library installed.
Get Source Code
You can download the source code using mercurial with the following command. Mercurial is a version control tool very similar to git.
hg clone https://hg.sr.ht/~hyozd/serialplot
Or if you don't want to deal with the mercurial you can download the latest code from this link.
https://hg.sr.ht/~hyozd/serialplot/archive/tip.tar.gz
Build
When you have everything ready, run following commands in the serialplot directory.
mkdir build cmake .. make run
This should build SerialPlot and start it.
Building AppImage
Note: This only works on ubuntu 14.04 at the moment due to restrictions from appimage creator tool that I use at the moment.
When you build SerialPlot this way it probably only works on your computer. It should work on other computers with the same distribution as yours as long as they have the correct libraries installed. If you want to lend your build to your friends you can create a portable executable called AppImage. This should run on most distributions. And it is how I release the Gnu/Linux version of the SerialPlot.
It is easy to build SerialPlot appimage.
Run below command in your build directory.
cmake .. make appimage
That's it. If everything goes well you should now have SerialPlot appimage in your build directory, and it should run in most distributions (fingers crossed).
Building with Docker
There is a Dockerfile inside the serialplot directory ready to go. It is based on Ubuntu 14.04 (trusty). Building it, produces an appimage that you can use on Ubuntu/Debian based systems. Maybe on other distros too?
If you don't have it installed, you can install docker on Ubuntu with this command:
sudo apt install docker.io
After that, get into the directory of 'serialplot' where the 'Dockerfile' exists and run this command. It might take some time depending on your internet speed.
sudo docker build -t serialplot_trusty .
This will build a docker image that should contain the SerialPlot appimage. After building appimage, you should get it from inside the docker image with this command.
sudo docker run --rm --entrypoint cat serialplot_trusty /serialplot/build_docker/SerialPlot-x86_64.AppImage > ./serialplot.appimage
Make it executable and start serialplot:
chmod +x ./serialplot.appimage ./serialplot.appimage
Notes
Although actual build process is quite simple and straightforward, if you are not experienced you may have issues building SerialPlot successfully. It is usually missing dependencies. It is rarely an incompatible library. In that case please leave a comment : ) I will be happy to help.
Also if you have steps for other distributions and recommendations, please share, I will...
Read more »Bitbucket is removing mercurial support along with all mercurial repositories.
I decided to move the source code to sourcehut.
Here is the mercurial repository: https://hg.sr.ht/~hyozd/serialplot/
Here is the new issue tracker: https://todo.sr.ht/~hyozd/serialplot
I haven't moved download files yet. I will probably have to host them myself. Sourcehut doesn't provide file hosting.
SerialPlot 0.10 is released. This release brings some performance improvements, minor features and bug fixes.
Instead of "number of samples" option in the "Plot" tab, now there are 2 options you can set. "Buffer Size" and "Plot Width". "Buffer Size" is the total number of samples that are kept in memory, while "Plot Width" is the maximum number of samples that are plotted at once, in X axis. To see previous samples you simply use the X axis scrollbar. The main reason for this distinction is the performance. Previously you couldn't set number of samples too high because SerialPlot tried to plot all data at one time. Now you can set "Buffer Size" to 1.000.000 and it will most likely will be fine as long as you keep "Plot Width" small. Another advantage is that, sometimes when you have frequently changing data, zooming way out doesn't mean much, you have too keep a certain zoom level in X axis to be able to see any detail. If you enjoy the old behaviour you can always set buffer size option same number as plot width and it should be fine. Remember though "plot width" option has a smaller limit then "buffer size" for performance reasons. A note; performance improvements are not done. I'm still working on some improvements to increase "buffer size" limitations.
Now you can set RS232 control signals (DTR, RTS) and see input signal () statuses from the "Port" tab. Being able to set DTR signal was a requested feature so that SerialPlot can work with Arduino Leanardo board.
Also we now have an update checker. You can launch it from the "Help" menu. It will check updates once a day when you first launch SerialPlot unless you disable it.
Other improvements and bug fixes:
Check the sidebar for download links. I will try update the win32 version and launchpad PPA later this week.
This patch fixes various issues and adds small improvements:
See downloads links at the sidebar.
Hi everyone, it's release time. First of all I want to thank everyone who contacted me via various channels for their kind comments! And ideas of course... some to be implemented... some day... : )
Changes:
Installation for linux:
PPA for Ubuntu 16.04 (xenial) and based distros: https://launchpad.net/~hyozd/+archive/ubuntu/serialplot
Appimage(*) for other distros: https://bitbucket.org/hyOzd/serialplot/downloads/SerialPlot-x86_64.AppImage
Installation for windows:
64bit setup: https://bitbucket.org/hyOzd/serialplot/downloads/serialplot-0.9.0-win64.exe
32bit setup: https://bitbucket.org/hyOzd/serialplot/downloads/serialplot-0.9.0-win32.exe
(*) Appimage may be broken on some systems. Please let me know if you have any problems.
It's time for another release. As always screenshot first:
As you can see from the screnshot now its possible to plot each channel as a separate row. Activated from menu "View -> Multi Plot".
When you zoom enough symbols are shown to indicate data points.
Another addition is the ability to save application settings to a file. Every time the SerialPlot starts, it loads the settings from the last session automaticaly.
"Number of samples" limit is increased upon request. It was 10 000 samples now it is 1 000 000. My experiments show that, around 100 000 samples, things start to get slow. If you set it to 1M samples you are probably going to have a hard time, obviously this depends on your computer hardware. Because of that SerialPlot will warn you if you try to set it to more than 10 000 samples.
There are also numerous bug fixes.
Download Windows installer: https://bitbucket.org/hyOzd/serialplot/downloads/serialplot-0.8.1-win64.exe
Ubuntu PPA: https://launchpad.net/~hyozd/+archive/ubuntu/serialplot
List of changes:
Read more »
Create an account to leave a comment. Already have an account? Log In.
Thank you for the great software. This is the best among the serial plotter I have used.
By the way, I just realized that the time stamped is in unix epoch time format.
[this comment has been deleted]
I think you are looking for "Inset Timestamp" option?
Great job! I was just looking fot it!
Many thanks.
Absolutely amazing piece of software. You find even better way how to do it than me. Any way how to donate you?
Hello Hassan, I have a few questions that I hope you can assist me in it:
Although I followed all steps in "https://qwt.sourceforge.io/qwtinstall.html" , the qwt libraries is not detected when trying to compile your project (Ubuntu 18.04).
May I know how to increase the line thickness?
Could you post few steps about how to create an installer after modification of your source code to Windows from Linux if possible?
Can You please tell What's the "By Default" 'Frequency' of Serial Plot 0.10.0 ?
i Think it's round 100. Please Confirm
You can change buffer in plot tab and it will be changed. The data is sampled as fast as it arrives. The x-axis shows the sample number not the sampling time
Thanks a lot for this fantastic little tool. i managed to build it for my raspberry pi 3 and i use it to plot the data from my arduino weather station. it works flawless
Another very happy customer. I'm using it on my motor controller projects and it is invaluable. IMO - I think you'd have a lot more interaction / help / contributors if you moved to github or gitlab. e.g. people might be able to help getting this built on other platforms.
I second this ! It would be really great if we can get it over github then we can surely make this application more handy !
Is there any tutorial for the working of serial plot as a guide to import the data from arduino IDE?
Hello,
May I know, how to graph - float data. If possible could you help me with it
Great software! Used it successfully for many projects, including paid ones. Is there a way to donate?
Very nice project. Is there a way to add a label to a point?
Hello,
May I know how do you parse the incoming serial data using custom frame?
It is amazing that even if the stream starts not in sync, it is syncing and plotting data. I would appreciate if I can get the code snippet you created for this. Thanks
https://hg.sr.ht/~hyozd/serialplot/browse/default/src/framedreader.cpp#L196
This is the logic that reads framed data.
`readData` method is called whenever new data is available on the port. Complete frame may not be avilable yet. But we try to read as many bytes as possible. We don't read all available bytes. We read it if we can use it.
There are some important member variables that keep the current state of the reader. First of all we have to wait for a 'sync' byte/sequence. For this there is `gotSync` variable. If it's not true; we try to read the sync sequence. If we are successful we set the `gotSync` true. And this makes the loop to continue on other steps. When a frame is completely read we set `gotSync` to false, to indicate we should start looking for a sync sequence again.
`hasSizeByte` holds the setting for 'first size of payload is size' option. That makes `gotSize` state variable relevant. After reading sync sequence, this variable should be false. So we try to read size of frame. If it is successful we set the `gotSize` true and continue reading rest of the frame.
Well if have sync sequence (gotSync) and if we have size information (gotSize) we can read the payload of the frame. But we only read if all of the frame payload available (this could be improved actually). `readFrameDataAndCheck` is the actual function that reads the payload and runs the checksum (if it is enabled). Completely read data is sent out to other modules of the program with `feedOut(samples);` line.
When all frame is read, we call `reset()` function to set all state variables to initial values such as `gotSync` and `gotSize` to start reading a new frame.
I hope this was helpful.
Hi! Nice program. Can I clear screen from keyboard / mouse?
Hi Hazan,
congrats for extremely useful software with nice features. I tried to build with Qt 5.14.1. using MinGW in W10, but got about 40 warning messages in compilation and although finally the release was able to run it crashed after few minutes. Probably some incompatibility issues. Could you update PPA? Or provide any hint for simplest building? Thank you!
Hi Mr Hasan.
Cheers for a wonderful software, but I am facing some issues. Initially I had installed it on a Windows 7 laptop and it worked like a charm. Then I used it on a Windows 10 laptop, wherein I had to tinker with the compatibility before it ran and again works well on it.
Very recently, I upgraded my Windows 7 machine to Windows 8.1, but the software just refuses to run. I have tried all that I could within my limited understanding of the subject, but am just unable to make it run on Windows 8.1. Everytime I open the software, it runs and then within a few seconds, it closes.
When I install the older version available of the software, which is 0.9.0.0, it runs, but then that has some inherent shortcomings and bugs.
Do you think, you could help me with it?
However, it would be prudent to mention, that I am a medical doctor, who tinkers with these things and other such electronic platforms, only as a hobby. Since that would limit the fact that I could tinker with the source code.
Thanking you in anticipation.
When CSV data (originally produced through SerialPlot) is loaded back as a snapshot, not all of the data is shown, only first 650 points or so are shown and the rest is blank even though the CSV file itself has values beyond this... I can't seem to find any way of making it show all the data. What's the reason for this?
@Vishal Dhayalan this bug should be fixed. Unfortunately fix is not part of the latest released version (which is quite old to be honest). You will have to compile from source to have the fix.
Oh ok, how do I compile from source (on a Windows machine)? I've seen the source on bitbucket, but are there any instructions for compiling from source? Thanks.
I'm afraid I don't have instructions for windows build atm.
The data in the text view is not in the order that I send it in the frame. The channel numbers do not seem to relate to this order either. I find it very difficult to work out which channel my variables appear on. I am probably doing something wrong somewhere but after hours staring at it I can't find the cause.
I can't see why the channels would not be in the order the data is sent., but are they ? If not how can I work out which variable appears on which channel ?
Which data format are you using? If you are using custom frame format, channel order is interleaved. For example In this diagram data type is int16 and number of channels is 2 : https://hasanyavuz.ozderya.net/wordpress/wp-content/uploads/customframe.svg
Thank you for your fast response. Although I am having difficulties, I love your program. It seems simple yet very powerful.
I was using 'Simple Binary', 10 channels of 'float'. I sent from an Arduino Nano using the following code (note on Nano sizeof(double)==4):
void send() {
Serial.write((byte *) &TargetSpeed, sizeof(double));
Serial.write((byte *) &Speed, sizeof(double));
Serial.write((byte *) &TargetTilt, sizeof(double));
Serial.write((byte *) &TiltInput, sizeof(double));
Serial.write((byte *) &TiltError, sizeof(double));
Serial.write((byte *) &TiltOutput, sizeof(double));
Serial.write((byte *) &LMotorSpeed, sizeof(double));
Serial.write((byte *) &RMotorSpeed, sizeof(double));
Serial.write((byte *) &LMotorPower, sizeof(double));
Serial.write((byte *) &RMotorPower, sizeof(double));
}
..., but I gave up on that and tried defining a custom frame.. At the start of 'send' I now send NaN, indicating start-of-frame as 4 bytes (00 00 C0 7F).
My new settings are:
Frame Start: 00 00 C0 7F
# Channels: 10
Number Type: float
Fixed Size: 40
Little Endian
The data seems to be parsed correctly and appears in the correct order in the text view. HOWEVER I now only get a single channel listed on the plot tab and cannot add more.
I tried for some time to get more channels listed and ONCE they actually appeared. Then they disappeared on a subsequent trial.
I decided something might be corrupted in a settings file, so I deleted my .ini file. Strangely the program still seemed to remember settings between runs. Eventually I discovered a file, ~/.config/serialplot/serialplot.conf which contained settings. I deleted this and the program started in a clean state. I added my custom frame specification again, but I still only get 1 channel in the plot tab. All channels are parsed correctly though, and can be seen in the data view.
I am really struggling with this. I think there has to be some bug(s) in serialplot.
PS - I just found out why I once got the right number of channels for the custom frame ; If I save settings to a file (explicitly giving.ini as extension), then when I re-load the settings, I get the right number of channels. This procedure is actually a temporary fix to my problems.
@elpidiovaldez This seems like a bug to me as well. Can you share your configuration files. Both the serialplots own configuration (but first close the application while problem is happening so that settings are saved) and the file you are saving using the File menu. BTW files should be in text format. You can review them to make sure they don't contain anything you don't want to share (they shouldn't but you should check anyway)
A quicker workaround is this; after configuring settings in "Custom Frame" format switch to another format and switch back to custom frame format.
I think I found the problem, already pushed a fix.
@Hasan thank you again for amazingly quick support. I am glad you found the problem.
I am already finding serialplot seriously useful. Thanks for making it available.
I have a few suggestions which might help improve your product. I want to emphasise that I am not requesting these - just trying to give feedback as a user.
1) Apply channel gain and offset when you display the data (the plot AND the text view not, as it appears to be done, when the data is received. This lets user re-scale multiple times to align traces AFTER the data is seen. This is important if it is tedious/costly to capture data again. Maybe add sliders so scale/offset can be adjusted and displayed interactively...
2)Add frame numbers to the text view, but make sure they are not selected when using cut/copy.
3) I find the definable 'commands' very useful. It would also be quite useful to provide a command line input (like a terminal) where text can be entered and sent directly to port. Maybe provide options for how newline, carriage return etc are sent. This would allow direct interaction with a process that expects a terminal to be connected. It is more flexible than a static command if you want to send new parameters. Sadly the process cannot send text to serialplot as it would get mixed with the plot data. Maybe you could define another frame type which contains a text string - however it would require modifying the attached program, so use is more limited.
4) Allow input from pipes and files etc, not just serial ports. This expands the uses considerably (maybe this is already possible, but I could not find how). I came upon 'socat' and used that, but you could probably make the functionality easier to use.
5) Capture seems to stop after a while (buffer full ?). It would help to toggle between this mode and continuous capture (using FIFO buffer ?).
@elpidiovaldez thanks for your suggestions. #5 sounds like a bug. Can you provide more information?
I looked into num 5. I still can't reproduce it reliably, and I suspect the bug may be in my code. One strange thing is that when the plots stop moving left, it is sometimes possible to restart them by pressing the little 'x' (by the pause button), to clear the buffer.
Become a member to follow this project and never miss any updates
Awesome software, I have an identifier at the beginning of my strings and using 6 accel/gyro readouts (example: $9DOF, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), I can't find a way to get the software to work with this identifier ($9DOF) in place, I have to mod my output code to drop that identifier, any ideas how it could work with keeping that in place?