How to take screenshot from command line on BBB Angstrom - beagleboneblack

Hi I have a BBB which is running on Angstrom 2013 image. For display purpose I am using a cape which is connected to gpio extensions. There is a Qt application running on BBB, which use to get displayed on the Cape.
How can I take screenshot of the cape.
I want to take some screen-shot of the running application.
I couldn't find gnome-screenshot on angstrom image, using import command to take screenshot I got an error regarding x11.
How can I get the screenshot?

You can try and install scrot
On Ubuntu based Beagle Bone Black, I installed it as follows:
sudo apt-get install scrot
To Capture a screenshot:
scrot -q 100 /home/debian/Desktop/Desktop.jpg
#-q 100 == best quality
# /home/debian/Desktop/Desktop.jpg is path where to store captured screenshot
For more information, you can read this tutorial here.

Related

Error installing Nvidia Drivers Fedora 35 Kernel 5.16.15

Spent three days trying to install nvidia graphic card drivers in Fedora 35 running on kernel 5.16. I was installing from the download .run file which threw error 'MIGRATE_PFN_LOCKED' undeclared in /var/lib/dkms/nvidia/495.46/build/make.log
I tried installing without enabling dkms but still couldn't install the drivers
systemctl set-default multi-user.target
then
systemctl reboot
as root user. On logging in, change directory to where you download .run installer for your Nvidia graphic card and run below
sh ./NVIDIA-Linux-x86_64-XXX.XX.run --extract-only
Above extract the installer file which will give us ability to edit the driver source code. Use your favorite editor to open the file uvm_migrate_pageable.c which is located in your extracted driver folder as below:
kernel/nvidia-uvm/uvm_migrate_pageable.c
My favorite editor is vim, so in my case, I will open it for editing as below:-
vim /NVIDIA-Linux-x86_64-XXX.XX/kernel/nvidia-uvm/uvm_migrate_pageable.c
Add below lines on declaration part of the source file or before where it is referenced in this c source file.
#ifndef MIGRATE_PFN_LOCKED
#define MIGRATE_PFN_LOCKED 0
#endif
save the file and now run your driver as below while inside the folder we extracted:
./nvidia-installer
Installation process should now complete without any errors and you can now revert to your X windowing system by running the command:
systemctl set-default desktop.target
References:
https://bbs.archlinux.org/viewtopic.php?id=271400
https://github.com/torvalds/linux/commit/ab09243aa95a72bac5c71e852773de34116f8d0f
Issue: The NVIDIA team do not yet have support for kernel 5.16.15 for the time being.
Solution: Patch the current installer yourself by running below, note that you must have x disabled probably by logging into your fedora via text mode which can be achieved by running the command

How to find out what image version is installed on QNX?

I am trying to find out what image version is installed on a QNX box.
Checking this link: http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_utilities%2Fp%2Fprocnto.html
I went into /sbin/ and had a look in there but there aren't any binaries I can see that would provide this information.
I attempted to run the command pci -v which printed a lot of system info, but no image version/information.
You can try:
uname -a
More info here: http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.utilities/topic/u/uname.html

VIDEOIO ERROR: V4L: can't find camera device

I am using ubuntu16.04 and trying to run opencv script.
when i use:
video_capture = cv2.VideoCapture(-1)
it gives me error VIDEOIO ERROR: V4L: can't find camera device
No video window opens
But when i run
video_capture = cv2.VideoCapture('test.jpg')
It opens window shows the picture and close the window.
Please tell me why it is not streaming video directly from camera.
The suggestion api55 gave in his comment
video_capture = cv2.VideoCapture(0)
is what I would try first.
Generally, you can list the available cameras with ls /dev/video* or v4l2-ctl --list-devices. Here sample output:
NZXT-U:rt-trx> v4l2-ctl --list-devices
Microsoft® LifeCam Cinema(TM): (usb-0000:00:14.0-1):
/dev/video1
Microsoft® LifeCam Cinema(TM): (usb-0000:00:1a.0-1.3):
/dev/video0
/dev/video0 corresponds to device id 0, etc.
PS: v4l2-ctl is quite useful for solving camera issues and can do much more than --list-devices. I installed it via packagev4l-utils on a 16.04 machine.
Late, but to get mine working i put in terminal:
-ltrh /dev/video*
To get a list of the video devices that are plugged into my computer. Then for each one I did:
sudo chmod 777 /dev/videox
Where x was one of the video files that were listed, giving everything access to them. Probaly not the most secure solution, but it got my code working.

How can I properly run OpenAI gym with nvidia-docker and see the environments

So I'm trying set run OpenAI gym in a docker container, but it looks like this:
Notice the pong window has a weird render issue where it's repeating things and the colors are off. Here is space invaders:
NOTE FOR "NOT A PROGRAMMING ISSUE" PEOPLE: The solution involves the correct bash script code to call the right API methods to render the arrays of pixels correctly. Also only a graphics programmer is likely to "recognize the render glitch".
My setup is very simple.
- I'm on a local ubuntu 16.04 install with an Nvidia gtx1060 and corei7
- I installed nvida runfile driver with --no-opengl-files (as per instructions from Nvidia and many place).
- Specifically, I'm running floydhub/pytorch docker image.
Does anyone recognize the particular render glitch and what it could mean? It almost looks like a StackOverflow of a frame buffer! What can I do to track down the bug?
EDIT: I have eliminated all the extra dependencies I had been installing and am just doing simple x-forwarding according to the ROS GUI guide.
You can easily reproduce this as follows:
docker run -it --user=$(id -u) --env="DISPLAY" --workdir="/home/$USER" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" floydhub/pytorch:0.1.11-gpu-py3.6 bash
Now in the image, type python and then the following:
import gym
gym.make('Pong-v0').render()
That should open up an x-forwarded window on your machine, but the display is corrupt (at least for me)
Above I actually used SpaceInvaders-v0

Cannot connect xtion pro live with Ubuntu 12.04

I need to work with asus xtion pro live to detect hand movements and objects. I am an amateur as far as it concerns programming this camera.
My problem is how to connect them and from where to start.
I work on Ubuntu 12.04. I've downloaded Ros fuerte and both Openni2 and OpenCV. When i plug the camera (usb port) and run the lsusb command, i see this:
"Bus 001 Device 003: ID 1d27:0601 "
Even when i run the command $ roslaunch openni_launch openni.launch
i get:
[ INFO] [1415717730.873978521]: No matching device found.... waiting for devices. Reason: openni_wrapper::OpenNIDevice::OpenNIDevice(xn::Context&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&) # /tmp/buildd/ros-fuerte-openni-camera-1.8.6/debian/ros-fuerte-openni-camera/opt/ros/fuerte/stacks/openni_camera/src/openni_device.cpp # 61 : creating depth generator failed. Reason: USB interface is not supported!
Can anyone please help? Is there a problem with the camera driver?
Thank you in advance.
you must go to a terminal and do
sudo nano /etc/openni/GlobalDefaults.ini
and there find UsbInterface and make sure it is not a comment (without ; at the beginning) and that is equal to 2
UsbInterface=2
I heard that this may give you problems with Kinect hardware (the same error you are getting now). But, if you use the Kinect later on and gives this problem, just comment it and it should work
;UsbInterface=2
You must reboot every time you change this value!!
I hope this works for you ;)

Resources