Raspberry Pi Custom SD Card Image - qt

I have a project uses Qt GUI which works on raspberry-pi2; however I don't want users to interact with the operating system. I just want that the only application appears on the screen (from boot to shutdown) to be is my application. Actually the retropie project has done what I actually want. So I want to prepare an minimal SD Card image like that. Is there any tool or way to do that?

You can use openembedded http://www.openembedded.org/wiki/Main_Page for this.
Creat file that describe packages for your image, at your case base system + qt,
plus create description of package of your program, that include .service file for run you program at start with systemd. The command MACHINE=raspberry-something bitbake your-image

I'd just use the init scripts to run your application as soon as possible and make it handle all user inputs (keyboard and mouse) properly, without giving any way to the user to close it.

Related

Start a background process on Qt and load responsive shell environment

I am playing around with Qt to create a simple GUI for some more advanced analysis with the software called OpenFOAM. Right now, I want to start an application of the toolbox OpenFOAM usingQProcess::execute. It is working but for the application I need to load the environment in the shell.
Commonly, if I work in the terminal I first do have to source the environment file that loads all libraries and solvers one can use. However, in Qt, I am not aware how to achieve that.
Example. In the terminal I need to do the following:
source /path/to/environementFile
simpleFoam > logFile << application
I want to start the application simpleFoam in the background of my GUI after clicking on a button. Right now, I do have the following:
QProcess::execute(QString("/home/shorty/OpenFOAM/platforms/bin/simpleFoam"));
This works but the shared library that are needed by the application are not loaded (missing source of the environment file). Is there a way how to process more commands within one execution call?

How to run multiple debug instances of a GM:S game

I'm building a client/server application in Game Maker: Studio 1.4 and need to run two instances of the game for testing. Unfortunately, the IDE's run/debug buttons disable themselves after starting the first copy. Is there a way to configure the IDE to permit two instances to run concurrently?
Opening two complete copies of the IDE sort of works, but seems like a great way to break my game by saving things out of sync.
I'm currently exporting the game every time I make a tiny code change and only debugging on the host instance, which is less than ideal.
Is there a way to configure the IDE to allow multiple instances of the game to run via the run/debug buttons?
Allright, here's what I have;
When you compile a game from the IDE you'll see a line like this one somewhere in the compile log:
C:\Users\You\AppData\Roaming\GameMaker-Studio\Runner.exe -game "C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071\GAME.win"
When you execute that script in a command line (START+R) you'll see the game runs just fine.
In order to automate this, I am using the working_directory variable (which returns C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071.
As GM:S does not support executing shell scripts, I have added this free asset to my game:
https://marketplace.yoyogames.com/assets/575/execute-shell
In my game I have added a button which calls this code;
ExecuteShell('%appdata%\Roaming\GameMaker-Studio\Runner.exe -game ' + working_directory + "ShootMUp.win",0)
Please note that you'll have to manually edit the .win file name.
But, this works and lets me run multiple instances of the same game without exporting it to .exe or build it again.

Beaglebone Black, Qt Application, and startup procedure

I have a BBB running Debian 3.18.13-bone70. I have made a Qt application that works great. I would like this application to run on startup.
Currently, I have made a script, placed it in /etc/init.d and made a symbolic link to it in /etc/rc5.d/S05application. This all functions correctly.
The issue that I'm having is when my system boots up, I see my application briefly (<1 second) before the CLI login screen appears and hides my application.
I've tried playing around with the startup script location (moving it to rc2.d, but the same issue persists.
I have a splash screen that times out after 10 seconds, and it moves on to the next screen. After moving to the next screen the application is never hidden again. I would like to see the splash screen the entire time and hide the CLI login screen entirely. How could I go about doing this?
EDIT:
#!/bin/bash
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_TSDEVICE=/dev/input/event1
/home/root/./Scanscale -qws
This is the script that I use to start the application. The Qt window service is used when I start the program.
EDIT 2:
I'm running Debian 7 using the Debian 7 image from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian from March 1, 2015. This is maintained by Robert Nelson, I'm not sure if it's a yocto build or something else.
Furthermore, it doesn't appear to be an X issue. I've stopped loading X, I no longer boot into the application and just sit on the command line waiting to log in. The system flickers at about the same point in time. Any thoughts?
I should probably also mention that I'm running it on a 4.3" LCD cape, not on the HDMI interface.
You weren't specific about your system and what else is running on it. For example, is it a yocto build and does it run the sato user interface, or is it more traditional X server with a display manager, window manager, etc? Either way, there is a session-specific file which directs what programs get launched when the Xserver starts up. Using matchbox, that file is .matchbox/session. With X, it's usually xinit, which is driven by .xinitrc or .xserverrc. Also, look at startx as another poster mentioned. The latter can either be in your home directory or /etc/X11. Depending on your system and configuration, likely one of those methods, customized, is what you're looking for. See man xinit for more info.

CC2540 DK Program SimpleBLE Peripheral Application

I have purchased the CC2540 EK I am trying to program the SampleBLE peripeheral onto the CC2540EM. I am using the IAR tool chain and the USB cable is connected directly to the SMARTRF05EB (not using the CC debugger) In IAR I can download the code but the SimpleBLEperipheral does not seem to run.
Looks like the App that came with the CC250EM from the factory has been erased and I am unable to reload that application again.
What is the exact project workspace that I shoud open?
Are there any changes that need to be made to the IAR project so that it can be run on the CC2540EM?
The IAR project name is SimpleBLEPeripheral - CC2540DK- MiniKeyfob - this seems to suggest that it is meant for the keyfob and not the CC2540EM.
It's due to the build option.
You got to set the build option to "cc2540", instead of "cc2540df-mini keyfob"...
In IAR, you can set the build option in the drop-down menu in the Workspace area. (it's right under the word "Workspace")
After doing this, compile and reload the hex file to the module.
It should be able to solve the problem.

How to call an app that expects stdin input from QtGui?

I'm using Ubuntu and Qt Creator 4
I have a .cpp program in the executable form (say abc.out) that I wish to run when I press a button. It contains a number of cin and cout, so I want it to run on a "terminal" (on Ubuntu) so that I am able to input and output values to it. How can I do that?
I've tried system() and
also,
QProcess p1;
p1.start(./abc.out);
Using QProcess, my executable runs but stops at the first cout. It runs on the application output screen in Qt Creator and not on terminal.
For example:
I see on application output:
enter name:
When I type the value and press enter here, it doesn't accept the value, but moves to the next line and allows me to type further.
I want to run this abc.out file on the terminal. Any ideas would be really helpful.
Do you mean Qt Creator 2.4? In any case, on the Projects tab, you should find the Run settings section and from there you can find a "Run in terminal" checkbox. You could also use a Custom Executable option and type there: gnome-terminal --command ./abc.out The exact details can vary a bit as I'm using Qt Creator 2.5.
This should work when launching from Qt Creator, but when you use your app outside the IDE, you need to launch it from terminal and not by double clicking the executable. To fix this, I can think of two ways:
Launch a terminal window from QtGui (something like QProcess::execute("gnome-terminal --command ./abc.out"); ), though the problem is different systems have different terminal names.
Provide a Qt input/text box yourself as part of your GUI which then forwards the user input to the executable (something like myqprocess.write(input_asked_from_user_by_QtGui); ). Here you probably need to know what information to ask the user beforehand. If you want to display the cout output of the started process, you can use the read method and friends of the QProcess.
From your question I assume that you are writing an application that launches other applications using QProcess. Thats fine, but if your subprocess is waiting for data from the standard input it will wait forever since you did not provide any data. The stdin of your parent application cannot be automatically guided to the subprocess. Imagine you are starting two processes from your main app. To which child process should the input go?
If you want to communicate with child processes, you must use the QIODevice methods of QProcess and send/read data from/to that application.
The only sensible solution is to launch the target application in a terminal. Whether your own code provides the terminal window or you reuse an existing terminal application is up to you.

Resources