Jump to content

Recommended Posts

Posted

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?

 

Posted

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

Posted

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.

Posted

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.

Posted
I tested this cord.
 
 
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.
 

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
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines