Beaglebone Black PRU_Timer with ecap - beagleboneblack

I need help regarding the PRU timer on the Beaglebone Black. I have the Debian 5.4 kernel and UBoot. Unfortunately I have no idea how to use the ecap to use a PWM signal to measure the "duty_cycle". Have always worked with the filescript, but apparently there is no support for this. So I wanted to ask if someone knows another way. Thanks

Related

How to use the Beaglebone Black's PRUs?

I would like to use the PRUs of my Beaglebone Black. I 've been following several tuturials from the internet whithout any significant success. Most documents are outdated because the bone_capemgr is no longer supported (at least from what I understood). So how can I use the PRUs in combination with one of the Linux systems provided by beaglebone.org?
A programmable real-time unit (PRU) is a fast (200-MHz, 32-bit) processor with single-cycle I/O access to a number of pins and full access to the internal memory and peripherals of the BeagleBone (http://beagleboard.org/pru).
There are many tutorials online for PRU coding on newer beaglebone images.
I would suggest you to get familiar with the PRU Libraries and then try some simple and recent blink code or follow some example of remoteproc usage.

Using imshow in opencv without running X

I've got an application with a Raspberry Pi running Debian that is pretty performance demanding and I am trying to avoid starting X when booting and jumping directly into the program. This works fine, but if I would like to use the 'imshow' function in OpenCV, it does not work correctly, instead it says 'GTK-Warning: cannot open display" and exits the program.
Is it feasible to display a fullscreen image/video capture with opencv using imshow or any other function without X, or is it entirely dependent on the X?
Thanks,
For clarification, there is a monitor, it just shows the terminal prompt instead of a desktop. So the raspberry pi is getting an image to a screen at the correct resolution, I guess what I don't understand is what X11 does for opencv as far as handling of the window/image? I imagine a lot that cant be easily replicated.
But maybe a lightweight X11 alternative would be the best way to go if there's not another option, thanks for the tip.
Well, obviously the video output has to go somewhere... You could try Xvfb as a lightweight alternative to a full X11 instance.

How to connect usb webcam to ev3?

I would like to connect an USB webcam to my EV3.
is it possible to do that?
and how can I do it and how can I reach the cam from my code?
I use Labview for programming
and thanks in advance :)
Both leJOS and ev3dev support USB web cams connected to the EV3 brick, however, neither work with LabView.
To get this working on the official LEGO firmware, you need to compile proper kernel modules, sideload them on the EV3 and as suggested in the comments, sideload another program that converts the image data into something that can communicate with labview remotely.
use bellow vi to convert image to 2d array use array tool to cut appropriate part
and do not forget for average use this equation otherwise the answer will be wrong
ave=r/3 + b/3 +g/3 not r+b+g/3
vi

Detecting non-wifi signals using laptop

I was thinking if it is possible to detect other RF signals in the environment using my laptop? I don't know if there are any programs which does this, but I think there might be a solution for this, perhaps by working on wifi drivers.
I'd be thankful if anybody helps me out. Thanks in advance.
Yes there are programs that do this, i.e. Metageek. I have also seen people build their own home-brew spectrum analyzer if you are so inclined.

OpenCV: black image captured from usb camera

I am trying to capture an image frame from a USB camera using opencv. However I am always getting a black frame. I have read many posts with this issue and tried all the suggestions but nothing worked for me.
I started using the code discussed here:
http://opencv-users.1802565.n2.nabble.com/Using-USB-Camera-td6786148.html
I have tried including the method cvWaitKey(1000) after many 'critical' sentences. As you can see the waiting value is very high (1000).
I have also tried to save the image frame and, equally, it is a black image.
I am using the following system:
OpenCV 2.2.0
Windows 7, 32 bits
Visual Studio 2010 (C++)
a board usb camera (which I do not know the manufacturer)
The usb camera works well with AMCAP.EXE 1.00.
Could it be because of the camera drivers being used by Windows? Could I change to other drivers that work better for OpenCV 2.2.0?
Thanks
Ok. As I promised to your request in the comments, and sorry to keep you waiting, really been busy. Barely had time to post this answer too. But here it is:
This is me simulating that opencv is capturing black image. On the output window, which I had asked you in the comments about what it says, shows that there is an error.
After investigating, I realised that it is due to the camera's available format:
Of cuz, this is a lousier camera. If you have a better camera like the logitech one, you can see that the format available is so much more.
There are lots of methods, you can try some thing like
capture.set(CV_CAP_PROP_FRAME_WIDTH , 640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT , 480);
capture.set (CV_CAP_PROP_FOURCC, CV_FOURCC('B', 'G', 'R', '3'));//diff from mine, using as example
then the webcam will be able to snap. This webcam is bit faulty, hence the image snapped is not that beautiful.
Hope this is your problem. but it may not be the case too. I like debugging problems, but I can't put down all the possible causes that this happen for you as I am really busy, as you asked for an example, this is one of them. Cheers. If you could tell me what you output window error says, I probably can help more.
EDIT(to answer more in your comments):
Ok, I want you to try a few things:
1)First, instead of using cvQueryFrame, or similar capturing methods, I want you to try use that webcam to capture a video instead. Wait up to maybe say 10 secs to see if it's successful. Reason being, some cameras(lower quality ones) take quite a while to warm up and the first few frames they capture may be an empty one.
2) If the step one doesn't work, try typing
cout << cv::getBuildInformation() << endl;
and paste the results for media I/O and Video I/O? I want to see the results. I would suspect your library dependencies too, but since you said it works with a logitech camera, I doubt that's the case. Of course, there's always a chance it's due to that the camera is not compatible to OpenCV. Does the camera have any brands by the way?
3) Alternatively, just search for usb drivers online and install it, I had a friend who did this for a similar problem, but not sure the process of that.
The first thing, I would suggest is, visit this link and check your camera is working or not
http://www.youronlinemirror.com/
if yes, then go through below link to get started with things, you ll also find a good opencv c++ code out there, the code which you are using is of opencv1 api's c code, I would rather encourage you to go for c++ than the old version of opencv.
http://opencv-srf.blogspot.in/2011/09/capturing-images-videos.html
if you want an answer for your code, then, its simple, as you are saying its giving a black screen, which happened in my case when i started things out with opencv,
it isnt able to take the data from device, so, try this, it might work, as it did for me.
add
cvQueryFrame( capture );
before
IplImage* frame = cvQueryFrame( capture );
I went through the same problem as yours. Then I just changed the version from 3.1.0 to 2.4.13, then my webcam works! No more black images. I guess the 3 version is not compatible with the vs15. Thinking you may have already solved the problem long ago. But just post to let others know if they happen to have the same issue.
Even I faced the same black screen problem while running OpenCV-related programs. So instead of using USB cam I used mobile camera which worked perfectly fine. Use Google apps such as DroidCam (install DroidCam on mobile as well as on laptop/PC) to connect your mobile camera to laptop through Wi-Fi.

Resources