x11vnc on embedded raspberry QT5 app - c++

I need to start a VNC server (x11vnc) in my Raspberry pi 3. It's running without X-server (Raspbian Lite). My app (C++ QT 5) writes directly to Linux framebuffer.
Following to some instructions in Qt creator forum, I've done some progress.
At this moment I can start a x11vnc server, connect to Raspberry via a regular VNC client and use my app with mouse and keyboard.
YES, IT'S WORKING.
BUT... If I change the Raspberry resolution (raspi-config) to something different from 1280x720, I don't know why, I can't see the screen perfectly. The VNC client shows a distorted display, like the image bellow.
(And, unfortunately I can't set a fixed resolution)
This is my actual settings to start x11vnc:
x11vnc -permitfiletransfer -nopw -rawfb +/dev/fb0 -forever -noxrecord -noxfixes -noxdamage -xrandr -bg -shared -pipeinput UINPUT:accel=0.7,reset=0 -cursor none -nodragging
I already tried to start with -clip 1280x720+0+0, -geometry 1280x720 and -scale 1280x720, (with other values too) but had the same problem. =/
And I start my application like this:
my-app -platform linuxfb
Both are started with root user.
If someone have an idea of how to fix this, please tell me know! Thanks!

Related

Realtime desktop capturing Mac OS X Mojave and X11

I'm working on project which streams desktop image from Mac OS X computer to iOS device in realtime. My main problem is the screen capture. I'm not allowed to use ready libraries, which allow to write some lines of code in 5 mins and stream video over the World.
I've found a really good thing on GitHub which gets image of the whole screen using X11 and C++ :
https://github.com/Butataki/cpp-x11-make-screenshot
I've tested this code on my Ubuntu and everything works like a charm : it takes about 12ms just to capture 1 frame without saving data, and about 25ms with encoding to .jpg and saving on the disk.
To be able to build it, I've had done this :
$ sudo apt install libjpeg-dev libpng-dev libx11-dev
, changed 'true' to 'TRUE' in those lines :
//(screenshot.cpp : 232,233 lines)
jpeg_set_quality (&cinfo, quality, TRUE);
jpeg_start_compress(&cinfo, TRUE);
and changed Z_BEST_COMPRESSION to PNG_Z_DEFAULT_COMPRESSION
The problem is that I did almost the same operations in my XCode (Mac OS Mojave 10.14), downloaded and linked all necessary libraries, ran executable and finally....I got a blank image. No errors occured, everything works 'fine' and saves .jpg image in my folder on desktop.
Then I figured out that X11 has a something called the 'root window', which covers all of the desktop and you can just find this window and capture everyting on your screen. But I think it's true for Ubuntu, not for my Mac.
Actually, there is something about 'root window' in this article, but I just can't fix anything :
https://finkers.wordpress.com/running-x11/#intro.rootless
P.S If it's not a good way, maybe there are some another ways to acomplish my task (realtime screencapturing on Mac OS)?

Warning message in Bluetooth: TIOCGSERIAL is not supported

I want to link a Bluetooth barcode scanner (Gryphon GBT4400) in "client" mode to a Bluetooth-enabled PC with the serial port profile.
The Bluetooth PC adapter is Atheros Communications AR3012.
PC is running under Ubuntu Server 16.04.
I first run the following commands through bash script:
sdptool add --channel=22 SP > /dev/null
rfcomm watch /dev/rfcomm0 22 1>/dev/null 2>&1 &
Then with scanner I scan the barcode to link the scanner to the PC in Bluetooth (this barcode includes the MAC address of the Bluetooth interface of the PC).
It works well: PC and scanner are now connected.
Then I open the serial port through a QT/C++ application running on PC, built with QT 5.5.1, with following code:
pSerialPort = new QSerialPort("/dev/rfcomm0");
pSerialPort->open(QIODevice::ReadOnly);
At this step, this warning message is immediately displayed on PC:
Bluetooth: TIOCGSERIAL is not supported
Except this warning, everything works very well: the QT application retrieves correctly all the scanned barcode values.
I found almost nothing on the web.
Can someone help me to understand this warning message ?
You could remove all warning and error messages with:
qt_app 2>/dev/null
but that would hide other warnings that you might want to see. To hide just this one without having to change any source code and recompile, you can do:
qt_app 2>&1 | grep -v TIOCGSERIAL

How to flash stm32 using only Linux terminal?

So, threre are Archlinux distro, stm32 mc, and C code. How to flash stm32, without some IDE, only using console?
With Texane stlink
Install as described in the README
Convert your firmware to .bin if necessary
arm-none-eabi-objcopy -O binary firmware.elf firmware.bin
/opt/stlink/st-flash write firmware.bin 0x8000000
With OpenOCD, if your board is not supported by Texane
Get it from the link above and install (ignore the eclipse-specific parts)
Find your board description file in openocd/scripts/board, create one if necessary.
openocd -d0 -f board/yourboard.cfg -c "init;targets;halt;flash write_image erase firmware.hex;shutdown"
If you have USB to UART adapter, you can use stm32flash. Basically connect USART1 to the adapter, pull BOOT0 to high (there might be a jumper or button on the board) and power up / reset the board. Then you should be able to follow stm32flash -h to see what to do.
Some STM32 (e.g. STM32F042) has USB DFU bootloader built in, so you can also connect the MCU to USB directly and use dfu-utils.

Intel pin: Instrumentate running process

I created a simple pin tool that dumps any win32 CreateFileW calls. It works fine, but when i try to attach it to an already running process, the process simply terminates. Tried with several applications (notepad, wordpad, internet explorer), same result. This is the command i use:
.\pin -pid 8804 -t dumpfile.dll
I got a tip to try and turn off multi-threading like this:
.\pin -mt 0 -pid 8804 -t dumpfile.dll
but it did not help. Also tried with another, out of the box pintool, didn't work either, so the problem is not in my pintool. Any ideas?
Thanks in advance!
Okay, today i had some time on my hands to research this problem again. Tested with a console application launched from cmd, and before shutting down, it actually dumped an error message, the .dll (the pin tool) was not found...
So when running pin you actually have to specify the full path to your pin tool, or the path relative to the instrumentated binary's location.

How to make screenshots using VMWare tool "vmrun"?

I'm currently working with the vmrun-Tool, to control VMWare Virtual Machines.
I'm using VMWareWorkstation 7.0.0/7.0.1 and VMWarePlayer 3.0.0 on Windows 7 x64.
I simply want to take a screenshot of each virtual machine which is powered on.
Listing the power-on virtual machines is quite simply and works!
(vmrun list)
But the captureScreen command doesn't work.
I have tried several commandline options.
For example:
vmrun -T ws captureScreen %VMPATH% %OUTPUTPATH%
I get no error message, but the console is blocked (and the command never finishes).
I have also tried to include -gu USERNAME and -gp PASSWORD, but it results in the same problem.
Be sure the user/pass that you use for '-gu' and '-gp' are a valid username and password for the guest OS not the host.
I had the same trouble as you because I was using "root" and "root_pwd" for my user/pass, then I realized it had to be a pasword inside the guest.
vmrun -T ws -gu GUEST_USER -gp GUEST_PASS captureScreen %VMPATH% %OUTPUTPATH%
Also, the %OUTPATH% needs to be a png. The captureScreen command outputs in PNG.
I tried to run the statement in my questition via VMWare Player 3.1 and it worked. I guess I might also work using the new VMWare Workstation (7.1).