RemoteLab can now plot data in real-time

It has been a while since I wrote about RemoteLab. A new semester is approaching at the Wrocław University of Science and Technology and I thought that a long awaited feature should be released. I hope this will improve the user experience while working with RemoteLab. This is a second major update since moving to Django, unifying the status server with the camera server, and of course open sourcing it. Besides real-time plotting, there are some additional updates as well.

Above video presents RemoteLab demonstrating its main features.

Real-time plotting

The most incredible feature in my opinion is real-time plotting based on data provided via serial console. First of all, the serial console was released to generic users, so no logging is required to use it. I needed to test it first before including it in the common user feature list.

The serial console is now capable of plotting data in real time based on incoming data via serial port. My goal was to minimise user interaction with the plotting mechanisms. The idea was simple. The user should simply enable plotting, and that is it. No configuration or initialisation of the plot should be necessary. To do that there are some minor requirements. The data frame sent via serial port should be in a CSV-like format.

value1;value2;value3…[\r]\n

Each value should be of a numeric type (decimal or floating) separated with a semicolon. Each data frame should end with a new line. Moreover, during the ongoing plotting, the data frame should not change, thus no values should be added or removed. Thanks to this, it is possible to automatically discover how many values are available and create curves on plot accordingly.

To further distinct curves from each other I have decided to randomly choose the line colour. Each line will have its own colour.

There is a possibility to clear the plot. This will preserve the current colour selection, or the plot can be purged. The data purge button will trigger the reinitialization of the plot and the discovery of the quantity in data frame.

Also, to provide some basic statistic under the plot, a table containing statistical values is provided as well. This simplifies the analysis of the plotted data.

Camera Settings

You might have received notification that some time ago I worked on different ways of streaming video using Raspberry Pi. Partially, RemoteLab was the reason why I have worked on it. Now, RemoteLab can also benefit from it. The new configuration interface is only the front-end. But the back-end was rebuild and improved. Current implementation allows to work with legacy python library picamera and its newer version picamera2. Moreover, the solution was tested with the Raspberry Pi Camera 2 module and the Raspberry Pi Camera 3 module. Sine these two modules are not entirely compatible; in fact third version of the camera module allows for automatic focus adjustment via API. The second version of the camera module only allowing manual (mechanical) adjustment.

The new version of the camera interface allows one to stream data in four formats: JPEG image streaming, MJPEG, raw h264 and MP4. For time being, only JPEG image streaming is used as the default way to stream data from the camera.

One additional feature that might be utilised in feature as well is automatic JPEG image compression. It is possible to choose an arbitrary level of compression via the interface. The downside of it is the additional computation time required to convert the image.

Dark or Light

One minor update concerns switching between dark and light themes. I prefer dark themes, however there might be people who would like to use light theme. The contrast might seem better, or the plotting experience might be better depending on personal preferences.

Final remark

I would only like to remind that RemoteLab is an open-source project. The entire code is available to the public on github. Feel free to look inside, fork, or star.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.