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

0 Members and 1 Guest are viewing this topic.

Offline Uho

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: ua
Re: Question about FLIR One for Android
« Reply #425 on: January 19, 2018, 07:57:49 am »
I do not know that. But Seek is only a connector. I changed the plug and the thermal imager worked on the android. I did not repair Flir one ios. Therefore, I can not say exactly whether they are the same.
 

Offline newex

  • Contributor
  • Posts: 23
  • Country: 00
Re: Question about FLIR One for Android
« Reply #426 on: January 19, 2018, 02:50:18 pm »
There are two board revisions. The difference between them in the presence of a single chip. Both work on android or iOS. They are absolutely identical functionally. I put a board from the iOS version into the case for the android and it worked.
 

Offline kazik151

  • Newbie
  • Posts: 1
  • Country: pl
Re: Question about FLIR One for Android
« Reply #427 on: March 02, 2018, 11:22:29 pm »
Hello,
I have read about all amazing things that you've done with F1G2 and I'd like to ask you for advice. My Flir One is totally down. When I plug the battery, it sends part of boot sequence to the serial port:
Code: [Select]
RomBOOT

Start AT91Bootstrap version svn-r5344 ...

Init HALF drive strength DDR... BOARD_ConfigureDdram()

DDRSDRC->DDRSDRC_LPR: 0x12101

Done!

Downloading image...

Trying to load uboot...

nandflash_hw_init()

reset_nandflash()

AT91F_NandReadID()

ManufacturerID: 0x2c DeviceID: 0xa1

chip id: 0x2ca1

Copy 0x50000 bytes from 0x40000 to 0x23f00000
nandflash_cfg_8bits_dbw_init()

switch(sNandInfo.uDataNbBytes) 2048:

read_nandflash: while (1)

read_nandflash: while (1)

read_nandflash: while (1)

read_nandflash(): return 0;

Done!

Returning jump to 0x0x23f00000

RomBOOT

Start AT91Bootstrap version svn-r5344 ...

Init HALF drive strength DDR... BOARD_ConfigureDdram()

DDRSDRC->DDRSDRC_LPR: 0x12101

Done!

Downloading image...

Trying to load uboot...

nandflash_hw_init()

reset_nandflash()

AT91F_NandReadID()

ManufacturerID: 0x2c DeviceID: 0xa1

chip id: 0x2ca1

Copy 0x50000 bytes from 0x40000 to 0x23f00000
nandflash_cfg_8bits_dbw_init()

switch(sNandInfo.uDataNbBytes) 2048:

read_nandflash: while (1)

read_nandflash: while (1)

read_nandflash: while (1)

read_nandflash(): return 0;

Done!

Returning jump to 0x0x23f00000

Then nothing happens for the next 17 seconds when the orange light blinks once and then it starts all over again. So it is a kind of boot loop. Do you know is there anything that I can do to make it work?
 

Offline wb0gaz

  • Regular Contributor
  • *
  • Posts: 200
Re: Question about FLIR One for Android
« Reply #428 on: March 07, 2018, 11:13:12 pm »
I am trying to duplicate the installation on linux mint 17.3 described by tomas123 in reply 110 on December 31, 2015, 01:50:14 AM. Although the post was made over 2 years ago, it provides a solution that I seek: My goal is to get my Flir ONE G2 for Android running on a generic Linux machine.

I am unable to complete the procedure, as I get stuck building the v4l2loopback module.

I am running the same version of linux mint 17.3, but as a virtual machine (virtualbox guest.) This is the main (only?) difference between the procedure I am following and the procedure in the reply above.

I am unable to complete install of the v4l2loopback module which is compiled from source per the instructions.

In cd v4l2loopback/
make works fine, however, when I issue the command
sudo make install
to prepare v4l2loopback.ko, I receive an error about a missing key (presumably a cryptographic key).

Here is the result of sudo make install:

------------------------------------------------
sudo make install
make -C /lib/modules/`uname -r`/build M=/home/dgf/v4l2loopback modules_install
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-32-generic'
  INSTALL /home/dgf/v4l2loopback/v4l2loopback.ko
Can't read private key
  DEPMOD  3.19.0-32-generic
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-32-generic'[/font][/font]
-------------------------------------------------

As I cannot complete "make install", I cannot perform sudo modprobe v4l2loopback video_nr=1,2.

I originally was trying this procedure with Ubuntu 16.04, but ran into the same (cryptographic key) problem, and as I didn't see mention of a key in reply 110 above, I thought I would be OK using Linux Mint 17.3, but that is not the case.

While I have long ago successfully built kernel modules, I have not done this in quite some time, so the process of requiring inclusion of a cryptographic key is new to me. While I can find quite a bit of information on how to install linux with (or without) secure UEFI boot, I cannot find a clear explanation of how to build a kernel that involves a key.

Any help/pointer very much appreciated!

Dave
« Last Edit: March 07, 2018, 11:33:41 pm by wb0gaz »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #429 on: March 09, 2018, 09:02:03 am »
Linux kernel driver are a pain and google is your friend ;-)

Quote
make "Can't read private key"   DEPMOD generic

Google found
https://github.com/slavrn/gm12u320/issues/7

and a german post with the same error message under Linux Mint by compiling a keyboard kernel driver:

https://www.linuxmintusers.de/index.php?topic=33630.msg469267#msg469267
Code: [Select]
Can't read private key
  DEPMOD  3.19.0-32-generic
make[1]: Verzeichnis »/usr/src/linux-headers-3.19.0-32-generic« wird verlassen

after the last post in this thread it works after unbind/bind some driver and change the path...
see this script
https://github.com/CMoH/lg4l/blob/master/rebind


Offline yokoAC

  • Newbie
  • Posts: 5
  • Country: de
Re: Question about FLIR One for Android
« Reply #430 on: March 23, 2018, 06:15:17 pm »
Hey  :)

I'm trying to use the FlirOne on Windows10
My approach:
- use the code you presented for Linux (based on libusb)
- use Zadig ("Zadig is a Windows application that installs generic USB drivers, such as WinUSB, libusb-win32/libusb0.sys or libusbK, to help you access USB devices."): at the moment I'm using 'libsubK'

Actually the interface 0x81 is working! E.g. I get log messages like the following one (I'm sorry, not at my working computer...copied this log msg from the forum, but I get quasi the same msg)

Code: [Select]
{"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"}}
or some stuff about the battery status.

My problem is, that 0x83 and 0x85 is not working. Using libusb_bulk_transfer() on these interfaces always returns LIBUSB_ERROR_NOT_FOUND :(
Did anyone get this error? Maybe there is someone getting the same error while trying to get run the FlirOne on Windows10.
I think there is maybe a problem how USB communication is done on Windows10 (...but why is 0x81 working?!). Sorry, I'm entirely new to this topic :(

Thanks!
 

Offline yokoAC

  • Newbie
  • Posts: 5
  • Country: de
Re: Question about FLIR One for Android
« Reply #431 on: April 06, 2018, 05:16:53 pm »
Hey :)

Is there nobody who wants to get the FlirOne running on Windows10? :(
I attached my FlirOne.cpp and the corresponding output.

I tried to use libusb_set_interface_alt_setting instead of libusb_control_transfer to start/stop the interfaces 1 and 2 (not sure, if this is okay..).
Now I get an LIBUSB_ERROR_IO error on the endpoints 0x83 and 0x85 (instead of using libusb_control_transfer, where I would get the LIBUSB_ERROR_NOT_FOUND error).

Corresponding to the OutputFile, the interfaces 1 and 2 have two alternate settings (0 and 1). Using 1 results in  LIBUSB_ERROR_IO and using 0 results in LIBUSB_ERROR_NOT_FOUND.

Maybe the approach using libusb_set_interface_alt_setting is completely wrong. Hopefully there is somebody with an idea how to connect to the endpoints 0x83 and 0x85.
Thanks!
 

Offline Ben321Topic starter

  • Frequent Contributor
  • **
  • Posts: 894
Re: Question about FLIR One for Android
« Reply #432 on: April 09, 2018, 11:26:48 am »
Preview version! Sometimes works for Windows!

I create driver FLIR One Gen 2 for Windows XP with WinDDK!
After calibration does not work!

Uses:
0) Find WdfCoInstaller01009.dll (its not in archive! Big size...)
1) Flir One Gen 2 On.
2) Wait for green LED.
3) Start FlirOneControl.exe.
4) In path Image must created files ".tga". ( If everything worked :) - Does not always work )
5) Fun. :)

The program used ReadFile in synchronously mode. After closing the window FlieOneControl in the task manager, close the application if it remains working.

If you use the program Zadig to install the WinUSB driver for the FLIR One device, then it should be possible to write a program using the WinUSB interface to control the FLIR One. In this way, you won't need to write a dedicated driver for FLIR One. WinUSB is available on all Windows systems, from XP all the way to Windows 10. Therefore, once you wrote your program and posted it to the internet, anybody could download it and use it. They would just need one extra step, and that is to download Zadig, and use it to install the WinUSB driver for FLIR One. Once they did that, your program would work to control the FLIR One.

You could even include a copy of Zadig with your download of your FLIR One app, and include instructions in a text file explaining how to use Zadig to install the WinUSB driver for the FLIR One device.

The nice thing about the WinUSB driver is that it is very generic, and can be installed for any device using Zadig. Once it is installed, if you know the USB commands that the device is expecting, you can use the WinUSB interface to send those commands to the device. The WinUSB interface is part of the Windows API. It's just a set of DLL functions that let you control any device that currently has the WinUSB driver installed.
 

Offline yokoAC

  • Newbie
  • Posts: 5
  • Country: de
Re: Question about FLIR One for Android
« Reply #433 on: April 09, 2018, 07:55:00 pm »
Hey guys :)

Actually, I have also tried using WinUSB (see attached file: sorry for inappropriate programming, I'm new to this windows stuff and just put different code examples together).
I get the device and can receive some descriptors, but I'm not sure how to communicate with the device. I cannot change the alternate settings or the configuration.

I think there is some bad windows stuff...e.g. WinUSB cannot set the configuration (configuration 3 is needed as you can see in the files which are running on Linux) as described in https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/selecting-the-configuration-for-a-multiple-interface--composite--usb-d:
Quote
The operating system does not allow this...a client driver that controls a set of interfaces or an interface collection of the composite device cannot change the configuration that is initially set by Usbccgp.sys

This could be the reason why it's running on Linux and not on Windows. The following 'project' tries to avoid this problem by using a so called lower-level filter driver (https://nadavrub.wordpress.com/2014/10/16/winusb-with-non-default-configuration/). Too bad, that I do not get this one running :(

All in all, maybe developing a driver might be the only chance  :-\

Remark: if anyone wants to monitor his USB output, I can recommend "Device Monitoring Studio". The first 14 days are for free.
 

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #434 on: April 13, 2018, 03:10:34 pm »
Quote
All in all, maybe developing a driver might be the only chance  :-\

I created the driver. But in Windows 7 and later it can not be installed. And Windows 7 and older does not see the Flir One.
 

Offline yokoAC

  • Newbie
  • Posts: 5
  • Country: de
Re: Question about FLIR One for Android
« Reply #435 on: April 14, 2018, 11:52:15 am »
Quote
All in all, maybe developing a driver might be the only chance  :-\

I created the driver. But in Windows 7 and later it can not be installed. And Windows 7 and older does not see the Flir One.

Hey, are you talking about the three drivers you developed before? Or did you develop a 'one-driver' solution in the meantime, where no single driver installation for each interface is necessary?
 

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #436 on: April 14, 2018, 01:45:21 pm »
I'm talking about the driver for each interface. There are three.
 

Offline yokoAC

  • Newbie
  • Posts: 5
  • Country: de
Re: Question about FLIR One for Android
« Reply #437 on: April 16, 2018, 12:21:55 pm »
I am running the same version of linux mint 17.3, but as a virtual machine (virtualbox guest.) This is the main (only?) difference between the procedure I am following and the procedure in the reply above.

Did you get anything running on your virtual machine?
I'm trying to use a virtual machine (VMware, Linux Mint 17.3) as well, but I cannot connect to the Flir..
Actually all installation steps are successful, but when I start the flir8g-mint.c code I just get the following:
Successfully find the Flir One G2 device
libusb_set_configuration error -99

Does anyone have this problem as well? Could this be related to my virtual machine?
« Last Edit: April 16, 2018, 12:30:04 pm by yokoAC »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #438 on: April 19, 2018, 08:52:56 pm »
I also had no success with vmware and usb (flir one).
 

Do you remember, how many time I wasted on the wrong system (Linux VM, OS X)?
Apparently the FlirOne G2 USB connection is tricky...
 

Offline budhafoo

  • Newbie
  • Posts: 8
Re: Question about FLIR One for Android
« Reply #439 on: April 27, 2018, 01:59:16 am »
This thread is awesome! 8)

I have not read all, but I felt like writing something.
My flir one for android (2nd gen I believe) just died.

The unit is blinking orange when charged, opened it, unplug the batt, tried all sort of things.

When I manage to get the green light blinking, the unit is recognized using the app, but shows only blank/black screen.

I havent opened the copper tape shielding to do some measurements, but unit surely gets really hot when the orange light is blinking, current from charger when plugged is around 500mA.

If anyone can point me what can start to read/do that will be great. :D

-B
 

Offline careyer

  • Newbie
  • Posts: 8
  • Country: de
Re: Question about FLIR One for Android
« Reply #440 on: May 17, 2018, 01:58:42 pm »
First of all thank you @tomas123 & @cynfab for the brilliant work!

I am using the "flir8p1-gpl" Driver (11/2016) in conjunction with EZ-Wifibroadcast on a Reconnaissance & Inspection drone project. The FlirOneG2 is connected to a Raspberry Pi0 which is mounted to the drone.
The Pi0 running EZ-Wifibroadcast streams a digital HD-Video feed and the FlirOneG2 Thermalvideo wirelessly to the Ground where  it can be displayed via HDMI (or on a tablet). The same WiFi link (bi-directional) is also used to control the drone.
The range is up to 8km. #mind-boggling :o

It was excessive work to get everything working but finally I succeeded.
However some minor problems (P) and questions (Q) remain and I hope I can get some help and guidance here  ;)

 P1.) I noticed that quite often I get the "reset buffer because of bad Magic Byte" error. The system will continue working but that feels somehow uncomfortable (and I think it also drops some frames?)
 P2.) The FCC shutter is quite annoying during Air operations. Is there a parameter on the driver how to disable this calibration or at least do it less often?
        (everytime the video freezes for a sec the pilots heart almost stops)

now for the questions:

 Q1.) Is "flir8p1-gpl.tar" (as from 11/2016) the latest version of the driver? User rbalint wanted to publish it on GitHub after tomas123 & cynfab gave their okay for the license.
        (However rbalint never wrote again or publsihed the GitHub link  :wtf:? - do i miss anything?)
 Q2.) Is it possible to get more then the ~9fps from the camera? I noticed that the linux password for the camera has been revealed. Has there been any attempt to remove this limitation or is the 9fps limitation hardware wise?
 Q3.) Is there a way to change the color-palette without restarting the Driver?


Thank you so much for your help and terrific work.

BTW: That's how my little project (codename: Predator) looks like... It is used for good ( saving fawns during harvest season)

« Last Edit: May 17, 2018, 02:09:19 pm by careyer »
 

Offline cynfab

  • Regular Contributor
  • *
  • Posts: 175
  • Country: us
Re: Question about FLIR One for Android
« Reply #441 on: May 18, 2018, 02:16:41 am »
Thanks for the nice words.
Since the Flir One-G2 is no longer available other than used from e-bay I have not done too much with the code since 2016. The Flir One G3 is somewhat of a disappointment.
So on to your problems & questions.

P1, yes I have seen that error message, I have no clue as to what it means and the system does seem to continue running. I think it may have to do with Flir's USB stack, but it doesn't seem to cause any problems.

P2, Yes the FFC is a PITA for airborne operations, I believe there is a command to stop the automatic FFC and another to do a manual FFC, but I have not investigated.

Q1, the latest code I had anything to do with is flir8p1. Someone else may have done more with it. My primary goal was to run flir8 on a 3DR Solo on it's iMx6 companion computer. I got this to work, but found that the iMx6 was somewhat underpowered for the job. It took a lot of work to figure out how to recompile u-boot and the kernel, Also the 3.10.17 kernel really needs updating to a much more recent version to allow running gstreamer 1.0, and that proved to be more than I was willing to put any more time into.
It is still an interesting project and the potential for S&R, inspections is really great. The cost of one Flir Vue or Flir DUO is more than several 3DR Solo's + Flir One G2's.

Q2, to do that one would have to tweak the Lepton 3 as well as the code in the onboard ARM processor. a) this may not be a good idea for ITAR/Wassamer reasons, b) the onboard ARM processor may not be able to process more than 9fps. 3) your external processor would have to process a lot more data too, which may be beyond it's capabilities, the Solo's iMx6 is almost out of it's league at 9fps, any more would require an auxiliary processor, if you could get the first two parts to work, IMHO, financially  it would make more sense to by some other camera.

Q3, not with the flir8 code, it's open source, have at it, and best of luck.

I like your Predator!!    Fawn + John Deere => "Bad Things(tm) happening to Bambi"

First of all thank you @tomas123 & @cynfab for the brilliant work!

I am using the "flir8p1-gpl" Driver (11/2016) in conjunction with EZ-Wifibroadcast on a Reconnaissance & Inspection drone project. The FlirOneG2 is connected to a Raspberry Pi0 which is mounted to the drone.
The Pi0 running EZ-Wifibroadcast streams a digital HD-Video feed and the FlirOneG2 Thermalvideo wirelessly to the Ground where  it can be displayed via HDMI (or on a tablet). The same WiFi link (bi-directional) is also used to control the drone.
The range is up to 8km. #mind-boggling :o

It was excessive work to get everything working but finally I succeeded.
However some minor problems (P) and questions (Q) remain and I hope I can get some help and guidance here  ;)

 P1.) I noticed that quite often I get the "reset buffer because of bad Magic Byte" error. The system will continue working but that feels somehow uncomfortable (and I think it also drops some frames?)
 P2.) The FCC shutter is quite annoying during Air operations. Is there a parameter on the driver how to disable this calibration or at least do it less often?
        (everytime the video freezes for a sec the pilots heart almost stops)

now for the questions:

 Q1.) Is "flir8p1-gpl.tar" (as from 11/2016) the latest version of the driver? User rbalint wanted to publish it on GitHub after tomas123 & cynfab gave their okay for the license.
        (However rbalint never wrote again or publsihed the GitHub link  :wtf:? - do i miss anything?)
 Q2.) Is it possible to get more then the ~9fps from the camera? I noticed that the linux password for the camera has been revealed. Has there been any attempt to remove this limitation or is the 9fps limitation hardware wise?
 Q3.) Is there a way to change the color-palette without restarting the Driver?


Thank you so much for your help and terrific work.

BTW: That's how my little project (codename: Predator) looks like... It is used for good ( saving fawns during harvest season)

 

Offline careyer

  • Newbie
  • Posts: 8
  • Country: de
Re: Question about FLIR One for Android
« Reply #442 on: May 18, 2018, 07:52:47 am »
Thanks for the nice words.
Since the Flir One-G2 is no longer available other than used from e-bay I have not done too much with the code since 2016. The Flir One G3 is somewhat of a disappointment.
So on to your problems & questions.

P1, yes I have seen that error message, I have no clue as to what it means and the system does seem to continue running. I think it may have to do with Flir's USB stack, but it doesn't seem to cause any problems.

P2, Yes the FFC is a PITA for airborne operations, I believe there is a command to stop the automatic FFC and another to do a manual FFC, but I have not investigated.

Q1, the latest code I had anything to do with is flir8p1. Someone else may have done more with it. My primary goal was to run flir8 on a 3DR Solo on it's iMx6 companion computer. I got this to work, but found that the iMx6 was somewhat underpowered for the job. It took a lot of work to figure out how to recompile u-boot and the kernel, Also the 3.10.17 kernel really needs updating to a much more recent version to allow running gstreamer 1.0, and that proved to be more than I was willing to put any more time into.
It is still an interesting project and the potential for S&R, inspections is really great. The cost of one Flir Vue or Flir DUO is more than several 3DR Solo's + Flir One G2's.

Q2, to do that one would have to tweak the Lepton 3 as well as the code in the onboard ARM processor. a) this may not be a good idea for ITAR/Wassamer reasons, b) the onboard ARM processor may not be able to process more than 9fps. 3) your external processor would have to process a lot more data too, which may be beyond it's capabilities, the Solo's iMx6 is almost out of it's league at 9fps, any more would require an auxiliary processor, if you could get the first two parts to work, IMHO, financially  it would make more sense to by some other camera.

Q3, not with the flir8 code, it's open source, have at it, and best of luck.

I like your Predator!!    Fawn + John Deere => "Bad Things(tm) happening to Bambi"

Thank you cynfab for quickly coming back to me!
I am aware that the FlirOneG2 is end of life and not available for purchase anymore. However from time to time you can make a good deal buying a used one off ebay. (or like Fraser likes to do: revive a dead one). Like you already pointed out: For the price of a FLIR VUE Pro you can get a whole bunch of them plus some neat drone equipment on top.  :-+
(And when it comes to the FlirOneG3 I totally agree: It's a total rip-off: Flir compensates for all the repair- and support costs  they had with dying batteries and corrupted firmewares on the G2 model by shipping a less capable product (G3 Std) for the same price -or- in case of the Pro model: slightly vamped up but with almost same G2 performance for a much higher price tag). So at the end of the day the G2 is still the better G3Pro!

As for
P2.)  the auto FFC thing -  I think the solution was described here  by tomas123 (Yes I did read the whole thread! ;D). However I have no clue at all when it comes to programming. It is almost like an extra terrestrial  language to me. I was hoping that you guys might be willing and able to help out here? That would be awesome and so much appreciated.  :clap:

Q2.) Yes I understand. The ITAR thing is quite obvious. The inernal ARM processor might be a bottleneck as well. However the Processor on the Pi0 has plenty off number crunching power left. Moreover I make use of its' hardware H264 encoder to process the thermal frames, i.e. -> no additional load for the CPU at all. I'd be more than happy to share if you are interested and still into flying (and building) drones. It should suit your solution (3DR Solo) well since EZ-Wifibroadcast uses MavLink.  ;)

Q3.) same extra terrestrial thing you know...  :scared: (Ahhhh!!!...)

Have a great day! Cheers!
Thomas
« Last Edit: May 18, 2018, 08:08:19 am by careyer »
 

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #443 on: May 18, 2018, 09:11:40 am »
Hi careyer,

you are the second Bambi lifesaver in this thread 
I love your work :-+ :-+

@tomas123
Use case is flying over the field and searching for Bambi that would be hurt or killed while mowing the hay.

I wrote the code as proof of concept.  Therefore the code is raw and the error correction algorithm is half-baked.
A drop in the packets from USB interface results in a "Reset buffer because of bad Magic Byte!"

I think, my last version was flir8l3.zip
minor update:
- a smaller font 5x7 for more chars in information line
- better filtering FFC frames
- crosshair for medium temperature of 2x2 "center" pixels
- info line with temperature  min/crosshair/max
https://www.eevblog.com/forum/thermal-imaging/question-about-flir-one-for-android/?action=dlattach;attach=195140

In April 2017 I ran this code in a test environments 19 days non-stop (F1G2 with a Raspberry Pi0).
After 14.877.155 frames I cancelled the test, because I was worried about the shutter hardware and the overloaded battery.
Code: [Select]
: Sat Apr 29 10:30:46 2017
#14877155 84/10 fps:{"shutterState":"ON","shutterTemperature":314.989990234375,"usbNotifiedTimestamp":1178763464.53319,"usbEnqueuedTimestamp":1178763464.53469,"ffcState":"FFC_VALID_RAD"}

Unfortunately, there has never been anyone in this forum who has improved my C code (proof oc concept) for USB communication with the camera.


Your queastions:
(P1) See above. I know, there is a big potential for a stable connection.
(P2) from my notes

first disable Auto FFC (autoFFC:false)
Code: [Select]
            //--------- write string: {"type":"setOption","data":{"option":"autoFFC","value":false}}
            length = 16;
            unsigned char my_string4[16]={0xcc,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x57,0x64,0x17,0x8b};
            printf("\nEP 0x02 to be sent Hexcode: %i Bytes[",length);
            for (i = 0; i < length; i++) {
                printf(" %02x", my_string4[i]);

            }
            printf(" ]\n");

            r = libusb_bulk_transfer(devh, 2, my_string4, length, &transferred, 0);
            if(r == 0 && transferred == length)
            {
                printf("\nWrite successful!");
            }
            else
                printf("\nError in write! res = %d and transferred = %d\n", r, transferred);

            strcpy(  my_string,"{\"type\":\"setOption\",\"data\":{\"option\":\"autoFFC\",\"value\":false}}");
            length = strlen(my_string)+1;
            printf("\nEP 0x02 to be sent %i Bytes: %s", length, my_string);

            // avoid error: invalid conversion from ‘char*’ to ‘unsigned char*’ [-fpermissive]
            my_string1 = (unsigned char*)my_string;

            r = libusb_bulk_transfer(devh, 2, my_string1, length, &transferred, 0);
            if(r == 0 && transferred == length)
            {
                printf("\nWrite successful!");
                printf("\nSent %d bytes with string: %s\n", transferred, my_string);
            }
            else
                printf("\nError in write! res = %d and transferred = %d\n", r, transferred);

and trigger if required a manual FCC (doFFC:true)
Code: [Select]
unsigned char my_string2[16]={0xcc,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0xb9,0xcb,0xa2,0x99};

                r = libusb_bulk_transfer(devh, 2, my_string2, length, &transferred, 0);
                if(r == 0 && transferred == length)
                    printf("\nWrite successful!");
                else
                    printf("\nError in write! res = %d and transferred = %d\n", r, transferred);

                char my_string[128];
                transferred = 0;

                strcpy(my_string, "{\"type\":\"setOption\",\"data\":{\"option\":\"doFFC\",\"value\":true}}");
                length = strlen(my_string)+1;

                unsigned char *my_string1 = (unsigned char*)my_string;

                transferred = 0;

                r = libusb_bulk_transfer(devh, 2, my_string1, length, &transferred, 0);
                if(r == 0 && transferred == length)
                {
                    printf("\nWrite successful!");
                    printf("\nSent %d bytes with string: %s\n", transferred, my_string);
                }
                else
                    printf("\nError in write! res = %d and transferred = %d\n", r, transferred);


(Q1) see my comments above. The last versions in this thread are "only" improvements in code structure for palette and calibrations values. Unfortunately not for communications to F1G2.
My proposal:
Learn the basics for C programming and you can self change the code for your needs.
This is not as hard as compiling kernel drivers  ;)

(Q2) The lepton datasheet gives as 8.7 Hz. I can't hack the frame rate.

(Q3) This is only a minor code customizing. See (Q1)

Offline tomas123

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: de
Re: Question about FLIR One for Android
« Reply #444 on: May 18, 2018, 09:26:20 am »
Hello cynfab,
two years later it's nice to hear from you in this thread.
It was a great piece of work together.
:-+

Offline careyer

  • Newbie
  • Posts: 8
  • Country: de
Re: Question about FLIR One for Android
« Reply #445 on: May 18, 2018, 09:35:25 am »
Hi tomas123,

thanks man for your awesome and detailed reply.
I am happy to hear that despite to the error message the connection between F1G2 and Pi0 seems to be rock solid. That is brilliant news!

I have already tried to have a look to the c Sources but I am somewhat too dump to do it. It has been years and years since I did some Java coding (back then at university) but somewhat my brain is not made for coding - c in particular scares the death out of me . That is a major drawback I have  |O  :palm:
I really would not ask for help if I could somehow manage to do it myself.

It would be a dream come true to have a version that allows at runtime for:
  • manual FFC
  • change color palette

Maybe the two of you (cynfab and you) can team up again to add this final step and make it perfect?
So much thanks in advance from me and the Bambis
Cheers!
Thomas

P.S: That is how the integration into EZ-WifiBroadcast looks like! Man I can't thank you enough for making this driver reality.
(Looks like the Pi is connected to the TV in this video but it is not. It transmits wireless to a 2nd Pi which is behind the TV ;-)) BTW - My wife was incredibly pissed off that she could not watch her Sex and the City DVD for days and days of debugging. haha ;D

« Last Edit: May 18, 2018, 09:53:53 am by careyer »
 

Offline cynfab

  • Regular Contributor
  • *
  • Posts: 175
  • Country: us
Re: Question about FLIR One for Android
« Reply #446 on: May 18, 2018, 01:05:31 pm »
Hi tomas123!
Good to hear from you as well, I read this forum every day (almost), but too many other projects lead to less attention to each ;>((
I wish I could find half of the "good deals" that Fraser finds, he as a talent for sniffing out some of the best thermal camera bargains there are.
I know I posted the link to my 3DR Solo with Flir One G2, but here it is again in case anyone didn't see it:


caryer, I'l like more details on your drone setup, FC, frame, flight time carrying capacity etc. it looks like s nice one.

It's never too late to learn more coding...


Hello cynfab,
two years later it's nice to hear from you in this thread.
It was a great piece of work together.
:-+
 

Offline careyer

  • Newbie
  • Posts: 8
  • Country: de
Re: Question about FLIR One for Android
« Reply #447 on: May 18, 2018, 01:33:32 pm »
@cynfab
Your side-by-side integration into the Solo-App looks sweet man! :-+

here are a few basic data about the "Predator" drone as requested. It has been a 2year DIY project.

Frame: folding frame milled from aircraft grade aluminum and carbon, retractable landing gear (completely DIY, collapses down to the size of a Phantom when folded)
Propulsion System: DJI E1200 Pro, 17" Props (max 4,8kW, combined 16kg Thrust)
FC: 3DR Pixhawk
Controlsystem: EZ-Wifibroadcast (modified, bidirectional 2,4Ghz Link: FullHD-Video + Thermal Downlink, Control Uplink via MavLink/Serial,
Range ~8km - no boosters, no directional antennae, no tracking required) - so to say DJI Lightbridge 2 for a budget! (and more versatile) ;)
Camera: Raspberry Camera with switchable IR-Filter + FlirOne G2
Battery: 6S 20.000mAh (2,4kg)
AUW: 4,6kg
Lifting capacity: plenty! ;) (but 5kg weight limit in Germany, oh man...)
Flighttime: approx. 45-50min
very silent in flight and absolutely robust against wind gusts and outside influences

Sure! It's never too late to learn coding. I tried several times (Java and Java ME) but when it comes to C i miserably failed - I tried more than once. :palm:
(Obviously I'm more of a craftsman).
Therefore any help from you guys would be greatly appreciated - really!
In exchange I can get you kick started with the EZ-Wifibroadcast integration if that is of any interest to you - or donate some beer!?  :popcorn:



« Last Edit: May 18, 2018, 02:00:37 pm by careyer »
 

Online Fraser

  • Super Contributor
  • ***
  • Posts: 13165
  • Country: gb
Re: Question about FLIR One for Android
« Reply #448 on: May 18, 2018, 04:12:16 pm »
Confab,

You will be pleased to hear that I am no longer actively hunting thermal cameras 🙂

If there are any bargains out there, you will not have me competing with you to buy them 👍

I actually sold some of my collection and more will follow I feel sure. I hit saturation point !

Best Wishes

Fraser
« Last Edit: May 18, 2018, 04:14:00 pm by Fraser »
If I have helped you please consider a donation : https://gofund.me/c86b0a2c
 

Offline da-nie

  • Contributor
  • Posts: 44
  • Country: ru
Re: Question about FLIR One for Android
« Reply #449 on: May 26, 2018, 07:17:53 pm »
I developed a thermal imager based on stm32f407vgt6. Dysplay with hx8347d controller 320x240. Flir Lepton 3 unit. Flir lepton board.

Connecting Display Contacts:

D0 - PD14
D1 - PD15
D2 - PD0
D3 - PD1
D4 - PE7
D5 - PE8
D6 - PE9
D7 - PE10
CS - PD7 (FSMC_NE1)
RW - PD5 (FSMC_NWE)
RD - PD4 (FSMC_NOE)
RS - PD11 (FSMC_A16)
RESET - PE1

Connecting lepton board Contacts:
SCK - PA5
MISO - PA6
MOSI - GND
CS - GND
SCL - PB6
SDA - PB7

Programm for Keil 5 and Cube MX: https://github.com/da-nie/STM32F407VGT6AndFlirLepton3
« Last Edit: June 02, 2018, 04:49:12 pm by da-nie »
 
The following users thanked this post: carpin, newex


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf