more Raspberry Pi 4 FLIR test

Feb 09, 2022 Last reply: 4 years ago 1 Replies

On a sunny day (Fri, 04 Feb 2022 10:34:09 GMT) it happened Jan Panteltje snipped-for-privacy@yahoo.com wrote in <stivij$6f1$ snipped-for-privacy@dont-email.me:


More Raspberry Pi 4 FLIR

I added some more code, and now you can specify a window in the FLIR output screen where to look for temperatures > or < some limit. and that will call a script named 'flir_alarm_script' that you can then write to do anything in case of alarm. Also added yuv output to stdout that you can read with mplayer or convert on the fly to any video format with ffmpeg. New color scheme, and an optional color range bar on the left.


New name: xflir

formatting link
More command line options come to mind.


It is still based on input required from the pimoroni/mlx90640-library-master/examples/step program.


# xflir -h Usage: mlx90640-library-master/examples/step | xflir [options] options are:


-a show temperature in each pixel, default off


-b int brightness in percent range 0-100, default 100


-e string alarm_script, will be executed upon alarm condition


-f float start_temperature, default 20.0



-h help, this help



-j int detection_window_x_start, default 0



-k int detection_window_x_end, default 23



-l int detection_window_y_start,default 0



-m int detection_window_y_end, default 31



-n detection level negative going, so alarm if temperature drops below setpoint set with -o, default positive



-o float detection_window_threshold, default 30.0



-p set alarm active flag, default off



-s int saturation in percent range 0-100 default 100



-t float end_temperature, default 45.0



-v int verbose level, default off



-x show temperature bar with temperatures on the left, default off



-y yuv format output to stdout



-z temperature text foreground white Examples: show colors between 20 and 40 degrees C xflir -f 20 -t 40 show temperature from 20 C to 33 C in each pixel mlx90640-library-master/examples/step | xflir -f 20.0 -t 33.0 -a alarm detection on alarm windows specified and yuv format output to file mlx90640-library-master/examples/step | xflir -f 20.0 -t 33.0 -j 10 -k 20 -l 20 -m 31 -o 29.0 -e flir_alarm_script -x -y -p 1>file.yuv mlx90640-library-master/examples/step | xflir -f 20.0 -t 33.0 -j 10 -k 20 -l 20 -m 31 -x -y | ffmpeg -i - -vcodec libx264 -y file.avi



By now should make a decent link on the website..., thing is still less than 25 kByte in size Raspberry P4 only, will not compile on X86 without changes. My code is GPL licensed



Example of flir_alarm_script: #!/bin/bash echo "FLIR ALARM" aplay -D hw:1,0 warn.wav mpg123 -a hw:1,0 far_infrared_alarm.mp3 echo "FLIR ALARM" | netcat -q 0 192.168.178.69 1112 exit 0


Note the use of 'netcat', the soluion to all networking ;-)



On the receiving site, (any where in the world) run: while [ 1 ] ; do netcat -l -p 1112 ; sleep 1 ; done Of course that can be a script doing anything too.



Now next is to mount it on the space laser and look for F35s

formatting link
Picture using alarm window:
formatting link



xflir-0.2 released Complete rewrite of xflir now stand alone code, also compiles on other Linux systems with gcc.

formatting link
Tested on Raspberry Pi4

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required