I am trying to get the MPL3115A2 working with my Raspberry Pi B+. I seem to be missing something. I got the ic2detect showing and output which I think is good. Also lsmod is displaying good info.
pi@rpi ~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@rpi ~ $ lsmod | grep i2c_
i2c_dev 6709 0
i2c_bcm2708 6200 0
Install arduino and make sure it is up to date.
pi@rpi ~ $ sudo apt-get install arduino
Reading package lists... Done
Building dependency tree
Reading state information... Done
arduino is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Then I follow the directions on this link.
https://github.com/adafruit/Adafruit_MPL3115A2_Library
Download the zip.
pi@rpi cp Adafruit_MPL3115A2_Library-master.zip ~/sketchbook/library/
pi@rpi ~ $ cd ~/sketchbook/library/
pi@rpi ~/sketchbook/library $ unzip Adafruit_MPL3115A2_Library-master.zip
pi@rpi ~/sketchbook/library $ mv Adafruit_MPL3115A2_Library_master Adafruit_MPL3115A2
pi@rpi ~/sketchbook/library $ cd
pi@rpi ~ $ find . -name Adafruit_MPL3115A2.h
./sketchbook/library/Adafruit_MPL3115A2/Adafruit_MPL3115A2.h
pi@rpi ~ $ find . -name Adafruit_MPL3115A2.cpp
./sketchbook/library/Adafruit_MPL3115A2/Adafruit_MPL3115A2.cpp
But when I try to compile the code with arduino IDE I get that testmpl3115a2.cpp: fatal error Adafruit_MPL3115A2.h no such file or directory.
I must have missed some thing, but not sure what.
Thanks for your help.
Doug
complie error of arduino IDE for MPL3115A2
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: complie error of arduino IDE for MPL3115A2
Check the Arduino IDE's preferences to make sure it isn't looking for the sketchbook somewhere else.
- slugstone
- Posts: 5
- Joined: Fri Jul 24, 2015 10:14 am
Re: complie error of arduino IDE for MPL3115A2
I have the preferences: sketchbook location at: /home/pi/sketchbook.
I missed some information.
I opened ARDUINO then selected File -> Sketchbook -> library -> Adafruit_MPL3115A2 -> testmpl3115a2 which then brings up its own window. I then choose the verify button and get the fatal error.
I missed some information.
I opened ARDUINO then selected File -> Sketchbook -> library -> Adafruit_MPL3115A2 -> testmpl3115a2 which then brings up its own window. I then choose the verify button and get the fatal error.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: complie error of arduino IDE for MPL3115A2
Post the exact error messages you're getting please. So far it looks like you're doing everything right, and shouldn't be getting the error.
- slugstone
- Posts: 5
- Joined: Fri Jul 24, 2015 10:14 am
Re: complie error of arduino IDE for MPL3115A2
Here is a screen shot since I can not figure out to copy the error message.
pi@rpi ~/sketchbook/library $ md5sum Adafruit_MPL3115A2_Library-master.zip
d5e42a9210b688fedeaddcbe61a3156d Adafruit_MPL3115A2_Library-master.zip
pi@rpi ~/sketchbook/library $ md5sum Adafruit_MPL3115A2_Library-master.zip
d5e42a9210b688fedeaddcbe61a3156d Adafruit_MPL3115A2_Library-master.zip
- slugstone
- Posts: 5
- Joined: Fri Jul 24, 2015 10:14 am
Re: complie error of arduino IDE for MPL3115A2
In thinking it might be a problem with my setup. I did the following:
pi@rpi ~ $ sudo apt-get purge arduino
...
pi@rpi ~ $ rm -rf .arduino
pi@rpi ~ $ rm -rf Adafruit-Raspberry-Pi-Python-Code
Then I reinstalled
pi@rpi ~ $ sudo apt-get install arduino
still the same problem of not finding the header file.
Looking at the .arduino/preferences.txt file I found two files of interest.
pi@rpi ~ $ grep console .arduino/preferences.txt |grep file
console.error.file=stderr.txt
console.output.file=stdout.txt
pi@rpi ~ $ find / -name stdout.txt 2>/dev/null
/tmp/console6285452768283523327.tmp/stdout.txt
pi@rpi ~ $ cat /tmp/console6285452768283523327.tmp/stdout.txt
Nothing here.
pi@rpi ~ $ find / -name stderr.txt 2>/dev/null
/tmp/console6285452768283523327.tmp/stderr.txt
pi@rpi ~ $ cat /tmp/console6285452768283523327.tmp/stderr.txt
testmpl3115a2.cpp:23:32: fatal error: Adafruit_MPL3115A2.h: No such file or directory
compilation terminated.
Well at least I know where to look for the error message.
pi@rpi ~ $ find / -name Adafruit_MPL3115A2.h 2>/dev/null
/home/pi/sketchbook/library/Adafruit_MPL3115A2/Adafruit_MPL3115A2.h
I can find the file. :-( Now I am wondering where arduino is looking?
pi@rpi ~ $ sudo apt-get purge arduino
...
pi@rpi ~ $ rm -rf .arduino
pi@rpi ~ $ rm -rf Adafruit-Raspberry-Pi-Python-Code
Then I reinstalled
pi@rpi ~ $ sudo apt-get install arduino
still the same problem of not finding the header file.
Looking at the .arduino/preferences.txt file I found two files of interest.
pi@rpi ~ $ grep console .arduino/preferences.txt |grep file
console.error.file=stderr.txt
console.output.file=stdout.txt
pi@rpi ~ $ find / -name stdout.txt 2>/dev/null
/tmp/console6285452768283523327.tmp/stdout.txt
pi@rpi ~ $ cat /tmp/console6285452768283523327.tmp/stdout.txt
Nothing here.
pi@rpi ~ $ find / -name stderr.txt 2>/dev/null
/tmp/console6285452768283523327.tmp/stderr.txt
pi@rpi ~ $ cat /tmp/console6285452768283523327.tmp/stderr.txt
testmpl3115a2.cpp:23:32: fatal error: Adafruit_MPL3115A2.h: No such file or directory
compilation terminated.
Well at least I know where to look for the error message.
pi@rpi ~ $ find / -name Adafruit_MPL3115A2.h 2>/dev/null
/home/pi/sketchbook/library/Adafruit_MPL3115A2/Adafruit_MPL3115A2.h
I can find the file. :-( Now I am wondering where arduino is looking?
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: complie error of arduino IDE for MPL3115A2
Ah.. it's a spelling error:
should be:
Code: Select all
/home/pi/sketchbook/library
Code: Select all
/home/pi/sketchbook/libraries
- slugstone
- Posts: 5
- Joined: Fri Jul 24, 2015 10:14 am
Re: complie error of arduino IDE for MPL3115A2
Wow thanks that did it.
For a recap I should have done it with these commands
pi@rpi cp Adafruit_MPL3115A2_Library-master.zip ~/sketchbook/libraries/
pi@rpi ~ $ cd ~/sketchbook/libraries/
pi@rpi ~/sketchbook/libraries $ unzip Adafruit_MPL3115A2_Library-master.zip
pi@rpi ~/sketchbook/libraries $ mv Adafruit_MPL3115A2_Library_master Adafruit_MPL3115A2
Thanks
For a recap I should have done it with these commands
pi@rpi cp Adafruit_MPL3115A2_Library-master.zip ~/sketchbook/libraries/
pi@rpi ~ $ cd ~/sketchbook/libraries/
pi@rpi ~/sketchbook/libraries $ unzip Adafruit_MPL3115A2_Library-master.zip
pi@rpi ~/sketchbook/libraries $ mv Adafruit_MPL3115A2_Library_master Adafruit_MPL3115A2
Thanks
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: complie error of arduino IDE for MPL3115A2
Glad to hear it's working for you.
Spelling errors, especially variants on the same word, are some of the hardest for humans to find. We filter out details and focus on meanings, where computers just look for specific patterns of symbols.
Spelling errors, especially variants on the same word, are some of the hardest for humans to find. We filter out details and focus on meanings, where computers just look for specific patterns of symbols.
- diatomicdarragh
- Posts: 1
- Joined: Wed Apr 27, 2016 9:35 am
Re: complie error of arduino IDE for MPL3115A2
Help please my adafruit mpl3115a2 sensor wont work when bus.read_byte_data(address,0x01) is run the following error crops up Errno 5 input/output error and ive ensured all modules are updated
Please be positive and constructive with your questions and comments.