Author Topic: Question about FLIR One for Android  (Read 262021 times)

0 Members and 2 Guests are viewing this topic.

Offline Ben321Topic starter

  • Frequent Contributor
  • **
  • Posts: 894
Re: Question about FLIR One for Android
« Reply #300 on: February 17, 2017, 10:18:03 pm »

I don't want to save just JPEG images. I want to access the 16-bits raw video data stream, but do it on Windows.
Anybody know how to do that?

Yes, I understand your problem, but there are two steps:
(1) USB communication with F1G2
(2) video stream in windows

I think, for solution of the first task the smaller jpg-version without  V4L part is a good entry point.
There is no Click-To-Run solution for compiling the linux code in windows.
Have fun  ;)

The Windows has an equivalent to V4L (video for Linux). It's called VFW (video for Windows). In order to use the VFW framework, you simply need to write a VFW driver for the device in question. In this case, the device is the FLIR One Gen2. VFW supports a number of different video formats, but unfortunately 16bit grayscale isn't one of them. However, I can think of a potential workaround. That workaround, is to write a driver based on YUYV. This way the driver will accept 16bits of data (YU bytes on the first pixel, and YV bytes on the second pixel, etc). Now, once the driver is written and compiled, and you access your F1G2 from within your own software using the VFW driver, will the preview window interpret this as YUYV color data, and the preview window will show it incorrectly. However the VFW framework allows you to write your own video stream callback function in your program, and using this feature you will be able to access the raw pixels, and write your own code that does not process it as YUYV color data, and instead handle it correctly as 16bit grayscale data.

All I need now, is to find a member of these forums, who's willing to take their time and write a VFW driver for the F1G2.
 

Offline djcasper

  • Newbie
  • Posts: 4
  • Country: gb
Re: Question about FLIR One for Android
« Reply #301 on: February 28, 2017, 04:14:28 pm »
Hello.

I have tried your example of extracting jars and when I do the steps you provided I only get 1 jar file. If i look in exploded view on the sample project i can see the jars but cant edit them. I'm trying to get an editable version of the new 1.2.8 sdk to work with because the basis 04 that was posted is very bad and has overflow errors which you can see in 14 bit linear mode near hot items above its max temp. when i use the new flir one sdk this does not happen.

also many bugs are removed i the newer sdk.

I have been laying around with the 04 bundle but now im at a halt because of the faults it has.

i have tried to do each step and i just cant seem to get all this done with the new 1.2.8 sdk.
any help would be appreciated.



Hi sonic,

good work  :-+ :-+

Do you know my posts about the SDK?
You can edit the sdk java files and also switch from cropped to full lepton resolution. Read this thread for more informations...
I think you are the only one, who testing the Flir SDK.
Here you can download a working SDK sample with the extracted java.class (see my post above)
 see path FLIROneSDKBundle\FLIRONEExampleApplication\app\src\main\java\com\flir\flironesdk\usb

have fun
http://www.file-upload.net/download-11040066/FLIROneSDKBundle04-Basis.zip.html

background:
 http://stackoverflow.com/questions/21417419/how-to-convert-aar-to-jar
Quote
Android Studio (version: 1.3.2) allows you to seamlessly access the .jar inside a .aar.
Bonus: it automatically decompiles the classes!
Simply follow these steps:
1. File > New > New Module > Import .JAR/.AAR Package to import you .aar as a module
2. Add the newly created module as a dependency to your main project (not sure if needed)
3. Right click on "classes.jar" as shown in the capture below, and click "Show in explorer". Here is your .jar.

next step:
Android Studio / File / Project Structur
     Modules "app" / Dependencies / + "Module Dependency" and select FlirSDK




SDK without cropped images (full resolution 160x120):

change SDK path for CameraFiles from intern
/data/data/com.flir.flironeexampleapplication/files/CameraFiles
to extern
/sdcard/Android/data/com.flir.flironeexampleapplication/files/CameraFiles

by editing two code lines
Code: [Select]
\FLIROneSDKBundle\FLIRONEExampleApplication\app\src\main\java\com\flir>grep -r -n -A1  getFilesDir *
flironesdk/Device.java:213:        //FrameProcessor.updateCameraFiles(zis, cachedContext.getFilesDir().getAbsolutePath() + File.separator);
flironesdk/Device.java-214-        FrameProcessor.updateCameraFiles(zis, cachedContext.getExternalFilesDir(null).getAbsolutePath() + File.separator);
--
flironesdk/FrameProcessor.java:101:        // String storagePath = context.getFilesDir().getAbsolutePath() + File.separator;
flironesdk/FrameProcessor.java-102-        String storagePath = context.getExternalFilesDir(null).getAbsolutePath() + File.separator;

next step is avoid overwriting your file calib.rsc after starting the apk
edit the function updateCameraFiles() in file FrameProcessor.java
Code: [Select]
static void updateCameraFiles(ZipInputStream zis, String storagePath)
{
    try
    {
        ZipEntry ze;
        while ((ze = zis.getNextEntry()) != null) {
            File f = new File(storagePath + ze.getName());
            if ((!f.exists())||(!ze.getName().endsWith( "calib.rsc")))
            {
                if (ze.isDirectory()) {
                    //File f = new File(storagePath + ze.getName());
                    if (!f.isDirectory()) {
                        f.mkdirs();
                    }
                } else {
                    File parentDir = new File(storagePath + ze.getName()).getParentFile();
                    if (( null != parentDir) &&
                            (!parentDir.isDirectory())) {
                        parentDir.mkdirs();
                    }
                    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(storagePath + ze.getName()));
                    byte[] bytesIn = new byte['?' ];
                    int read;
                    while ((read = zis.read(bytesIn)) != - 1) {
                        bos.write(bytesIn, 0, read);
                    }
                    zis.closeEntry();
                    bos.flush();
                    bos.close();
                }
            }
        }
        zis.close();
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
}
simple delete
/sdcard/Android/data/com.flir.flironeexampleapplication/files/CameraFiles/system/calib.rsc
for getting a fresh version of the file from the FlirOne Flash

now you can edit your calib.rsc (without always overwriting with original file from your F1)

edit your calib.rsc to remove the crop factor by removing the .calib.lensCorr part
the crop factor is inside *.fff files, this files are not bad pixel map files (like Ex):
Code: [Select]
.calib.lensCorr entry
.calib.lensCorr.ds_we_ap_fi_le index
.calib.lensCorr.ds_we_ap_fi_le.enabled bool true
.calib.lensCorr.ds_we_ap_fi_le.fileName text "ds_we_ap_fi_le_LCFMap.fff"
.calib.lensCorr.ds_we_ap_fi_le.rotation double 0.345
.calib.lensCorr.ds_we_ap_fi_le.type int32 100
.calib.lensCorr.ds_we_ap_fi_le.zoom double 7.69
.calib.lensCorr.ds_we_ap_fi_leExFOL2 index
.calib.lensCorr.ds_we_ap_fi_leExFOL2.enabled bool true
.calib.lensCorr.ds_we_ap_fi_leExFOL2.fileName text "ds_we_ap_fi_leExFOL2_LCFMap.fff"
.calib.lensCorr.ds_we_ap_fi_leExFOL2.rotation double 0.345
.calib.lensCorr.ds_we_ap_fi_leExFOL2.type int32 100
.calib.lensCorr.ds_we_ap_fi_leExFOL2.zoom double 7.69

calc a new checksum crc
Code: [Select]
// crc32 sample on bash command line

// count lines
$ wc -l calib.rsc
     646 calib.rsc

//print last line
$ tail -n1 calib.rsc
# CRC32 4683a151

//calc a new crc32 for (n-1) lines
$ crc32 <(head -n 645 calib.rsc)
4683a151
first try this steps with an original file
inside the large E4 thread in this forum you find some more methods for calculating the Flir CRC



a hint: the FlirOne App from Play Store save the original CameraFiles also to the visible path:
/sdcard/Android/data/com.flir.flirone/files/
CameraFiles.zip
CameraFilesSimu.zip

Here you can always get an original (unpatched) CameraFiles.zip.


view my thermal gallery  ;)
https://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg802245/#msg802245
Flir One G2 Lepton 160x120 with hacked config file calib.rsc


 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #302 on: March 01, 2017, 08:51:27 am »
As I wrote earlier, there is no click to run solution for getting working java code from a aar file (binary code).
You must manuell debug the source code fragments and stitch to your project until all works fine.

The link above to stackoverflow is a good entry point.

Test it with differents decompilers, because different decompilers deliver differents results.
Make the best of them.

--------
see also
ApkTook     http://ibotpeaches.github.io/Apktool/
dex2jar       http://sourceforge.net/projects/dex2jar/
decompiler:
   JD-GUI        https://github.com/java-decompiler/jd-gui
   bytecode-viewer  https://github.com/Konloch/bytecode-viewer   
   and don't forget the decompiler in Android Studio  ;)

Offline djcasper

  • Newbie
  • Posts: 4
  • Country: gb
Re: Question about FLIR One for Android
« Reply #303 on: March 07, 2017, 09:38:56 am »
DO NOT USE THIS IF YOUR GOING TO USE GOOGLE PLAY!!!!!

THIS CODE JUT GOT ME IN BIG TROUBLE WITH GOOGLE THEY SUSPENDED IT SAYING IT WAS MALICIOUS I ALREADY HAVE 3 SUSPENSIONS SO NOW I HAVE 4 I DARE NOT EVEN UPDATE MY CURRENT APPS OR EVER UPLOAD A NEW APP AP AGAIN IN CASE ,Y ACCOUNT GETS CLOSED. IT JUST PROVES USING SAMPLES ONLINE IS VERY DANGEROUS AND UNLESS YOU HAVE WRITTEN IT YOUR SELF STAY AWAY.

LIBPNG LIBRARY HAS VULNERABILITIES THAT COME UNDER "MALICIOUS BEHAVIOUR" AND THE USER DATA POLICY ALL VOILATED!!!!

NO HAPPY AT WHAT THE CONTENTS OF THIS SITE HAVE DONE TO MY GOOGLE PLAY DEV ACCOUNT.

THANKS VERY MUCH I REALLY APRECIATE ALL YOUR HELP AND THE FACT THAT ITS ALMOST CLOSED MY GOOGLE ACCOUNT.



I was able to recompile the example app from the sdk

I think you are the only one, who testing the Flir SDK.
Here you can download a working SDK sample with the extracted java.class (see my post above)
 see path FLIROneSDKBundle\FLIRONEExampleApplication\app\src\main\java\com\flir\flironesdk\usb

have fun
http://www.file-upload.net/download-11040066/FLIROneSDKBundle04-Basis.zip.html
 

Offline djcasper

  • Newbie
  • Posts: 4
  • Country: gb
Re: Question about FLIR One for Android
« Reply #304 on: March 07, 2017, 09:42:39 am »
HERES THE SCREENSHOT OF MY EMAIL FROM GOOGLE PLAY.
 

Offline Fraser

  • Super Contributor
  • ***
  • Posts: 13148
  • Country: gb
Re: Question about FLIR One for Android
« Reply #305 on: March 07, 2017, 12:16:49 pm »
Djcasper,

Sorry to hear you are having some issues with others code that you have decided to use in your application.

I do find your post amusing however. Where did you read that all code on this forum developed by others is 'safe' and 'perfect' . A developer should be aware of the risks of using code written by others.

People on this forum have tried to assist you, please do not get annoyed with them if something goes wrong...... it is development after all !

Now to your Google Play problem.........

Have you considered writing to Google and explaining what you have been developing and the fact that there was no malicious intent ? Such may be looked upon favourably and the strike removed. I see that you say you have previous strikes against your account. Maybe you need to determine how to test your developer code before exposing Google Play to it ? Ask Google for advice or go to a Android developer forum To seek such. In my world we operated pre-prop systems to test code before uploading it into a live environment. Maybe such exists for Android ?

Please do not get angry against fellow developers, that can only lead to you being ignored when asking for help in the future.

Time for a deep breath and a carefully crafted email to Google, and then maybe, a less vitriolic post on this forum that is not in capitals ?

There are some very good, friendly and helpful people on this forum. Do not alienate them. They are just trying to offer help and remember, they are doing so in their own time and without reward. Perfect they are not, neither do they deserve to be subjected to angry posts for a possible error that they have made.

Just my thoughts. Feel free to do with them what you will.

Fraser
« Last Edit: March 07, 2017, 12:26:31 pm by Fraser »
If I have helped you please consider a donation : https://gofund.me/c86b0a2c
 
The following users thanked this post: firehopper

Offline djcasper

  • Newbie
  • Posts: 4
  • Country: gb
Re: Question about FLIR One for Android
« Reply #306 on: March 07, 2017, 06:46:18 pm »
Hello,
I get what your saying now i'm a little calmer.
I'm am sorry for the way i reacted. There really is no need.

Because my android programming is limited I try to understand the best i can.
My apps I have made took many days whereas an experienced programmer for android could do it in a hour maybe half.
I was annoyed because there was an older editable version and no matter how im told to do it i don't get it.
I have decompiled the java and tried everything to get the upto date version working so i can actually move on and play around.
I have lots of exp with hacking but unfortunately i reprogramed chips eproms hex codes for modified items that saved people a lot of money over the years but on wont say in public on what. .

I feel when I can get going I have a lot to offer on reverse engineering the flir and theres a few things I want to do when I get this updated 1.2.8 i think it is in an editable manner then I can work on raw data and do some reprogramming on the actual hardware calls. I believe the things i want to do will greatly improve the improvements already done which with the help of this forum I managed to do as said to achieve the bigger images sizes and stop them over writing them. which i am thankful for.
Ive even been willing to pay anybody who will send me a working 1.2.8 version where i can edit all the files from within the .aar file namely the java thats how much I want to get this going.
I love the fact that flir allow apps to be made but I love the fact that you can do so much more when restrictions are removed such as imported java that you cant edit.

Most can do this with ease I cant because Its not something I do ... yet

Anyway my other apps did have issues down to me not backing up older projects and reusing parts of others to update an existing app and leaving the old google add code in. silly little things like ads on an app that links to youtube somewhere and because it has ads on they pretty much made me update however with no help from them to find out what my problems was i would try fid the issue resubmit then end up suspended.

This however they seen as malicious intent due to new regulations on libpng which come in to effect in september or from now on any new updates to existing apps or any new apps.

i assume it was the streaming they didnt like and i removed it however i have no idea where this libpng is so i cant even go ahead and rename  the project and try again incase i get my google account blocked totally.

anyways sorry once again im trying so hard with this spending everyday and getting nowhere at all.




 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #307 on: March 08, 2017, 12:00:31 am »
DO NOT USE THIS IF YOUR GOING TO USE GOOGLE PLAY!!!!!

THIS CODE JUT GOT ME IN BIG TROUBLE WITH GOOGLE
What do you mean exactly with your warn about my raspberry pi code written for a linux system?

https://support.google.com/faqs/answer/7011127?hl=en
Change your Libpng version!

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #308 on: March 08, 2017, 08:55:58 am »
Ah, I see...
(1) For reverse engineering of the Flir one USB protocol I debugged with user cynfab  :-+ :-+ the traffic between the camera and an Android system.
(2) For this purpose I decompiled some Flir java libraries in 2015 (proof of concept).
(3) 16 month later you upload own code with the manipulated Flir SDK (from my code) to the google play store   :palm:
(4) You violate the law, because the terms of licence from the Flir One SDK prohibit the manipulation of the SDK  |O
(5) Be happy, that Google refused your apk, because the outdated Flir SDK from 2015 used an old Libpng version  :-DD


Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #309 on: March 09, 2017, 03:48:39 pm »
Hello! My english is bad (I studied German,But did not learn :) ) . Sorry.  :-[
I buy Flir One Gen 2. I connect Flir One to PC. I read this thema and create my programm for Windows XP. Tomas123, many thanks for the your program!
I use usblib v1.26, but ep 0x83 and ep 0x85 received is error: "libusb0-dll:err [submit_async] submitting request failed, win error: The parameter is incorrect".  |O

Algorithm:

1)  usb_init(); usb_find_busses(); usb_find_devices().
2) Find device. USBDeviceHandle=usb_open(dev).
3) usb_set_configuration(USBDeviceHandle,3).
4) usb_claim_interface(USBDeviceHandle,0); usb_claim_interface(USBDeviceHandle,1); usb_claim_interface(USBDeviceHandle,2).
5) Stop inerface 1 and 2.
    usb_control_msg(USBDeviceHandle,1,0x0b,0,2,data,0,100);   - Why "0"?
    usb_control_msg(USBDeviceHandle,1,0x0b,0,1,data,0,100)    - Why "0"?
6) Start interface 1.
    usb_control_msg(USBDeviceHandle,1,0x0b,1,1,data,0,100)  - Why "0"?
7) Read 0x81: usb_bulk_read(USBDeviceHandle,0x81,Data,SizeOfData,10);
8) Read 0x83: usb_bulk_read(USBDeviceHandle,0x83,Data,SizeOfData,10);
9) Start interface 2.
    usb_control_msg(USBDeviceHandle,1,0x0b,1,2,data,2,200) - Why "2"?
10) Read 0x81: usb_bulk_read(USBDeviceHandle,0x81,Data,SizeOfData,10);
11) Read 0x83: usb_bulk_read(USBDeviceHandle,0x83,Data,SizeOfData,10);
12) Read frame: usb_bulk_read(USBDeviceHandle,0x85,Data,SizeOfData,100);
13) go to  10

In line 11,12 received error (The parameter is incorrect). In line 10 - time out.

Maybe someone knows what the problem is? Thanks.

Programm (russian language in log file and text!).
« Last Edit: March 09, 2017, 03:53:20 pm by da-nie »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #310 on: March 10, 2017, 08:30:41 am »
You are the third user who tries to compile this code with windows (without success).

I think, the best way is to debug my working code with a Linux machine like Raspi (don't try a virtual machine!!).
You can also boot from an Ubuntu Live Media.

Then you can debug all binary packets and compare the usb traffic witth your windows machine.
Maybe that the overlaying usb library under windows not all transfer byte are identical with the linux usb library.

As I wrote the linux code I compared all transfer bytes with the logfile from cynfabs usb sniffer (see top ofv this thread).
And this was very tricky. The F1 is a diva. I guess there are somecritical timings and you need some delays  >:(

here is a sample from my first steps in 2015
Code: [Select]
$ ./flir
Successfully find the Flir One G2 device

libusb_control_transfer(devh, DATA0: 80 06 00 01 00 00 12 00
DATA1:  12 01 00 02 00 00 00 40 cb 09 96 19 08 01 01 02 03 01

libusb_control_transfer(devh, DATA0: 80 06 00 02 00 00 09 00
DATA1:  09 02 60 00 03 03 04 c0 00

libusb_control_transfer(devh, DATA0: 80 06 00 02 00 00 60 00
DATA1:  09 02 60 00 03 03 04 c0 00 09 04 00 00 02 ff f0 00 05 07 05 81 02 00 02 00 07 05 02 02 00 02 01 09 04 01 01 00 ff f0 01 06 09 04 01 00 02 ff f0 01 06 07 05 83 02 00 02 00 07 05 04 02 00 02 01 09 04 02 01 00 ff f0 01 07 09 04 02 00 02 ff f0 01 07 07 05 85 02 00 02 00 07 05 06 02 00 02 01

libusb_get_string_descriptor langid=0x409
String descriptor 2: "FLIR ONE Camera"
String descriptor 1: "FLIR Systems"
String descriptor 3: "FLIRONEF03F8O0FAFFF"
Successfully set usb configuration 3
String descriptor 4: "SBIBDP Configuration"
String descriptor 5: "iAP Interface"
String descriptor 6: "com.flir.rosebud.fileio"
String descriptor 7: "com.flir.rosebud.frame"
Successfully claimed interface 0,1,2
stop interface 2 FRAME
stop interface 1 FILEIO

start interface 1 FILEIO

: Mon Dec  7 09:55:58 2015

Mon Dec  7 09:55:58 2015
 >>>>>>>>>>>>>>>>>bulk transfer (in) 0x81: LIBUSB_ERROR_TIMEOUT

Mon Dec  7 09:55:59 2015
 >>>>>>>>>>>>>>>>>bulk transfer (in) 0x83: LIBUSB_ERROR_OTHER

Mon Dec  7 09:56:00 2015
 >>>>>>>>>>>>>>>>>bulk transfer (in) 0x85: LIBUSB_ERROR_IO

: Mon Dec  7 09:56:01 2015
 bulk read EP 0x81, actual length 535
HEX:
 cc 01 00 00 01 00 00 00 07 02 00 00 77 60 0c bd 7b 22 74 79 70 65 22 3a 22 73 6c 65 64 49 6e 66 6f 72 6d 61 74 69 6f 6e 22 2c 22 64 61 74 61 22 3a 7b 22 73 65 72 69 61 6c 4e 75 6d 62 65 72 42 6f 61 72 64 22 3a 22 46 30 33 46 38 4f 30 30 41 46 46 22 2c 22 70 61 72 74 4e 75 6d 62 65 72 42 6f 61 72 64 22 3a 22 32 31 32 30 30 31 36 30 32 30 31 22 2c 22 76 65 72 73 69 6f 6e 42 6f 61 72 64 22 3a 22 44 22 2c 22 73 65 72 69 61 6c 4e 75 6d 62 65 72 4c 65 70 74 6f 6e 22 3a 22 33 37 31 38 37 31 22 2c 22 76 65 72 73 69 6f 6e 4c 65 70 74 6f 6e 22 3a 22 33 2e 31 2e 34 36 22 2c 22 6c 65 70 74 6f 6e 51 52 22 3a 22 41 30 33 37 31 38 37 31 22 2c 22 76 65 72 73 69 6f 6e 52 6f 73 65 62 75 64 46 61 63 74 6f 72 79 45 53 57 22 3a 22 30 2e 34 2e 32 37 22 2c 22 76 65 72 73 69 6f 6e 52 6f 73 65 62 75 64 4f 70 65 72 61 74 69 6f 6e 61 6c 45 53 57 22 3a 22 30 2e 34 2e 32 37 22 2c 22 76 65 72 73 69 6f 6e 52 6f 73 65 62 75 64 55 70 64 61 74 65 72 45 53 57 22 3a 22 30 2e 34 2e 32 37 22 2c 22 76 65 72 73 69 6f 6e 52 6f 73 65 62 75 64 41 50 49 22 3a 22 6d 61 73 74 65 72 2e 30 31 35 65 64 65 34 22 2c 22 67 69 74 52 65 76 69 73 69 6f 6e 22 3a 22 6d 61 73 74 65 72 2e 30 31 35 65 64 65 34 22 2c 22 61 75 74 6f 6d 61 74 69 63 53 68 75 74 74 65 72 22 3a 22 59 22 2c 22 66 6f 72 6d 46 61 63 74 6f 72 22 3a 22 64 6f 6e 67 6c 65 22 2c 22 74 68 65 72 6d 61 6c 48 65 69 67 68 74 22 3a 22 31 32 30 22 2c 22 74 68 65 72 6d 61 6c 57 69 64 74 68 22 3a 22 31 36 30 22 2c 22 62 69 67 45 6e 64 69 61 6e 54 68 65 72 6d 61 6c 22 3a 22 30 22 2c 22 6f 70 65 72 61 74 69 6e 67 4d 6f 64 65 22 3a 22 6f 70 65 72 61 74 69 6f 6e 61 6c 22 7d 7d 00
STRING:
?w`?{"type":"sledInformation","data":{"serialNumberBoard":"F03F8O0FAFF","partNumberBoard":"21200161301","versionBoard":"D","serialNumberLepton":"371871","versionLepton":"3.1.46","leptonQR":"A0371871","versionRosebudFactoryESW":"0.4.27","versionRosebudOperationalESW":"0.4.27","versionRosebudUpdaterESW":"0.4.27","versionRosebudAPI":"master.015ede4","gitRevision":"master.015ede4","automaticShutter":"Y","formFactor":"dongle","thermalHeight":"120","thermalWidth":"160","bigEndianThermal":"0","operatingMode":"operational"}}

Mon Dec  7 09:56:01 2015
 >>>>>>>>>>>>>>>>>bulk transfer (in) 0x85: LIBUSB_ERROR_PIPE

: Mon Dec  7 09:56:02 2015
 bulk read EP 0x81, actual length 282
HEX:
 cc 01 00 00 01 00 00 00 54 00 00 00 55 14 30 67 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 56 6f 6c 74 61 67 65 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 76 6f 6c 74 61 67 65 22 3a 33 2e 36 39 30 30 30 30 30 35 37 32 32 30 34 36 2c 22 70 65 72 63 65 6e 74 61 67 65 22 3a 31 31 7d 7d 00 cc 01 00 00 01 00 00 00 45 00 00 00 af 24 95 8f 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 43 68 61 72 67 69 6e 67 43 75 72 72 65 6e 74 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 63 68 61 72 67 69 6e 67 43 75 72 72 65 6e 74 22 3a 30 7d 7d 00 cc 01 00 00 01 00 00 00 51 00 00 00 67 e4 ee 50 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 43 68 61 72 67 69 6e 67 53 74 61 74 65 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 63 68 61 72 67 69 6e 67 53 74 61 74 65 22 3a 22 73 74 61 74 65 4e 6f 43 68 61 72 67 69 6e 67 22 7d 7d 00
STRING:
?TU0g{"type":"batteryVoltageUpdate","data":{"voltage":3.69000005722046,"percentage":11}}?E?$??{"type":"batteryChargingCurrentUpdate","data":{"chargingCurrent":0}}?Qg??P{"type":"batteryChargingStateUpdate","data":{"chargingState":"stateNoCharging"}}

ask for CameraFiles.zip on EP 0x83:

: Mon Dec  7 09:56:02 2015

To be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 41 00 00 00 f8 b3 f7 00 ]

Write successful!
To be sent: {"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
Write successful!
Sent 65 bytes with string: {"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}

To be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 33 00 00 00 ef db c1 c1 ]

Write successful!
To be sent 51 Bytes: {"type":"readFile","data":{"streamIdentifier":10}}
Write successful!
Sent 51 bytes with string: {"type":"readFile","data":{"streamIdentifier":10}}

: Mon Dec  7 09:56:02 2015

: Mon Dec  7 09:56:02 2015
 bulk read EP 0x81, actual length 16
HEX:
 cc 01 00 00 01 00 00 00 5d 00 00 00 df 5b 38 1a
STRING:
?]?[8

: Mon Dec  7 09:56:02 2015
 bulk read EP 0x81, actual length 93
HEX:
 7b 22 74 79 70 65 22 3a 22 6f 70 65 6e 46 69 6c 65 53 74 61 74 75 73 22 2c 22 64 61 74 61 22 3a 7b 22 70 61 74 68 22 3a 22 43 61 6d 65 72 61 46 69 6c 65 73 2e 7a 69 70 22 2c 22 73 74 72 65 61 6d 49 64 65 6e 74 69 66 69 65 72 22 3a 31 31 2c 22 6d 6f 64 65 22 3a 22 72 22 7d 7d 00
STRING:
{"type":"openFileStatus","data":{"path":"CameraFiles.zip","streamIdentifier":11,"mode":"r"}}

: Mon Dec  7 09:56:04 2015

: Mon Dec  7 09:56:06 2015
 bulk read EP 0x81, actual length 99
HEX:
 cc 01 00 00 01 00 00 00 53 00 00 00 ec 2c e7 fa 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 56 6f 6c 74 61 67 65 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 76 6f 6c 74 61 67 65 22 3a 33 2e 36 38 30 30 30 30 30 36 36 37 35 37 32 2c 22 70 65 72 63 65 6e 74 61 67 65 22 3a 31 31 7d 7d 00
STRING:
?S?,??{"type":"batteryVoltageUpdate","data":{"voltage":3.6800000667572,"percentage":11}}

: Mon Dec  7 09:56:08 2015
 bulk read EP 0x81, actual length 100
HEX:
 cc 01 00 00 01 00 00 00 54 00 00 00 55 14 30 67 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 56 6f 6c 74 61 67 65 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 76 6f 6c 74 61 67 65 22 3a 33 2e 36 39 30 30 30 30 30 35 37 32 32 30 34 36 2c 22 70 65 72 63 65 6e 74 61 67 65 22 3a 31 31 7d 7d 00
STRING:
?TU0g{"type":"batteryVoltageUpdate","data":{"voltage":3.69000005722046,"percentage":11}}

: Mon Dec  7 09:56:12 2015
 bulk read EP 0x81, actual length 99
HEX:
 cc 01 00 00 01 00 00 00 53 00 00 00 ec 2c e7 fa 7b 22 74 79 70 65 22 3a 22 62 61 74 74 65 72 79 56 6f 6c 74 61 67 65 55 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 76 6f 6c 74 61 67 65 22 3a 33 2e 36 38 30 30 30 30 30 36 36 37 35 37 32 2c 22 70 65 72 63 65 6e 74 61 67 65 22 3a 31 31 7d 7d 00
STRING:
?S?,??{"type":"batteryVoltageUpdate","data":{"voltage":3.6800000667572,"percentage":11}}

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #311 on: March 10, 2017, 02:45:01 pm »
Thank you! Now it is clear that the problem is with Windows. With the program for Linux, I'm not very interested. :) I'm sure that the program for Linux will work. I'll try all the same so far to launch under Windows.
 

Offline G0MJW

  • Regular Contributor
  • *
  • Posts: 51
  • Country: gb
  • Mike
    • G0MJW
Re: Question about FLIR One for Android
« Reply #312 on: March 10, 2017, 07:12:07 pm »
Don't linux and Windows use opposite byte order - bigendian vs littleendian? Maybe this has some impact.
Mike
 

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #313 on: March 10, 2017, 07:19:12 pm »
For Linux Mageia 5 the program is working. :) Data is accepted.

Bigendian and littleendian in USB protocol? Unlikely. The standard must accurately determine the order of the bytes.
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #314 on: March 10, 2017, 10:48:26 pm »
For Linux Mageia 5 the program is working. :) Data is accepted.

Great.
Now you can translate step-by-step all "steps" to windows code.
Please tell us your progress.

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #315 on: March 11, 2017, 05:29:48 am »
In Windows, the functions in the libusb have a different format and other names.
For example:

long received=usb_bulk_read(USBDeviceHandle,0x81,Data,SizeOfData,10); - in Windows libusb.

long ret=libusb_bulk_transfer(devh, 2, my_string1, length, &transferred, 0); - in Linux libusb.

The function "usb_bulk_read" in Windows for endpoints 0x85 and 0x83 is also executed with an error: "libusb0-dll:err [submit_async] submitting request failed, win error: The parameter is incorrect". The reason I do not understand. This endpoints is isochronous. Maybe there is an error in windows libusb.

The result was a picture in linux and programm:
« Last Edit: March 11, 2017, 06:44:15 pm by da-nie »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #316 on: March 13, 2017, 09:01:34 am »
When I wrote the Linux F1 driver/code I rechecked all USB packages with the great doc "USB in a NutShell"
a sample http://www.beyondlogic.org/usbnutshell/usb5.shtml#StringDescriptors

My two cents:
I would install a Windows USB protocol sniffer and compare all transfered package bytes with the Linux version.
Then you fast find the difference  ;)

cynfabs usb sniffer was a great help.
excerpt from my notes:
Code: [Select]
>grep -A4  bmRequestType f6c*

SETUP: 0.0
0 bmRequestType = 80     
1 bRequest = 06                          GET_DESCRIPTOR
2 wValue 0100 type (H) index (L)
4 wIndex 00
5 wLength 00
->DATA0: 80 06 00 01 00 00 40 00 dd 94
<-DATA1: 12 01 00 02 00 00 00 40 cb 09 96 19 08 01 01 02 03 01 ef bc
Device Descriptor result
Offset Field Value
0 bLength = 12
1 bDescriptorType = 01
2 bcdUSB = 0002
4 bDeviceClass = 00
5 bDeviceSubClass = 00
6 bDeviceProtocol = 00
7 bMaxPacketSize0 = 40
8 idVendor = cb09
10 idProduct = 9619
12 bcdDevice = 0801
14 iManufacturer = 01
15 iProduct = 01
16 iSerialNumber = 0203
17 bNumConfigurations = 01

--
SETUP: 0.0
0 bmRequestType = 00
1 bRequest = 05                          SET_ADDRESS
2 wValue 004c  0x4c = 76
4 wIndex 00
5 wLength 00
DATA0: 00 05 4c 00 00 00 00 00 e4 f8

--
SETUP: 76.0
0 bmRequestType = 80
1 bRequest = 06                          GET_DESCRIPTOR
2 wValue 0100 type (H) index (L)
4 wIndex 00
5 wLength 00
-> DATA0: 80 06 00 01 00 00 12 00 e0 f4
<- DATA1: 12 01 00 02 00 00 00 40 cb 09 96 19 08 01 01 02 03 01 ef bc
Device Descriptor result
Offset Field Value
0 bLength = 12
1 bDescriptorType = 01
2 bcdUSB = 0002
4 bDeviceClass = 00
5 bDeviceSubClass = 00
6 bDeviceProtocol = 00
7 bMaxPacketSize0 = 40
8 idVendor = cb09
10 idProduct = 9619
12 bcdDevice = 0801
14 iManufacturer = 01
15 iProduct = 01
16 iSerialNumber = 0203
17 bNumConfigurations = 01

--
0 bmRequestType = 80
1 bRequest = 06                          GET_DESCRIPTOR
2 wValue 0002 type (H) index (L)
4 wIndex 00
5 wLength 00
-> DATA0: 80 06 00 02 00 00 09 00 ae 04
<- DATA1: 09 02 60 00 03 03 04 c0 00 2b 05

--
0 bmRequestType = 80
1 bRequest = 06                          GET_DESCRIPTOR
2 wValue 0002 type (H) index (L)
4 wIndex 00
5 wLength 00
-> DATA0: 80 06 00 02 00 00 60 00 80 54
<- DATA1: 09 02 60 00 03 03 04 c0 00 09 04 00 00 02 ff f0 00 05 07 05 81 02 00 02 00 07 05 02 02 00 02 01 09 04 01 01 00 ff f0 01 06 09 04 01 00 02 ff f0 01 06 07 05 83 02 00 02 00 07 05 04 02 00 02 01 ca ae
<-DATA0: 09 04 02 01 00 ff f0 01 07 09 04 02 00 02 ff f0 01 07 07 05 85 02 00 02 00 07 05 06 02 00 02 01 a7 0d

   DATA1: 09 02 60 00 03 03 04 c0 00 09 04 00 00 02 ff f0 00 05 07 05 81 02 00 02 00 07 05 02 02 00 02 01 09 04 01 01 00 ff f0 01 06 09 04 01 00 02 ff f0 01 06 07 05 83 02 00 02 00 07 05 04 02 00 02 01 09 04 02 01 00 ff f0 01 07 09 04 02 00 02 ff f0 01 07 07 05 85 02 00 02 00 07 05 06 02 00 02 01

--
0 bmRequestType = 80
1 bRequest = 06                          GET_DESCRIPTOR
2 wValue 0300 type (H) index (L)          type: String Descriptor (0x03)  // http://www.beyondlogic.org/usbnutshell/usb5.shtml#StringDescriptors
4 wIndex 00
5 wLength 00
DATA0: 80 06 00 03 00 00 ff 00 d4 64
-> String Descriptor result
     Offset Field Value
     0 bLength = 04
     1 bDescriptorType = 03
     2 bString 0409

 
--
0 bmRequestType = 80
1 bRequest = 06                     GET_DESCRIPTOR
2 wValue 0302 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 02 03 09 04 ff 00 97 db
-> String Descriptor result (FLIR ONE Camera)


--
0 bmRequestType = 80
1 bRequest = 06                     GET_DESCRIPTOR
2 wValue 0301 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 01 03 09 04 ff 00 97 e8
-> String Descriptor result (FLIR SYSTEMS)

--
0 bmRequestType = 80
1 bRequest = 06                     GET_DESCRIPTOR
2 wValue 0303 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 03 03 09 04 ff 00 96 0a
-> String Descriptor result (FLIRONEF03F6200xxxx)

--
0 bmRequestType = 00
1 bRequest = 09                     SET_CONFIGURATION     03
2 wValue 0003 type (H) index (L)
4 wIndex 00
5 wLength 00
DATA0: 00 09 03 00 00 00 00 00 26 c7

--
0 bmRequestType = 80
1 bRequest = 06                    GET_DESCRIPTOR
 2 wValue 0304 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 04 03 09 04 ff 00 97 bd
-> String Descriptor result (SBI BDP Configuration)

--
0 bmRequestType = 80
1 bRequest = 06                    GET_DESCRIPTOR
 2 wValue 0305 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 05 03 09 04 ff 00 96 6c
-> String Descriptor result (iAP Interface)

--
0 bmRequestType = 80
1 bRequest = 06                    GET_DESCRIPTOR
 2 wValue 0306 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 06 03 09 04 ff 00 96 5f
-> String Descriptor result (com.flir.rosebud.fileio)

--
0 bmRequestType = 80
1 bRequest = 06                    GET_DESCRIPTOR
 2 wValue 0307 type (H) index (L)
4 wIndex 09
5 wLength 04
DATA0: 80 06 07 03 09 04 ff 00 97 8e
-> String Descriptor result (com.flir.rosebud.frame)

--
0 bmRequestType = 01
1 bRequest = 0b                     SET_INTERFACE
2 wValue 0000 type (H) index (L)          Alternate Setting 0
4 wIndex 02                                              Interface 2
5 wLength 00
DATA0: 01 0b 00 00 02 00 00 00 c5 40

--
0 bmRequestType = 01
1 bRequest = 0b                    SET_INTERFACE
 2 wValue 0000 type (H) index (L)          Alternate Setting 0
4 wIndex 01                                          Interface 1
5 wLength 00
DATA0: 01 0b 00 00 01 00 00 00 c5 04

--
0 bmRequestType = 01
1 bRequest = 0b                     SET_INTERFACE
 2 wValue 0001 type (H) index (L)           Alternate Setting 1
4 wIndex 01                                    Interface 1
5 wLength 00     
DATA0: 01 0b 01 00 01 00 00 00 c4 d5

--

[        ]   3.045669 d=  0.000001 [  4.1 + 96.633] [  3] IN   : 78.1
[        ]   3.045669 d=  0.000001 [  4.1 + 97.150] [515] DATA0: cc 01 00 00 01 00 00 00 07 02 00 00 77 60 0c bd 7b 22 74 79 70 65 22 3a 22 73 6c 65 64 ......
{"type":"sledInformation","data":{"serialNumberBoard":"F03F6200571","partNumberBoard":"21200160201","versionBoard":"C","serialNumberLepton":"355692","versionLepton":"3.1.45","leptonQR":"A0355692","versionRosebudFactoryESW":"0.4.25","versionRosebudOperationalESW":"0.4.26","versionRosebudUpdaterESW":"0.4.26","versionRosebudAPI":"master.26498f5","gitRevision":"master.26498f5","automaticShutter":"Y","formFactor":"dongle","thermalHeight":"120","thermalWidth":"160","bigEndianThermal":"0","operatinw

[        ]   3.045741 d=  0.000001 [  4.2 + 44.367] [  3] IN   : 78.1
[        ]   3.045742 d=  0.000001 [  4.2 + 44.883] [ 26] DATA1: 67 4d 6f 64 65 22 3a 22 6f 70 65 72 61 74 69 6f 6e 61 6c 22 7d 7d 00 63 74
gMode":"operational"}}

[        ]   3.152582 d=  0.000000 [111.1 +  1.867] [  3] OUT  : 78.2
[        ]   3.152583 d=  0.000000 [111.1 +  2.267] [ 19] DATA0: cc 01 00 00 01 00 00 00 41 00 00 00 f8 b3 f7 00 6b d2

[        ]   3.153468 d=  0.000001 [112.0 + 12.600] [  3] OUT  : 78.2
[        ]   3.153468 d=  0.000000 [112.0 + 13.000] [ 68] DATA1: 7b 22 74 79 70 65 22 3a 22 6f 70 65 6e 46 69 6c 65 22 2c 22 64 61 74 61 22 3a 7b 22 6d 6f 64 65 22 3a 22 72 22 2c 22 70 61 74 68 22 3a 22 43 61 6d 65 72 61 46 69 6c 65 73 2e 7a 69 70 22 7d 7d 00 9c 80
{"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
 

[        ]   3.159050 d=  0.000001 [117.4 + 94.250] [  3] OUT  : 78.2
[        ]   3.159051 d=  0.000000 [117.4 + 94.650] [ 19] DATA0: cc 01 00 00 01 00 00 00 33 00 00 00 ef db c1 c1 bf 77


[        ]   3.159582 d=  0.000018 [118.1 +  0.933] [  3] OUT  : 78.2
[        ]   3.159582 d=  0.000000 [118.1 +  1.333] [ 54] DATA1: 7b 22 74 79 70 65 22 3a 22 72 65 61 64 46 69 6c 65 22 2c 22 64 61 74 61 22 3a 7b 22 73 74 72 65 61 6d 49 64 65 6e 74 69 66 69 65 72 22 3a 31 30 7d 7d 00 a1 23
{"type":"readFile","data":{"streamIdentifier":10}}
 
[        ]   3.162183 d=  0.000001 [120.5 +102.317] [  3] IN   : 78.3
[        ]   3.162184 d=  0.000001 [120.5 +102.833] [ 27] DATA0: 10 55 00 00 01 00 00 00 b7 1a 00 00 0a 00 00 00 00 99 9d 5d 2c 91 a3 df 5e 15

[        ]   3.166051 d=  0.000001 [124.4 + 94.367] [  3] IN   : 78.3
[        ]   3.166051 d=  0.000001 [124.4 + 94.883] [515] DATA1: 50 4b 03 04 14 00 08 08 08 00 77 7b 15 47 00.....
PK zip Datei

[        ]   3.166095 d=  0.000001 [124.5 + 13.167] [  3] IN   : 78.3
[        ]   3.166095 d=  0.000001 [124.5 + 13.683] [515] DATA0: 9b e6 28 68 48 b6 71 d0 9a b1 8d 84 ......
usw
----

[        ]   3.171615 d=  0.000001 [130.1 + 33.617] [  3] OUT  : 78.2
[        ]   3.171616 d=  0.000000 [130.1 + 34.017] [ 19] DATA0: cc 01 00 00 01 00 00 00 33 00 00 00 ef db c1 c1 bf 77

[        ]   3.172186 d=  0.000001 [130.5 +103.600] [  3] OUT  : 78.2
[        ]   3.172186 d=  0.000000 [130.5 +104.000] [ 54] DATA1: 7b 22 74 79 70 65 22 3a 22 72 65 61 64 46 69 6c 65 22 2c 22 64 61 74 61 22 3a 7b 22 73 74 72 65 61 6d 49 64 65 6e 74 69 66 69 65 72 22 3a 31 30 7d 7d 00 a1 23
{"type":"readFile","data":{"streamIdentifier":10}}


[        ]   3.172642 d=  0.000000 [131.1 + 60.300] [  3] IN   : 78.3
[        ]   3.172643 d=  0.000001 [131.1 + 60.833] [ 27] DATA1: 10 55 00 00 01 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 69 e7 7b b0 e5 eb

SDK App sendet keine 2. Anfrage, Rückmeldung ggf für empty

--
0 bmRequestType = 01
1 bRequest = 0b                              SET_INTERFACE
 2 wValue 0001 type (H) index (L)           Alternate Setting 1
4 wIndex 02                                              Interface 2
5 wLength 00

--

[        ]   3.232393 d=  0.000001 [190.7 + 56.067] [  3] OUT  : 78.2
[        ]   3.232393 d=  0.000000 [190.7 + 56.467] [ 65] DATA1: 7b 22 74 79 70 65 22 3a 22 73 65 74 4f 70 74 69 6f 6e 22 2c 22 64 61 74 61 22 3a 7b 22 6f 70 74 69 6f 6e 22 3a 22 61 75 74 6f 46 46 43 22 2c 22 76 61 6c 75 65 22 3a 74 72 75 65 7d 7d 00 3e 5b
{"type":"setOption","data":{"option":"autoFFC","value":true}}0x00

[        ]   3.233349 d=  0.000001 [191.7 + 12.633] [  3] IN   : 78.1
[        ]   3.233350 d=  0.000001 [191.7 + 13.150] [ 85] DATA0: cc 01 00 00 01 00 00 00 42 00 00 00 16 1c 42 12 7b 22 74 79 70 65 22 3a 22 73 65 74 4f 70 74 69 6f 6e 53 74 61 74 75 73 22 2c 22 64 61 74 61 22 3a 7b 22 6f 70 74 69 6f 6e 22 3a 22 61 75 74 6f 46 46 43 22 2c 22 76 61 6c 75 65 22 3a 2d 31 7d 7d 00 89 bd
{"type":"setOptionStatus","data":{"option":"autoFFC","value":-1}}


// anderer Mitschnitt


[        ]  20.832630 d=  0.000018 [231.5 +  0.933] [  3] OUT  : 89.2
[        ]  20.832630 d=  0.000000 [231.5 +  1.333] [ 65] DATA1: 7b 22 74 79 70 65 22 3a 22 73 65 74 4f 70 74 69 6f 6e 22 2c 22 64 61 74 61 22 3a 7b 22 6f 70 74 69 6f 6e 22 3a 22 61 75 74 6f 46 46 43 22 2c 22 76 61 6c 75 65 22 3a 74 72 75 65 7d 7d 00 3e 5b
{"type":"setOption","data":{"option":"autoFFC","value":true}}


[        ]  21.627581 d=  0.000001 [  2.4 + 14.133] [  3] IN   : 89.1
[        ]  21.627582 d=  0.000001 [  2.4 + 14.650] [ 87] DATA1: cc 01 00 00 01 00 00 00 44 00 00 00 ca 43 29 37 7b 22 74 79 70 65 22 3a 22 73 65 74 4f 70 74 69 6f 6e 53 74 61 74 75 73 22 2c 22 64 61 74 61 22 3a 7b 22 6f 70 74 69 6f 6e 22 3a 22 61 75 74 6f 46 46 43 22 2c 22 76 61 6c 75 65 22 3a 74 72 75 65 7d 7d 00 ab 6b
{"type":"setOptionStatus","data":{"option":"autoFFC","value":true}}


[        ]  21.637696 d=  0.000001 [ 12.5 +  2.967] [  3] IN   : 89.5
[        ]  21.637697 d=  0.000000 [ 12.5 +  3.467] [515] DATA0: ef be 00 00 01 00 00 00 19 25 02 00 ac 9b 00 00 c8 88 01 00 a5 00 00 00 16 bb 99 10 00 50 7e 7c 9f 09 98 09 b7 09 c8 09 c6 09 c5 09 d4 09 d6 09 de 09 ee 09 ee 09 ff 09 02 0a 09 0a 1b 0a 0a 0a 1f 0a 29 0a 22 0a 29 0a 29 0a 33 0a 2b 0a 39 0a 2f 0a 40 0a 37 0a 40 0a 53 0a 48 0a 47 0a 49 0a 57 0a 53 0a 55 0a 5c 0a 57 0a 5c 0a 5e 0a 6e 0a 6a 0a 6d 0a 67 0a 71 0a 73 0a 67 0a 6f 0a 6d 0a 76 0a 72 0a 6c 0a 77 0a 76 0a 7c 0a 77 0a 77 0a 7a 0a 76 0a 77 0a 7e 0a 82 0a 7e 0a 8d 0a 88 0a 8d 0a 8e 0a 85 0a 7c 0a 8f 0a 8f 0a 8b 0a 82 0a 85 0a 8c 0a 8d 0a 93 0a 8c 0a 7c 0a 8e 0a 91 0a 01 00 a6 66 94 0a 8b 0a 8e 0a 95 0a 8c 0a 93 0a 8b 0a 9a 0a 91 0a 8c 0a 89 0a 8f 0a 8b 0a 8e 0a 99 0a 8b 0a 8b 0a 8a 0a 84 0a 90 0a 82 0a 8b 0a 82 0a 83 0a 83 0a 81 0a 85 0a 75 0a 80 0a 76 0a 73 0a 83 0a 74 0a 81 0a 7d 0a 72 0a 6a 0a 65 0a 75 0a 6c 0a 63 0a 71 0a 67 0a 61 0a 65 0a 5f 0a 61 0a 60 0a 5d 0a 55 0a 55 0a 56 0a 48 0a 46 0a 3f 0a 36 0a 41 0a 42 0a 27 0a 2d 0a 22 0a 2c 0a 31 0a 25 0a 1c 0a 27 0a 18 0a 1c 0a 1a 0a 17 0a 14 0a 06 0a fc 09 f8 09 0b 0a f2 09 eb 09 e7 09 dc 09 d6 09 02 00 f8 6c b2 09 c1 09 cc 09 d0 09 cd 09 da 09 e3 09 f2 09 f1 09 03 0a 04 0a 0b 0a 09 0a 17 0a 23 0a 1a 0a 30 0a 38 0a 37 0a 38 0a 35 0a 43 0a 39 0a 43 0a 41 0a 4b 0a 4c 0a 46 0a 50 0a 4c 0a 56 0a 57 0a 59 0a 6c 0a 6f 0a 5d 0a 6b 0a 66 0a 6a 0a 71 0a 71 0a 77 0a 7d 0a 7f 0a 77 0a 7b 0a 7b 0a 79 0a 82 0a 86 0a 80 0a 7a 0a 7d 0a 88 0a 7e 0a 7f 0a 84 0a 86 0a 89 0a 84 0a 8c 0a 87 0a 87 0a 96 0a 96 0a 95 0a 8c 0a 99 0a 8a 0a 9b 0a 8f 0a 8c 0a 96 0a 92 0a 88 0a 9f 0a 8e a2
RAW Daten
It goes on and on and on from here.


Maybe there is an error in windows libusb.
I believe not.
You must exact generate the same byte sequence with the same length.

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #317 on: March 14, 2017, 05:23:14 pm »
Hm. In Mageia 5 and Raspbian this programm is work.
But in XUbuntu 16.10 this programm works poorly. Often occurs LIBUB_ERROR_PIPE! Hm...


 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #318 on: March 14, 2017, 08:06:46 pm »
I know:
happy our, on my Raspberry Pi the code also runs fine
I worked the last two weeks at wrong computers  |O


Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #319 on: March 17, 2017, 09:45:27 am »
I'm creating a program for QNX 6.3. The frame is collected in 20 seconds - all other frames are lost. Io-usb does not have time to receive all the data. In addition, Io-usb often ends abnormally. But all the same the program works with the device not with libusb, but with using USBD.

Also, CRC is used for the string.

Updated!  :-DD I changed timeout in usbd_io in 0. FPS - 2-3 image per sec!!! :) Programm updated.

Programm for QNX 6.3 SP 3.

« Last Edit: March 17, 2017, 11:49:10 am by da-nie »
 

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #320 on: March 20, 2017, 05:24:45 pm »
New version for QNX 6.3! :)

 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #321 on: March 21, 2017, 10:56:14 am »
Great  :-+

You asked two weeks ago for a Windows XP program.
And now I write code for QNX.
What is your target device?

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #322 on: March 21, 2017, 05:03:11 pm »
Target device - PC. :)
 ::) I use QNX 6.3 at work.  8)  For Windows the program does not work. Therefore, I tried writing a USB driver for QNX. In parallel, I'm writing on Qt4 a program for Linux. I have decided not to use Windows yet.

It is interesting how RAW14 is recalculated in temperature. In the datasheet, I did not find it...

 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #323 on: March 21, 2017, 11:16:01 pm »
There are some Flir documents about this.
The raw value is linear to radiance.
Therefore we only need Plancks Law.
see my footer for further informations.

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #324 on: March 22, 2017, 04:23:23 pm »
It is interesting how RAW14 is recalculated in temperature. In the datasheet, I did not find it...

A good source is the FLIR GEV Demo Source Code:
http://80.77.70.144/SwDownload/app/RssSWDownload.aspx?ID=143

PvSimpleUISampleDlg.cpp
the calibration values and air constants:
Code: [Select]
       // Get current measurement parameters
        PvGenFloat *lR = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "R" ) );
        PvGenFloat *lB = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "B" ) );
        PvGenFloat *lF = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "F" ) );
        // Get gain (J1) and offset (J0)
        PvGenInteger *lJ0 = dynamic_cast<PvGenInteger *>( lGenDevice->Get( "J0" ) );
        PvGenFloat *lJ1 = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "J1" ) );
        // Get spectral response
        PvGenFloat *lX = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "X" ) );
        PvGenFloat *la1 = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "alpha1" ) );
        PvGenFloat *la2 = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "alpha2" ) );
        PvGenFloat *lb1 = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "beta1" ) );
        PvGenFloat *lb2 = dynamic_cast<PvGenFloat *>( lGenDevice->Get( "beta2" ) );

and the temperature calculation
Code: [Select]
CTemperature PvSimpleUISampleDlg::imgToTemp(long lPixval)
{
    double tmp;
    CTemperature K;

    tmp = imgToPow(lPixval);
    //tmp = clipPow(tmp,pValState);
    tmp = powToObjSig(tmp);
    K = objSigToTemp(tmp);

    return (K);
}

see my excel sheet  RAW2Temp.xls  for details:
https://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/?action=dlattach;attach=168737

the excel sheet and the "FLIR GEV Demo" only use the formulas from this two Flir documents:
only Plancks Law: https://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/?action=dlattach;attach=83952
with air influence:  https://www.eevblog.com/forum/thermal-imaging/flir-e4-thermal-imaging-camera-teardown/?action=dlattach;attach=83950

 8)


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf