0

Warning. Really long post.

Hi. I’ve been having problems in getting my MLX90640 thermal camera to work on my Raspberry Pi Zero W.

I’ve connected the camera to Pins 1,3,5,7,9 as instructed.

I then followed the following instructions. The bits in bold are my inputs and the bits in italic are the reply from the computer. I’ll leave a link to the instructions below.

Link to the instructions:

https://github.com/pimoroni/mlx90640-library

BCM2835 Library Mode

First I installed the BCM Library

**wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.55.tar.gz**

*--2019-02-03 07:23:41--  http://www.airspayce.com/mikem/bcm2835/bcm2835-1.55.tar.gz
Resolving www.airspayce.com (www.airspayce.com)... 64:ff9b::c0b9:30bb, 192.185.48.187
Connecting to www.airspayce.com (www.airspayce.com)|64:ff9b::c0b9:30bb|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 261028 (255K) [application/x-gzip]
Saving to: ‘bcm2835-1.55.tar.gz.1’
bcm2835-1.55.tar.gz 100%[===================>] 254.91K   213KB/s    in 1.2s
2019-02-03 07:23:43 (213 KB/s) - ‘bcm2835-1.55.tar.gz.1’ saved [261028/261028]*

**tar xvfz bcm2835-1.55.tar.gz**

*bcm2835-1.55/
bcm2835-1.55/configure.ac
bcm2835-1.55/COPYING
bcm2835-1.55/examples/
bcm2835-1.55/examples/spi/
bcm2835-1.55/examples/spi/spi.c
bcm2835-1.55/examples/input/
bcm2835-1.55/examples/input/input.c
bcm2835-1.55/examples/event/
bcm2835-1.55/examples/event/event.c
bcm2835-1.55/examples/pwm/
bcm2835-1.55/examples/pwm/pwm.c
bcm2835-1.55/examples/gpio/
bcm2835-1.55/examples/gpio/gpio.c
bcm2835-1.55/examples/blink/
bcm2835-1.55/examples/blink/blink.c
bcm2835-1.55/examples/spin/
bcm2835-1.55/examples/spin/spin.c
bcm2835-1.55/examples/i2c/
bcm2835-1.55/examples/i2c/i2c.c
bcm2835-1.55/config.guess
bcm2835-1.55/NEWS
bcm2835-1.55/depcomp
bcm2835-1.55/configure
bcm2835-1.55/aclocal.m4
bcm2835-1.55/compile
bcm2835-1.55/INSTALL
bcm2835-1.55/Makefile.in
bcm2835-1.55/missing
bcm2835-1.55/config.sub
bcm2835-1.55/Makefile.am
bcm2835-1.55/ChangeLog
bcm2835-1.55/README
bcm2835-1.55/install-sh
bcm2835-1.55/config.h.in
bcm2835-1.55/src/
bcm2835-1.55/src/test.c
bcm2835-1.55/src/bcm2835.h
bcm2835-1.55/src/bcm2835.c
bcm2835-1.55/src/Makefile.in
bcm2835-1.55/src/Makefile.am
bcm2835-1.55/ltmain.sh
bcm2835-1.55/AUTHORS
bcm2835-1.55/doc/
bcm2835-1.55/doc/Doxyfile.in
bcm2835-1.55/doc/Makefile.in
bcm2835-1.55/doc/Makefile.am
bcm2835-1.55/test-driver*

**cd bcm2835-1.55**

**./configure**

*checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for clock_gettime in -lrt... yes
checking for doxygen... no
configure: WARNING: Doxygen not found - continuing without Doxygen support
checking for ranlib... ranlib
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands*

**make**

*make  all-recursive
make[1]: Entering directory '/home/pi/bcm2835-1.55'
Making all in src
make[2]: Entering directory '/home/pi/bcm2835-1.55/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making all in doc
make[2]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Leaving directory '/home/pi/bcm2835-1.55'
make[1]: Leaving directory '/home/pi/bcm2835-1.55'*

**sudo make install**

*make  all-recursive
make[1]: Entering directory '/home/pi/bcm2835-1.55'
Making all in src
make[2]: Entering directory '/home/pi/bcm2835-1.55/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making all in doc
make[2]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Leaving directory '/home/pi/bcm2835-1.55'
make[1]: Leaving directory '/home/pi/bcm2835-1.55'
pi@raspberrypi:~/bcm2835-1.55 $ ^C
pi@raspberrypi:~/bcm2835-1.55 $ sudo make install
Making install in src
make[1]: Entering directory '/home/pi/bcm2835-1.55/src'
make[2]: Entering directory '/home/pi/bcm2835-1.55/src'
 /bin/mkdir -p '/usr/local/lib'
 /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
 ( cd '/usr/local/lib' && ranlib libbcm2835.a )
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include'
make[2]: Leaving directory '/home/pi/bcm2835-1.55/src'
make[1]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making install in doc
make[1]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[1]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[1]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55'
make[1]: Leaving directory '/home/pi/bcm2835-1.55'*

And finally I installed the dependencies:

***sudo apt-get install libavutil-dev libavcodec-dev libavformat-dev***

*Reading package lists... Done
Building dependency tree
Reading state information... Done
libavcodec-dev is already the newest version (7:3.2.12-1~deb9u1+rpt1).
libavformat-dev is already the newest version (7:3.2.12-1~deb9u1+rpt1).
libavutil-dev is already the newest version (7:3.2.12-1~deb9u1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.*

**Make**

*make  all-recursive
make[1]: Entering directory '/home/pi/bcm2835-1.55'
Making all in src
make[2]: Entering directory '/home/pi/bcm2835-1.55/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making all in doc
make[2]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Leaving directory '/home/pi/bcm2835-1.55'
make[1]: Leaving directory '/home/pi/bcm2835-1.55'*

**sudo ./test**

*sudo: ./test: command not found*

**sudo ./fbuf**

*sudo: ./fbuf: command not found*

-------------------- Ok. That didn't work --------------------

Because it didn’t work I then tried I2C mode

Generic Linux I2C Mode

Installed library

**sudo apt-get install libi2c-dev**

*Reading package lists... Done
Building dependency tree
Reading state information... Done
libi2c-dev is already the newest version (3.1.2-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.*

Added to /boot/config.txt  under “# Uncomment some or all of these to enable the optional hardware interfaces” to change I2C baudrate as recommended.

dtparam=i2c_arm=on
dtparam=i2c1_baudrate=400000
#dtparam=i2s=on
dtparam=spi=off

Build the MLX90640 library and examples in LINUX I2C mode:

**make clean**

*Making clean in src
make[1]: Entering directory '/home/pi/bcm2835-1.55/src'
test -z "test" || rm -f test
test -z "*~" || rm -f *~
test -z "libbcm2835.a" || rm -f libbcm2835.a
rm -f *.o
test -z "test.log" || rm -f test.log
test -z "test.trs" || rm -f test.trs
test -z "test-suite.log" || rm -f test-suite.log
make[1]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making clean in doc
make[1]: Entering directory '/home/pi/bcm2835-1.55/doc'
test -z "" || rm -f
make[1]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[1]: Entering directory '/home/pi/bcm2835-1.55'
test -z "*~" || rm -f *~*

**make I2C_MODE=LINUX**

*make  all-recursive
make[1]: Entering directory '/home/pi/bcm2835-1.55'
Making all in src
make[2]: Entering directory '/home/pi/bcm2835-1.55/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bcm2835.o -MD -MP -MF .deps/bcm2835.Tpo -c -o bcm2835.o bcm2835.c
mv -f .deps/bcm2835.Tpo .deps/bcm2835.Po
rm -f libbcm2835.a
ar cru libbcm2835.a bcm2835.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libbcm2835.a
make[2]: Leaving directory '/home/pi/bcm2835-1.55/src'
Making all in doc
make[2]: Entering directory '/home/pi/bcm2835-1.55/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.55/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.55'
make[2]: Leaving directory '/home/pi/bcm2835-1.55'
make[1]: Leaving directory '/home/pi/bcm2835-1.55'*

sudo ./test
*sudo: ./test: command not found*

This is all I’ve done. Any ideas of what am I missing? And if you can explain what it does and how it works it would be great.

All the best.

  • You're going to need to state the exact steps you used on the command line. Do you even understand what the difference between the two modes are? Guessing at what to do and blindly typing stuff in is a fools game. You also need to explain how you've wired the device. – stevieb Feb 2 at 22:25
  • OK. I'll delete this question tomorrow and reformulate it giving a step by step explanation of what I did. Unfortunately the instructions do not explain what each mode does so yes I was just trying out to see which could I get to work. I am willing to learn though so any guidance on the matter would be greatly appreciated be it links or even a comment. – Antonio Lambranca Feb 2 at 22:53
  • do not delete the question ..... edit the question instead – jsotola Feb 3 at 2:33
  • Hope this is what you meant – Antonio Lambranca Feb 3 at 13:09
0

you need to cd (cd .. ) back a directory into the mlx90640-library-master/ directory then running make clean and make I2C_MODe=LINUX will create the example programs. You can cd into the python subdirectory and after installing swig (sudo apt-get install swig ) run python setup.py build and then python setup.py install which will create/add python support. an example test.py is provided, which outputs sensor data and a test6.png image generated from the data. If you need python3 support as well/instead use python3 setup.py build and python3 setup.py install you do get some warnings on the python3 version, but it does complete.

  • Thank you for your reply. Unfortunately I only saw it after some help from a friend. Thanks to it I had a look around and found the answer. – Antonio Lambranca Jun 26 at 21:52
0

I finally got it.

You need to follow the bcm2835 installation instructions, then follow these instructions to download the mlx90640 library, Setting up MLX90640, and then run the programs with sudo examples/fbuf per example.

The downloading of the mlx90640 library wasn't in the Git Hub instructions and that's why it wasn't working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.