Terminal printing over JavaFX application on Raspberry - javafx

Hi guys I'm new to Raspberry coding, for my three year thesis I'm writing a twitter wall application in javafx to be runned on a Raspberry Pi Model B+ v1.2.
I programmed it in eclipse neon under windows 10 and everything works correctly there, but when i moved the .jar on the raspberry initially it wasn't working at all. After a bit of googling i finally managed to make it work, i was on Raspbian Stretch with Desktop at that time and I only installed Gluon JavaFX Embedded SDK on my raspberry. After that the application started to run, a bit lagging and there was a problem with the input devices (which for me isn't really a problem because my app doesn't need any input from the user). The major issue is that whenever the app prints something on the terminal it shows up over the javafx app covering it.
After that i tried to install Raspbian Stretch Lite and after some steps i managed to make the app works, but with the same issue.
To make it works on Raspbian Stretch Lite i installed jdk8, gluon javafx sdk and xwindows (via sudo apt install xorg libgtk2.0-0).
I make a video of it to show you clearly what is the problem: (you can skip to 1 minute to see the issue)
https://drive.google.com/file/d/1EyvdpLuLnGwV3xrvgCqBU8e5T3go3-up
Hope someone can help me, thanks!

Related

Qt application crash on Wayland

I've recently installed Ubuntu 22.04 LTS on my development laptop. Previously I was running 18.04 so this is my first experience of Wayland. I did a clean installation on a new disc. I had relatively few problems reinstalling gitkraken and cloning the repository of my source code from github but when I came to install the Qt libraries this is where my problems started. The on-line installer from the Qt website simply wouldn't run. It just exited silently. I eventually found an old version of the on-line installer executable in a backup of my downloads folder from Ubuntu 18.04 and was able to use this to download and install the same version of the Qt libraries that I was using previously (5.15.0). This is also the same version that I use on my other development machine which runs Windows 10. Keeping the two in step is useful and upgrading too many things at the same time seemed like asking for trouble. I installed the latest versions of Qt Creator (7.0.1) and g++ (11.2.0).
I was then able to build my application and, after a brief search of stack overflow I added "-platform wayland" to the command line arguments setting in Qt Creator but the application crashed almost immediately on start-up with the error "The Wayland connection experienced a fatal error: Protocol error".
Several things made me think this might be a bug in the Qt libraries rather than my application (none of them definitive!):
At the point of application exit, apart from main() there is none of my application code in the call-stack (see below)
My application has been stable for a long time and has survived several operating system, compiler and Qt version changes across two OS families
The fact that the latest Qt on-line installer (itself almost certainly a Qt application) wouldn't run
I downloaded Qt 5.15.12 (the latest Qt 5 version available) and rebuilt my application against that but the result was the same.
The next step is obviously to strip my application right down to something minimal that still shows the problem but before I do I was wondering whether this is something other people have come across when migrating a Qt5 application to Wayland and whether I need to take the bigger step of upgrading to Qt6? The Qt Wiki describes Qt 5.11 as being "stable" with Wayland.
The call stack at the time of the error looks like this:
qt_message_fatal
QMessageLogger::fatal
QtWaylandClient::QWaylandDisplay::checkError
QtWaylandClient::QWaylandDisplay::flushRequests
doActive
QMetaObject::activate
QSocketNotifier::activated
QSocketNotifier::event
QApplicationPrivate::notify_helper
QApplication::notify
QCoreApplication::notifyInternal2
QCoreApplication::sendEvent
socketNotifierSourceDispatch
g_main_context_dispatch
??
g_main_context_iteration
QEventDispatcherGlib::processEvents
QEventLoop::exec
QCoreApplication::exec
main
Many thanks.
It's something to do with QDialog::setMaximumSize. The call to setMaximumSize itself does not crash but if I remove all calls to it the application works fine. Some controls do subjectively seem bigger on Wayland so I wonder if Qt 5 on Wayland crashes if the size of the QDialog contents exceeds the maximum size specified. This certainly doesn't cause a crash in Qt 5 on Windows and didn't in Qt 5 on Ubuntu prior to the switch to Wayland. I think this is a Qt bug but of course it may well be fixed in a later version of Qt and there's an easy enough work-around now I know the cause.
I was using setMaximumSize to allow the dialog to expand dynamically as widgets were added but to prevent the user from making the window any bigger than it needed to be. layout()->setSizeConstraint(QLayout::SetFixedSize); achieves the same thing.

Qt control not working properly in custom Linux

I'm trying to develop a Qt application to a custom linux built with Buildroot for Raspberry PI 4. My goal is to make an GUI through Touch interface and for that I'm using an USB Infrared frame.
My Problem
When I try to interact with a frame, I can move the dial, but when i try to use another dial it behaves like the first pressed dial didn't get released (like when you press mouse 1 and don't release it anymore).
It just stays selected and I can't interact with any other thing in the application.
I run the program using this command :
./dials -platform linuxfb
and here is the frame I am talking about.
What I tried so far
I tried some of the examples provided by Qt that came with buildroot. They seem to work just fine with the mouse in both the Raspberry and in Ubuntu (my PC). Also I tried the same examples in Ubuntu with the touch frame and they also worked flawlessly .
I've set QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS:/dev/input/event1 , if I don't do this it doesn't even move anything.

Qt cross compiled for RaspberryPi 4 - application runs but is not displayed

I'm trying to develop a gui for a RaspberryPi 4 using Qt. I followed the directions shown in this video and managed to get things up and running on the RaspberryPi. The speedometer demo that was demonstrated near the end of the video also works in my case. After getting the demo to work, I began working through the QML tutorials that were on qt.io.
I started with QML Tutorial 1 - Basic Types, and managed to get this to run on the RaspberryPi.
I then moved on to QML Tutorial 2 - QML Components. I attempted to run this application on the RaspberryPi, however, no gui/window displayed on the Pi.
Since I am new to Qt and new to cross-compiling in general, I went through basic troubleshooting steps:
Rebooted the Pi
Rebooted my Ubuntu VM that I am running Qt Creator from.
Deleted the build directory on my Ubuntu VM so that the application would be forced to rebuild everything.
Attempted to rerun the application (still no gui present).
Deleted the application from the Pi
Attempted to rerun the application (still no gui present).
Checked for a pid for the app on my Pi (A pid was present).
killed pid and reran the application, both from the Ubuntu VM as well as directly from the Pi. (Still no gui)
Attempted to run the demo speedometer application that I referred to in the first paragraph. This ran without a hitch.
I then deleted the additional code that QML Tutorial 2 introduced, and reverted back to the code that was only present in QML Tutorial 1. Reran and still did not have a gui.
What am I missing here? It doesn't appear that Qt is throwing any errors (from what I can tell).

Running videos on JavaFX in Raspberry Pi Zero

I am trying to run a program which shows a simple video through mediaView and then shows a QR code that is associated with a string that the program generates on javaFX in a Raspberry Pi Zero. I have tried to follow this answer Play a video using JavaFX on Raspberry Pi but I get the following problems:
I try to install Gluon following this tutorial (https://docs.gluonhq.com/embedded/#_setting_up_the_raspberry_pi) but I get the following error message when I try to run a JavaFX application WITHOUT video which simply has a button that when pressed show "Hello World":
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
It seems that Gluon doesn't work with the Raspberry Pi Zero but I am not sure.I must say that in order to follow the answer mentioned above I fully reinstalled the Raspberry Pi OS so it's up to date and previously I had been able to run JavaFX applications without video but not using Gluon.
Also when trying to install the gstreamer packages they all seem to be outdated and I can't install them.
So I would be very thankful if anyone could tell me how to not only properly install Gluon on Raspberry Pi Zero but also the needed packages in order to run the video. If you see that this is impossible do you have any ideas how to replicate this program in another language in order to make it work on my Raspberry Pi Zero
From that tutorial you have linked it states it is using Java 11 which your Pi Zero (ARMv6) doesn't support.
You will need supported hardware.
EDIT : If you wish to just play videos & use QR on your Pi Zero using JavaFX you can using Java8 instead.

Disable TortoiseSVN project Monitor

I installed TortoiseSVN on my work laptop (win 7 Ent.) and tried to integrate Tortoise with R-Studio. But because of some known issues (see here), I did not take it further and disabled subversioning on R-Studio. Since then, when I start R-Studio client, the Tortoise Project Monitor opens up automatically and takes R-Studio into initialization stage until it crashes and I have to kill R-Studio client.
After playing around for few hours, I learnt that I have to open two instances of R-Studio to be able to run it. So, now, I open R-Studio and let it go into initialization stage and then in the meantime, I open another R-Studio and the 2nd one works fine; then I kill first one. But, it is kind of annoying as the trick does not work sometimes.
I uninstalled R-Studio and reinstalled it again and no change. I am afraid if I uninstall TortoiseSVN and then cannot install it again- as it is an open source and there is no support team to help in case of any trouble.
Wondering if anyone has any idea on how to disable project monitoring at all. I don't really need it at all.
Project Monitor can be disabled in Project Monitor Options.

Resources