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.