Stripping the Yocto-Visualization V2 application of all third party libraries has an interesting side effect: one may try to compile it with Mono and make it run on operating systems other than Windows. So we tried to make a Linux version... and it works!
We won't lie, this took significantly more than a few clicks. We had to adapt some parts and accept a few compromises. Apparently, the Mono version of winform, the system library meant to handle windows and their contents, is not as stable as the original version. We managed to work around all the bugs we found, but don't be surprised if you encounter some strange glitches. That that being said, we believe that the result is still very usable.
Yocto-Visualization on Linux, unbelievable ! Thanks Mono.
Installation
If you want to run YoctoVisualization V2 on your Linux System, you'll first need to install Mono. This can be done with the following command:
sudo apt-get install mono-complete
Then you'll have download the Yocto-Visualization universal platform Deb package from the tools page and install it according to the instructions available here.
If, when running, no Yoctopuce device is listed in the application, don't forget to check your udev rules.
The Raspberry PI case
So... since it's now working on Linux, you'll probably want to run it on your Raspberry PI, won't you? Well, there a little winkle here: our own graph rendering library has been coded with focus on speed while deliberately ignoring memory consumption, which is perfectly fine on a desktop computer but can be a problem on baby-computers. Unfortunately, the Raspberry PI doesn't have that much memory. Should you launch Yocto-Visualization on a memory impaired machine, it will freeze within a few hours. That's why we added two little settings in the global configuration window, theses force the application to limit the maximum of data points it can memorize. On a Raspberry PI, we suggest a 20000 points limit.
Yes, it works on Raspberry PI as well... with some limitations
Compilation
If needed, source code is available on GitHub. Windows and Linux share the very same code. To compile Yocto-Visualization V2 on your system, you will need Mono and MonoDevelop (min. Version 5). Caution! Don't use the version based on flatpak: it runs in a sandbox that prevents it from accessing the libusb system library. Use the version that can be installed with apt-get:
sudo apt-get install monodevelop
You can open the YoctoVisualization.csproj file with MonoDevelop, or directly create an executable for your architecture with the BuildLinuxBinary script.
Handling YAPI library version
The choice for the right YAPI library file is done through dllmap rules defined in the dllmap.config config file:
<dllmap dll="yapi.dll" os="linux" cpu="x86" target="libyapi-i386.so"/> <dllmap dll="amd64\yapi.dll" os="linux" target="libyapi-amd64.so"/> <dllmap dll="yapi.dll" os="linux" cpu="arm" target="libyapi-armhf.so"/>
There are several ways to integrate them, they all work, but none of them is really ideal.
- Edit the YoctoVisualization.exe.config file and add the mappings. But this file can be unexpectedly overwritten during compilation.
- Add the mapping directly in the app.config source file, but this will break the Windows VisualStudio compilation.
- Use mkbundle to create a executable that contains, among other things, the dllmap.config file. That's what the buidLinuxBinary script does.
Known problems
This Linux version is not free from defects, here are the ones we already noticed:
- The Color editor has a weird side effect on the properties editor when one clicks on a drop-down list after using the said color editor. Clicking again on the drop-down list make the problem disappear. We'll probably have to rewrite the Properties editor from scratch to fix that, so it will take some time.
- The clipboard based screenshot feature doesn't work is not supported, but the PNG file version works fine as long as it is initiated from the menu instead of the printScreen key.
- The Memory usage tab, in the configuration window, doesn't display the amount a available memory.
- The zoom gesture on touch-screens doesn't work, but scroll works fine.
- Window borders style feature doesn't work at all.
- The mkbundle utility, used in the buidLinuxBinary script, is supposed to create fully autonomous executables containing the application, Mono as well as all required libraries. In theory, you could create executables that won't even require Mono to be installed on your computer. Unfortunately, we couldn't manage to achieve such an ideal result. If anyone knows how to make this work, we would be very interested :-)
Conclusion
Now, you know the essentials about this Linux version of Yocto-Visualisation. It is not perfect, but we will continue to work on it. So, should you have any comment or suggestion about it, don't hesitate to send a quick mail to Yoctopuce support.