I was able to recompile the example app from the sdk
Attached is a annotated dump of the first few seconds of usb activity between a F1G2 and the F1 Android app.
>awk "{for(i=1; i <=NF; i=i+1) {tmp=sprintf (\"%s \",\"0x\"$(i)); printf \"%c\", strtonum(tmp) }}" F6c.txt > strings.txt
>strings -n 7 strings.txt
Sysinternals - [url=http://www.sysinternals.com]www.sysinternals.com[/url]
FLIR ONE Camera
FLIR Systems
FLIRONEF0XXX200
SBIBDP Configuration
iAP Interface
com.flir.rosebud.fileio
com.flir.rosebud.frame
{"type":"sledInformation","data":{"serialNumberBoard":"F03XXX00571","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","operatinwp
gMode":"operational"}}
{"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
{"type":"readFile","data":{"streamIdentifier":10}}
/CameraFiles/system/calib.rsc
/CameraFiles/system/maps/ds_we_ap_fi_le_LCFMap.fff
/CameraFiles/system/maps/ds_we_ap_fi_leExFOL2_LCFMap.fff
/CameraFiles/system/calib.rscPK
/CameraFiles/system/maps/ds_we_ap_fi_le_LCFMap.fffPK
/CameraFiles/system/maps/ds_we_ap_fi_leExFOL2_LCFMap.fffPK
{"type":"readFile","data":{"streamIdentifier":10}}
{"type":"setOption","data":{"option":"autoFFC","value":true}}
{"type":"setOptionStatus","data":{"option":"autoFFC","value":-1}}
FLIROneSDKBundle\FLIRONEExampleApplication\app\src\main\java\com\flir\flironesdk\usb\UsbCommunicator.java
...
for ( int e = 0 ; e < endpointCount; e++)
{
UsbEndpoint ep = iface.getEndpoint(e);
if (ep.getDirection() == 128) { // read
switch (ep.getEndpointNumber())
{
case 5: // FRAME_READ_ENDPOINT_ID
this.frameReadRequest .initialize(this. connection, ep);
break;
case 1:
this.configReadRequest .initialize(this. connection, ep);
break;
case 3:
this.fileioReadRequest .initialize(this. connection, ep); // final UsbRequest fileioReadRequest = new UsbRequest();
break;
case 2:
case 4:
default:
Log. w("UsbCommunicator", "Unknown USB_DIR_IN Endpoint on device!");break;
}
} else { // write
switch (ep.getEndpointNumber())
{
case 2:
this.configWriteEndpoint = ep;
break;
case 4:
this.fileioWriteEndpoint = ep;
break;
default:
Log. w("UsbCommunicator", "Unknown USB_DIR_OUT Endpoint on device!");
}
}
Call to address 78 endpoint 1:
[ ] 3.233349 d= 0.000001 [191.7 + 12.633] [ 3] IN : 78.1
# lsusb -v -d 09cb:1996 | grep bEndpointAddress
iInterface 5 iAP Interface
bEndpointAddress 0x81 EP 1 IN
bEndpointAddress 0x02 EP 2 OUT
iInterface 6 com.flir.rosebud.fileio
bEndpointAddress 0x83 EP 3 IN
bEndpointAddress 0x04 EP 4 OUT
iInterface 7 com.flir.rosebud.frame
bEndpointAddress 0x85 EP 5 IN
bEndpointAddress 0x06 EP 6 OUT
static final int CONFIG_READ_ENDPOINT_ID = 1 ;
static final int CONFIG_WRITE_ENDPOINT_ID = 2 ;
static final int FILEIO_READ_ENDPOINT_ID = 3 ;
static final int FILEIO_WRITE_ENDPOINT_ID = 4 ;
static final int FRAME_READ_ENDPOINT_ID = 5 ;
>grep ": 78\." F6c.txt
IN : 78.0
IN : 78.1
OUT : 78.2
IN : 78.3
$ gawk -bniord '{for(i=1; i <=NF; i=i+1) {tmp=sprintf ("%s ","0x"$(i)); printf "%c", strtonum(tmp)}}' F6d.txt | strings -n 7
{"type":"sledInformation","data":{"serialNumberBoard":"F03xxx00571","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","operatinwp
gMode":"operational"}}
{"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
{"type":"readFile","data":{"streamIdentifier":10}}
// comment: strings inside CameraFiles.zip:
/CameraFiles/system/calib.rsc
/CameraFiles/system/maps/ds_we_ap_fi_le_LCFMap.fff
/CameraFiles/system/maps/ds_we_ap_fi_leExFOL2_LCFMap.fff
/CameraFiles/system/calib.rscPK
/CameraFiles/system/maps/ds_we_ap_fi_le_LCFMap.fffPK
/CameraFiles/system/maps/ds_we_ap_fi_leExFOL2_LCFMap.fffPK
{"type":"readFile","data":{"streamIdentifier":10}}
{"type":"setOption","data":{"option":"autoFFC","value":true}}
{"type":"setOptionStatus","data":{"option":"autoFFC","value":-1}}
{"type":"setOption","data":{"option":"autoFFC","value":true}}
{"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
.calib.visual.fusion.leExFOL2.magnQuote double 0
.calib.visual.fusion.leExFOL2.magnQuoteComp double 0
.calib.visual.fusion.leExFOL2.magnQuote double 1.2312108
.calib.visual.fusion.leExFOL2.magnQuoteComp double 0
It is sort of on the back burner while I'm fiddling with the SDK.
//FrameProcessor.updateCameraFiles(zis, cachedContext.getFilesDir().getAbsolutePath() + File.separator);
./app/src/main/res/raw/default_camera_files.zip
\Android\data\com.flir.flirone\files\CameraFiles
Here you can grep the file /data/data/com.flir.flironeexampleapplication/files/CameraFiles
You need a rootet device to read this pathIf you want to get your application path use getFilesDir() which will give you path /data/data/your package/files
You can get the path using the Environment var of your data/package using the getExternalFilesDir(Environment.getDataDirectory().getAbsolutePath()).getAbsolutePath();
which will return the path from the root directory of your external storage as
/storage/sdcard/Android/data/your pacakge/files/data
private FrameProcessor(Context context)
{
this.emissivity = EMISSIVITY_SKIN; // was DEFAULT ie.0.95F km
String storagePath = context.getFilesDir().getAbsolutePath() + File.separator;
cameraFilesPath = storagePath + "CameraFiles";
Boolean cameraFilesExists = Boolean.valueOf(new File(cameraFilesPath).exists());
InputStream defaultCameraFilesInput = context.getApplicationContext().getResources().openRawResource(R.raw.default_camera_files);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(defaultCameraFilesInput));
updateCameraFiles(zis, storagePath);
setupAppCore(cameraFilesPath);
}
.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.32686445
.calib.lensCorr.ds_we_ap_fi_le.type int32 100
.calib.lensCorr.ds_we_ap_fi_le.zoom double 7.7799269
.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.32686445
.calib.lensCorr.ds_we_ap_fi_leExFOL2.type int32 100
.calib.lensCorr.ds_we_ap_fi_leExFOL2.zoom double 7.7799269
if I remove this block, then I have uncropped Lepton images with calibrated temperature measurements.// count (n) 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
// edit last line
first test it on a unpatched sample and compare last line with output of crc32./app/src/main/res/raw/default_camera_files.zip
with my patched calib.rsc from my Flir One the SDK.app works fine.frameProcessor.setImageTypes(EnumSet.of(RenderedImage.ImageType.BlendedMSXRGBA8888Image, RenderedImage.ImageType.ThermalLinearFlux14BitImage));
Called when a frame has been received and processed. Note: if you have requested N formats, this method will be called N times per Frame passed to the FrameProcessor instance. If your goal is to record a video from a sequence of frames, use android.media.MediaCodec and call mediaCodec.queueInputBuffer from this method with the frame's pixelData byte array put in the input ByteBuffer of the mediaCodec
private RenderedImage(int width, int height, byte[] pixelData, byte frameTypeValue, float emissivity, int paletteOrdinal, Frame originalFrame)
{
this.width = width;
this.height = height;
this.pixelData = pixelData;
this.imageType = ImageType.get(frameTypeValue);
this.emissivity = emissivity;
if ((paletteOrdinal >= 0) && (paletteOrdinal < Palette.values().length)) {
this.palette = Palette.values()[paletteOrdinal];
} else {
this.palette = null;
}
this.rawFrame = originalFrame;
}
But I haven't found a way to write to "private" array this.rawFrame.
// for raw images
import java.io.FileOutputStream;
public void onFrameProcessed(final RenderedImage renderedImage){
thermalBitmap = renderedImage.getBitmap();
updateThermalImageView(thermalBitmap);
/*
Capture this image if requested.
*/
if (this.imageCaptureRequested) {
imageCaptureRequested = false;
final Context context = this;
new Thread(new Runnable() {
public void run() {
String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ssZ", Locale.getDefault());
String formatedDate = sdf.format(new Date());
String fileName = "FLIROne-" + formatedDate + ".jpg";
try{
lastSavedPath = path+ "/" + fileName;
renderedImage.getFrame().save(new File(lastSavedPath), RenderedImage.Palette.Iron, RenderedImage.ImageType.BlendedMSXRGBA8888Image);
MediaScannerConnection.scanFile(context,
new String[]{path + "/" + fileName}, null,
new MediaScannerConnection.OnScanCompletedListener() {
@Override
public void onScanCompleted(String path, Uri uri) {
Log.i("ExternalStorage", "Scanned " + path + ":");
Log.i("ExternalStorage", "-> uri=" + uri);
}
});
if (renderedImage.imageType() == RenderedImage.ImageType.ThermalLinearFlux14BitImage){
// save the Lepton RAW file
String rawName = "FLIROne-" + formatedDate + ".raw";
lastSavedPath = path+ "/" + rawName;
File file = new File(lastSavedPath);
FileOutputStream fop = null;
fop = new FileOutputStream(file);
if (!file.exists()) {
file.createNewFile();
}
//int rawLength = renderedImage.pixelData().length;
byte[] LeptonRAWBytes = renderedImage.pixelData();
fop.write(LeptonRAWBytes);
fop.flush();
fop.close();
}
}catch (Exception e){
e.printStackTrace();
}
runOnUiThread(new Runnable() {
@Override
public void run() {
thermalImageView.animate().setDuration(50).scaleY(0).withEndAction((new Runnable() {
public void run() {
thermalImageView.animate().setDuration(50).scaleY(1);
}
}));
}
});
}
}).start();
}
...
I wrote here something about the new Flir One G2 with Lepton 160x120.
https://www.eevblog.com/forum/testgear/flir-one-thermal-imaging-camera-teardown-and-hacks/msg801504/#msg801504
I shot comparison photos with Flir One G1, Flir One G2 , Flir E4 and Flir E40 from a motherboard.
The temperature scale is auto-level, but Flir tools use a different "gamma correction" for the color scale of E40.
Flir One G1 Lepton 80x60
Flir One G2 Lepton 160x120 Mode: ThermalLinearFlux14BitImage
Flir Ex 320x240
Flir Exx 320x240
// Frame Processor Delegate method, will be called each time a rendered frame is produced
public void onFrameProcessed(final RenderedImage renderedImage){
if (renderedImage.imageType == RenderedImage.ImageType.VisualJPEGImage) {
visualBitmap = renderedImage.getBitmap();
updateVisualImageView(visualBitmap);
Log.i("app", "Visual Image");
}
if (renderedImage.imageType == RenderedImage.ImageType.ThermalLinearFlux14BitImage) { // seems ot come here for thermal image as well
thermalBitmap = renderedImage.getBitmap();
updateThermalImageView(thermalBitmap);
Log.i("app","Thermal Image");
}
}
BUT there is no way for the delegate to determine what type of image it is UNLESS you modify Renderimage.java to make ImageType public
public ImageType imageType;
public ImageType imageType()
{
return this.imageType;
}
public byte[] pixelData()
{
return this.pixelData;
}
if (renderedImage.imageType() == RenderedImage.ImageType.ThermalLinearFlux14BitImage){
...
fop = new FileOutputStream(file);
byte[] LeptonRAWBytes = renderedImage.pixelData();
fop.write(LeptonRAWBytes);
It seems extremely simple:
1. Write control transfer on EP0: 0xC0 7E 00 00 (probably does shutter calibration)
2. Read entire frame from EP1. Repeat for a few seconds then recal
I've built some PC side library code to do really basic frame acquisition and calibration based on the data from marshallh's captures, feel free to try it:
https://github.com/sgstair/winusbdotnet
It's winusb based, you should use Zadig to install the winusb driver on the "iAP interface" device that enumerates.
It's not perfect or polished but it does work, I'll probably continue to improve it as I have time.
iManufacturer 1 Seek Thermal
iProduct 2 PIR206 Thermal Camera
iInterface 3 iAP Interface
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
iInterface 4 com.thermal.pir206.1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
{"type":"sledInformation","data":{"serialNumberBoard":"xxxxxxxxx","partNumberBoard":"xxxxxxxxx","versionBoard":"D","serialNumberLepton":"xxxxxxx","versionLepton":"3.1.46","leptonQR":"xxxxxx","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"}}
{"type":"batteryVoltageUpdate","data":{"voltage":3.95000004768372,"percentage":76}}
// after power cable plugin
{"type":"batteryChargingCurrentUpdate","data":{"chargingCurrent":500}}
{"type":"batteryChargingStateUpdate","data":{"chargingState":"stateManagedBatteryCharging"}}
[ ] 3.233354 d= 0.000000 [191.7 + 17.317] [ 1] NAK
Here is another capture that starts with the above command & data (different) see below
[ ] 20.832611 d= 0.000001 [231.4 +107.300] [ 3] IN : 89.3
There is a lot going on in the Flir portocol, I think it is more complex than the Seek, as I was able to get the Seek streaming fairly easily.
controlTransfer
protocolType = {UsbCommunicator$ProtocolType@20946} "FRAME"
startCommunication = false
controlTransfer
protocolType = {UsbCommunicator$ProtocolType@20970} "FILEIO"
startCommunication = false
controlTransfer
protocolType = {UsbCommunicator$ProtocolType@20970} "FILEIO"
startCommunication = true
bulkTransfer
protocolType = {UsbCommunicator$ProtocolType@20993} "CONFIGURATION"
data = {byte[16]@20992}
0 = -52 (0xCC)
1 = 1 (0x1)
2 = 0 (0x0)
3 = 0 (0x0)
4 = 1 (0x1)
5 = 0 (0x0)
6 = 0 (0x0)
7 = 0 (0x0)
8 = 65 (0x41)
9 = 0 (0x0)
10 = 0 (0x0)
11 = 0 (0x0)
12 = -8 (0xF8)
13 = -77 (0xB3)
14 = -9 (0xF7)
15 = 0 (0x0)
bulkTransfer
protocolType = {UsbCommunicator$ProtocolType@20992} "CONFIGURATION"
data = {byte[65]@21002}
{"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
bulkTransfer
protocolType = {UsbCommunicator$ProtocolType@20993} "CONFIGURATION"
data = {byte[16]@21044}
0 = -52 (0xCC)
1 = 1 (0x1)
2 = 0 (0x0)
3 = 0 (0x0)
4 = 1 (0x1)
5 = 0 (0x0)
6 = 0 (0x0)
7 = 0 (0x0)
8 = 51 (0x33)
9 = 0 (0x0)
10 = 0 (0x0)
11 = 0 (0x0)
12 = -17 (0xEF)
13 = -37 (0xDB)
14 = -63 (0xC1)
15 = -63 (0xC1)
bulkTransfer
protocolType = {UsbCommunicator$ProtocolType@20993} "CONFIGURATION"
data = {byte[51]@21053}
{"type":"readFile","data":{"streamIdentifier":10}}
controlTransfer
protocolType = {UsbCommunicator$ProtocolType@20946} "FRAME"
startCommunication = true
after this control transfer we get the frames over EP 5$ sudo python flir.py
send bytes:16
send bytes:65
array('B', [204, 1, 0, 0, 1, 0, 0, 0, 93, 0, 0, 0, 223, 91, 56, 26])
?]?[8
0x83 usb.core.USBError: [Errno 110] Operation timed out
array('B', [123, 34, 116, 121, 112, 101, 34, 58, 34, 111, 112, 101, 110, 70, 105, 108, 101, 83, 116, 97, 116, 117, 115, 34, 44, 34, 100, 97, 116, 97, 34, 58, 123, 34, 112, 97, 116, 104, 34, 58, 34, 67, 97, 109, 101, 114, 97, 70, 105, 108, 101, 115, 46, 122, 105, 112, 34, 44, 34, 115, 116, 114, 101, 97, 109, 73, 100, 101, 110, 116, 105, 102, 105, 101, 114, 34, 58, 49, 49, 44, 34, 109, 111, 100, 101, 34, 58, 34, 114, 34, 125, 125, 0])
{"type":"openFileStatus","data":{"path":"CameraFiles.zip","streamIdentifier":11,"mode":"r"}}
0x83 usb.core.USBError: [Errno 110] Operation timed out
array('B', [204, 1, 0, 0, 1, 0, 0,
....
1, 110, 97, 108, 34, 125, 125, 0])
?w`
?{"type":"sledInformation","data":{"serialNumberBoard":FFFFFFFFFF","partNumberBoard":"21xxxxxx01","versionBoard":"D","serialNumberLepton":"37xxxx1","versionLepton":"3.1.46","leptonQR":"A0xxxx1","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"}}
0x83 usb.core.USBError: [Errno 110] Operation timed out
0x81 usb.core.USBError: [Errno 110] Operation timed out
0x83 usb.core.USBError: [Errno 110] Operation timed out
array('B', [204, 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 85, 20, 48, 103, 123, 34, 116, 121, 112, 101, 34, 58, 34, 98, 97, 116, 116, 101, 114, 121, 86, 111, 108, 116, 97, 103, 101, 85, 112, 100, 97, 116, 101, 34, 44, 34, 100, 97, 116, 97, 34, 58, 123, 34, 118, 111, 108, 116, 97, 103, 101, 34, 58, 51, 46, 56, 48, 57, 57, 57, 57, 57, 52, 50, 55, 55, 57, 53, 52, 44, 34, 112, 101, 114, 99, 101, 110, 116, 97, 103, 101, 34, 58, 53, 51, 125, 125, 0])
?TU0g{"type":"batteryVoltageUpdate","data":{"voltage":3.80999994277954,"percentage":53}}
0x83 usb.core.USBError: [Errno 110] Operation timed out
array('B', [204, 1, 0, 0, 1, 0, 0, 0, 69, 0, 0, 0, 175, 36, 149, 143, 123, 34, 116, 121, 112, 101, 34, 58, 34, 98, 97, 116, 116, 101, 114, 121, 67, 104, 97, 114, 103, 105, 110, 103, 67, 117, 114, 114, 101, 110, 116, 85, 112, 100, 97, 116, 101, 34, 44, 34, 100, 97, 116, 97, 34, 58, 123, 34, 99, 104, 97, 114, 103, 105, 110, 103, 67, 117, 114, 114, 101, 110, 116, 34, 58, 48, 125, 125, 0, 204, 1, 0, 0, 1, 0, 0, 0, 81, 0, 0, 0, 103, 228, 238, 80, 123, 34, 116, 121, 112, 101, 34, 58, 34, 98, 97, 116, 116, 101, 114, 121, 67, 104, 97, 114, 103, 105, 110, 103, 83, 116, 97, 116, 101, 85, 112, 100, 97, 116, 101, 34, 44, 34, 100, 97, 116, 97, 34, 58, 123, 34, 99, 104, 97, 114, 103, 105, 110, 103, 83, 116, 97, 116, 101, 34, 58, 34, 115, 116, 97, 116, 101, 78, 111, 67, 104, 97, 114, 103, 105, 110, 103, 34, 125, 125, 0])
?E?$??{"type":"batteryChargingCurrentUpdate","data":{"chargingCurrent":0}}?Qg??P{"type":"batteryChargingStateUpdate","data":{"chargingState":"stateNoCharging"}}
0x83 usb.core.USBError: [Errno 110] Operation timed out
libusb_get_string_descriptor langid=0x409
String descriptor 2: "FLIR ONE Camera"
String descriptor 1: "FLIR Systems"
String descriptor 3: "FLIRONEF03FXXXXAFFF"
Successfully set usb configuration 3
String descriptor 4: "SBIBDP Configuration"
$ gcc -L/opt/local/lib/ -I/opt/local/include/libusb-1.0/ -o flir flir7d.c -lusb-1.0
after installing libusb 1.0 with mac port$ sudo port install libusb
$ sudo port install libusb-legacy
$ lsb_release -r
Release: 14.04
$ /usr/bin/gcc -std=c99 '-I/usr/include/libusb-1.0' -o flir flir7d.c -lusb-1.0
./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: "FLIRONEF03FXXXXXFFF"
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
: Tue Dec 8 22:41:23 2015
: Tue Dec 8 22:41:23 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x81: LIBUSB_ERROR_TIMEOUT
: Tue Dec 8 22:41:24 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x83: LIBUSB_ERROR_OTHER
: Tue Dec 8 22:41:25 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":"F03XXXXXXX","partNumberBoard":"21222222201","versionBoard":"D","serialNumberLepton":"32333331","versionLepton":"3.1.46","leptonQR":"A0777781","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"}}
: Tue Dec 8 22:41:25 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 34 2e 30 31 39 39 39 39 39 38 30 39 32 36 35 31 2c 22 70 65 72 63 65 6e 74 61 67 65 22 3a 39 35 7d 7d 00
STRING:
?TU0g{"type":"batteryVoltageUpdate","data":{"voltage":4.01999998092651,"percentage":95}}
: Tue Dec 8 22:41:25 2015
bulk read EP 0x81, actual length 182
HEX:
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:
?E?$??{"type":"batteryChargingCurrentUpdate","data":{"chargingCurrent":0}}?Qg??P{"type":"batteryChargingStateUpdate","data":{"chargingState":"stateNoCharging"}}
ask for CameraFiles.zip on EP 0x83:
: Tue Dec 8 22:41:26 2015
EP 0x02 to be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 41 00 00 00 f8 b3 f7 00 ]
Write successful!
EP 0x02 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"}}
EP 0x02 to be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 33 00 00 00 ef db c1 c1 ]
Write successful!
EP 0x02 to be sent 51 Bytes: {"type":"readFile","data":{"streamIdentifier":10}}
Write successful!
Sent 51 bytes with string: {"type":"readFile","data":{"streamIdentifier":10}}
: Tue Dec 8 22:41:26 2015
: Tue Dec 8 22:41:26 2015
bulk read EP 0x81, actual length 109
HEX:
cc 01 00 00 01 00 00 00 5d 00 00 00 df 5b 38 1a 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 30 2c 22 6d 6f 64 65 22 3a 22 72 22 7d 7d 00
STRING:
?]?[8{"type":"openFileStatus","data":{"path":"CameraFiles.zip","streamIdentifier":10,"mode":"r"}}
: Tue Dec 8 22:41:28 2015
Ask for video stream, start EP 0x85:
: Tue Dec 8 22:41:28 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x85: LIBUSB_ERROR_OTHER
$ sudo ./flir
[sudo] password for kenm:
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: "FLIRONEF03F62xxxxxxxF"
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
: Wed Dec 9 10:50:57 2015
: Wed Dec 9 10:50:57 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x81: LIBUSB_ERROR_IO
: Wed Dec 9 10:50:58 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x83: LIBUSB_ERROR_NO_DEVICE
: Wed Dec 9 10:50:59 2015
>>>>>>>>>>>>>>>>>bulk transfer (in) 0x81: LIBUSB_ERROR_NO_DEVICE
ask for CameraFiles.zip on EP 0x83:
: Wed Dec 9 10:51:00 2015
EP 0x02 to be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 41 00 00 00 f8 b3 f7 00 ]
Error in write! res = -4 and transferred = 0
EP 0x02 to be sent: {"type":"openFile","data":{"mode":"r","path":"CameraFiles.zip"}}
Error in write! res = -4 and transferred = 0
EP 0x02 to be sent Hexcode: 16 Bytes[ cc 01 00 00 01 00 00 00 33 00 00 00 ef db c1 c1 ]
Error in write! res = -4 and transferred = 0
EP 0x02 to be sent 51 Bytes: {"type":"readFile","data":{"streamIdentifier":10}}
Error in write! res = -4 and transferred = 0
: Wed Dec 9 10:51:00 2015
: Wed Dec 9 10:51:00 2015
Ask for video stream, start EP 0x85:
Control Out error -4