-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Purethermal 2 #18
Comments
Hello nsknyc, first lets find out, if the camera is an uvc device: lsusb -v -d xxxx:xxxx So far, Peter |
Ok, some corrections. I don't want anyone to be misled. DJI smart controller is essentially an Android tablet, but it doesn't come with google play preinstalled. So to get this app, I needed to use an 'apk downloader', and due to that I was only able to get an older version of the application. So I decided to install (jumping a couple of hoops) google play and get the updated app through there. But by doing so the app will crash if you try to enter "set up the camera device" |
Here is my lsusb off of virtualbox. The osx version apparently doesn't understand what Verbose means. |
Hello nsknyc, from your outreaded camera specifications I can see, that the termal camera uses different image formats than standard uvc cameras:
I don't know, how to solve this up to now, because this guid is not described anywhere. So far, Peter |
Here I need some informations:
The termal camera uses some image formats, which my app actually does not support: UYVY (I think I can add this format). That's the reason, why the stream is actually not optimal.
The app crashes, because it can not find the native librarys to load.
|
Thank you for the update. I've been a bit busy work, but I'll be on top of this again tomorrow. |
Hmm, these libs were not in my folders, I'm pretty sure I cloned the repo properly. I must have done a clean and it emptied out.
I have a compilation issue, missing symbol humer.UvcCamera.R As for the settings I used they are After experimenting for a while the Frame index changes the type of video output. I honestly thought that was something done by the getthermal app. |
Yes, till the build, the native libs folder is cleaned and rebuild again. Try to exclude the whole native parts in the apps build.gradle file. -> download the repo as a zip file and copy the native libs manually to its directory.
Ok, the maxPacketSize and Altsetting looks to be allreigh. The FormatIndex is also right, but the Videoformat is not the right one: It should be UYVY but not supported from my app up to now. The FrameIndex, ImageWidth, ImageHeight and FrameInterval are allreigh. You have set the LibUsb Support to false. If you get a fluid stream, you can stay at false (The stream is performed only over the java side, which is a bit slower than using the libusb library, which runs in pure C code and is faster due to this behavior).
|
I have increased those before. The stream does noticeably improve, but the issue here is definitely the colors and resolution. I've spent all day looking over the code, and realized that you did a java implementation of libuvc (essentially). Good stuff! I've also have been using purethermal2 board's firmware source code as a reference. I'm not familiar with uvc, but I'm trying my best to catch up. I confirmed some of the info off of this file. I'm not sure why is says 80,60 max frame size, but the lepton module is definitely 160,120. The getthermal app definitely pulls a higher resolution. Perhaps it communicates with the purethermal board to increase the resolution. -- edit -- |
Hello nsknyc, can you plz try out the following apk with UYVY support: https://drive.google.com/file/d/1c0EJ8os-U24djrTg9K_GEDYOgBldZhUD/view?usp=sharing Select under VideoFormat UYVY So far, Peter |
No stream, white background. The camera is activated though. When it starts streaming it goes from 1 second blinking to a very fast blinking pattern. |
Ok, let's take a look at the frames: Under the Button "Set Up The Camera Device" you can also analyse your camera stream. First post an output of the control transfer to your camera. Next perform a testrun and post the output of 1 frame received and frames for 5 seconds. You can try out different values for PacketsPerRequest and ActiveUrbs. When every frame has a length of 38400 bytes, your stream is allright. The termal camera has a lot more functions under the Control_Interface than a regular usb camera. Eventually attach some screenshots with the outputs you receive, or write it down to a txt file. So far, Peter |
Would you like all the data from the test (1 frame(YUY2 & UYVY) and 5 frames (YU2 & UYVY)) including the hex strings on the bottom? |
Basically only the frame lenght. Next point would be to save a frame with a lenght of 38400 to a file and display it on a desktop pc, to see, if it's a valid frame. When the LibUsb part is crashing, it should be debugged under Android Studio. The Automatic Detection so far is a beta up to now, so here a crash doesn't matter. Otherwise to the missing repos included in the Android.mk file: I have attached all native folders. You should then be able to build the app under Android Studio. (I'm compiling this project under Linux as operating system, maybe win is throwing some other errors) So far, Peter |
The hex streams do seem random. I'll be posting them soon.
The frame lengths definitely hit 38400. I'll try to save these hex values somehow. I've only saved these through screenshot.
Yes, libusb part is crashing. I wish I could debug through android studio unfortunately there's an issue on OSX that devices don't appear in the "device file explorer" same happens with android file transfer. That is something apart though.
I included the libs from the zip file, but I'll include the sources and build them. Btw I'm on mac OSX. Let's see how it goes today. |
The native libs are available now. You can try to compile them. |
Build with native libs successful. Device explorer working now. Caused by: java.lang.NullPointerException: Attempt to read from null array I have an update. The camera does in fact support UYVY, but the output we get through the 'getthermal' app is raw data.
https://github.com/groupgets/purethermal1-firmware/wiki/Transferring-raw-(14-bit)-Lepton-data The uvc frame format should be Y16. |
@38293312 hmm, that doesn't seem like an app issue. It doesn't even detect the purethermal board. I suggest trying different cables make sure its USB OTG. Once you connect pt2 board android should detect it before even launching the app. |
Ok so from StartIsoStreamActivity.java 2021-03-30 00:53:28.068 2077-2153/humer.uvc_camera I/UVC_Camera_Iso_Stream: calling convertUYVYtoJPEG java |
@38293312 May you upgrade the purethermal firmware to version 1.3.0 and try again? |
Ok, turbo-jpeg failed. --> great you can build the repo now. |
Ok, eventually I will add this format too. |
Problem should be solved. Rebuild the app to test the uyvy stream. |
Ok. I think I'll close this, as the update has worked successful. @Peter-St thank you very much for your help. Hopefully this will help other PT users |
@nsknyc what was final working configuration, that made PT display feed on Android-UVC correctly? |
I've been a bit side tracked with other projects, but last version that worked for me I compiled from source (after Peter updated the code). I didn't use the playstore version. I'm not sure if its updated. I have a new android device now, and plan to test it there. Unfortunately, I can't give an exact time frame atm. |
I noticed that there's a config for 'groupgets' that sets the proper resolution for a purethermal 2 and lepton 3.5 module.
Surprisingly when i hit the stream video it activates the camera (light blinks quickly), but there is no image (it just stays white). This is the farthest I've gotten with this camera on android so far. I've tried UVCcamera and its variants without any success. Unfortunately, the only android device I have is a DJI smart controller which, If I'm not mistaken, runs on Android 7.1.2. I have never developed for android before, so please bear with me.
First, I'd like to point out that I get a build failed under android studio. I get a
Process 'command '/Users/nsk/Library/Android/sdk/ndk/21.1.6352462/ndk-build'' finished with non-zero exit value 2
I got figured out that it has to do to app/src/jni/Android.mk includes that don't exist. After commenting those out, one needs to allow_missing_deps, after this build succeeds.
I'm aiming for this path, because I figured I could get more info debugging this way.
I know that there are a bunch of factors here, dji device(probably a custom android version), thermal camera(luckily its very well documented), and android version on host device, but any help on directing me how to debug this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: