Don Posted July 3, 2016 Posted July 3, 2016 Just started with Orangepi and ARMbian ... ARMbian is a very nice OS. Especially since there's a RAW image for Orange pi! Thanks! I've got two DS18B20 working perfectly with my Orange pi pc! But now I've troubles with the BMP085 /BMP180. With my old Raspberry pi it was pretty easy, but how can I get the BMP180 running? I 've read there are modules for ARMbian, but I've read as well I've got to compile my own module. Does anybody know where can I find the files /module to load or compile?
Don Posted July 3, 2016 Author Posted July 3, 2016 And... it works "out of the box" ... For those who are interested: Python script (for use with www.metern.org): #!/usr/bin/python from Adafruit_BMP085 import BMP085 bmp = BMP085(0x77) temp = bmp.readTemperature() pressure = bmp.readPressure() altitude = bmp.readAltitude() print "8(%.2f*hPa)" % (pressure / 100.0) #print "Altitude: %.2f" % altitude Gpio pins used: 1 / 3 / 5 / 6
nopnop2002 Posted July 5, 2016 Posted July 5, 2016 When you use the following library, it doesn't work in OPI. https://github.com/adafruit/Adafruit_Python_BMP.git Because this library uses Adafruit Python GPIO Library. Adafruit Python GPIO Library is dependent on RPi.GPIO libraries.
martinayotte Posted July 5, 2016 Posted July 5, 2016 You probably simply need to install the https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 version first, and then Adafruit's ones.
nopnop2002 Posted July 6, 2016 Posted July 6, 2016 You probably simply need to install the https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 version first, and then Adafruit's ones. Adafruit Python GPIO Library provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO libraries. This library is checking a platform.(Raspberry Pi/Beaglebone) . And python-smbus is used for i2c control. I think it's very difficult to work this library in OPI.
martinayotte Posted July 6, 2016 Posted July 6, 2016 But the library that I've provided link above has I2C included as pyA20.i2c, I'm using it without any problem. As you said, it is probably the code checking for dependencies that need to be tweaked.
nopnop2002 Posted July 11, 2016 Posted July 11, 2016 I tested this cord. https://www.raspberrypi.org/forums/viewtopic.php?t=16968&p=233656 It work fine By both of RPI and OPI.(OPI-ONE) pi@raspberrypi ~/BMP085 $ sudo ./testBMP085 Temperature 83.1 *F Pressure 1004.29 hPa Altitude 370.7 Feet orangepi@orangepione:~/BMP085$ sudo ./testBMP085 Temperature 83.7 *F Pressure 1004.39 hPa Altitude 367.5 Feet smbus.c/smbus.h is here. https://www.john.geek.nz/2012/12/update-reading-data-from-a-bosch-bmp085-with-a-raspberry-pi/ You have to modify a source. <testBMP085.c> #include <stdio.h> #include <stdint.h> #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #include <linux/i2c-dev.h> #include <linux/i2c.h> #include <sys/ioctl.h> #include "smbus.h" #include <math.h> cc -o testBMP085 ./smbus.c ./testBMP085.c -lm
Recommended Posts