I haven't tested the sensor or the library, but sometimes when you are using a particular library or a shield/sensor that works with the Arduino UNO it doesn't mean that it will work with Edison in the same way. The reason is because there are some libraries written based on the Arduino MCU architecture. Since the Edison architecture is different it's probably that you will have to write a new library for your sensor.
However, I found in Intel® Download Center a barometric-pressure sensor that has been tested. It uses I2C and according to the test report it has been tested with Edison successfully. You might want to check it. There is a library from Adafruit in the document as well and it seems to be Edison compatible.
I hope this information has been useful for you.
Thanks for the input! The reason I want to try this sensor is because it uses SPI. In another thread (see link below), I talked about the conflict between 2 I2C sensors I have. So I am trying to find another Barometric Sensor with a different interface.
I got the library code by clicking the big green download button on this page,
Or, you can download it form github here,
I also tried the unified library for this sensor,
but got the same error when I tried to import the library,
Invalid library found in C:\Users\wxia\Documents\Arduino\libraries\Adafruit_BMP183_U: Missing 'core-dependencies' from library
So, I was not be able to import the library for Edison (I did try regular Arduino IDE and I can import the library without problem).
Can you tell me what library you imported? Thanks a lot!
I summarized what I did in the following steps:
- I downloaded the Arduino IDE 1.6.0 for Edison. You can download it from here: Intel® Edison Products — Software Downloads
- I downloaded the BMP183 library by clicking the green button from here: Wiring and Test | Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor | Adafruit Learning System
- I uncompressed the Arduino IDE using 7-Zip. Then I uncompressed the zip file which contains the BMP library and renamed the folder as "Adafruit_BMP183".
- Then I copied the library folder in C:\...\arduino-1.6.0+Intel\libraries
- At this point I tried to compile the BMP183test.ino example but I got an error. I needed the "Adafruit_Sensor" library. I founded and downloaded it from here: adafruit/Adafruit_Sensor · GitHub
- I uncompressed it just like the previous library, renamed the folder as "Adafruit_Sensor" and copied it in C:\...\arduino-1.6.0+Intel\libraries
- Now I tried to compile the example code again but I got several error messages regarding a "_delay_ms" definition. To solve this issue I added the next line in the file Adafruit_BMP183.cpp. This file is in C:\...\arduino-1.6.0+Intel\libraries\Adafruit_BMP183
#define _delay_ms(t) delay(t)
I added that line in the 24th line (just above the "#include <SPI.h>" line)
- Then I saved the file and tried to compile the example code again. This time no error messages showed up.
From this point I don't know if the code will work because I don't have the sensor to test it. Please try to follow the steps above in order to know if you are able to compile the library with no errors, then you can test it with your sensor.
I downloaded Arduino IDE 1.6.0 for Edison and the BMP library was imported without issue!
I also followed your instructions to modify Adafruit_BMP183.cpp file and I can compile the BMP183test sketch successfully.
But when I run the sketch on Edison, I got "Ooops, no BMP183 detected ... Check your wiring!" error. I tried the same wiring (using pin 10 through 13) on Arduino UNO and it worked great.
So I tried to configure IO10 to IO13 for SPI connection on Edison by following this (section 11.7),
I got the 'Device or resource busy' error when I run the following command,
root@myedison:~# echo 111 > /sys/class/gpio/export
sh: write error: Device or resource busy
Any idea? Thanks again for the help!
I ignored the 'Device or resource busy' error and just went ahead run all the commands in the following document (section 11.7),
After that, the sensor started working with Edison.
Thanks a lot to DiegoV for the big help!