BMP280 ServiceSpecificException:I/O错误(代码5) [英] BMP280 ServiceSpecificException: I/O error (code 5)

查看:91
本文介绍了BMP280 ServiceSpecificException:I/O错误(代码5)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用AndroidThings通过Raspberry Pi 3和BMP280测量温度.

I try to use AndroidThings to measure temperature with Raspberry Pi 3 and BMP280.

3,3V是因为 BMP280规范:

要为电路板供电,请给它提供与微控制器逻辑电平相同的功率

To power the board, give it the same power as the logic level of your microcontroller

然后我要初始化传感器

mTemperatureSensorDriver = new Bmx280SensorDriver("I2C1");

通过执行,我得到了以下证据

And by execution i receive following exeption

Error configuring sensor
    com.google.android.things.pio.PioException: android.os.ServiceSpecificException: I/O error (code 5)
    at com.google.android.things.pio.I2cDeviceImpl.readRegByte(I2cDeviceImpl.java:81)
    at com.google.android.things.contrib.driver.bmx280.Bmx280.connect(Bmx280.java:215)
    at com.google.android.things.contrib.driver.bmx280.Bmx280.<init>(Bmx280.java:193)
    at com.google.android.things.contrib.driver.bmx280.Bmx280.<init>(Bmx280.java:180)
    at com.google.android.things.contrib.driver.bmx280.Bmx280SensorDriver.<init>(Bmx280SensorDriver.java:55)

同样使用5V电源,我也会收到相同的异常.

Also by 5V Power i receive the same exception.

我发现了.但是我不知道如何检查BMP280是否真的通过adb连接到Raspberry.

I have found this. But i have no idea how to check, if the BMP280 is realy connected to Raspberry with adb.

通过自己的测试我通过 device.readRegByte(0xD0)接收到的连接信息相同.

By own testing the connectivity i receive by device.readRegByte(0xD0) the same exeption.

这是否表示BMP280未正确连接?如果是,如何将BMP280与Raspberry正确连接?

Does it mean, that BMP280 is not correctly connected? If yes, how to correctly connect BMP280 with Raspberry?

连接需要电阻吗?

更新

通过将BMP280与标题条焊接解决.

solved by soldering BMP280 with header strip.

还需要与传感器一起使用的权限,该权限只能在命令行中使用.参考

Also to work with sensor is permission requiered that could be granded only in command line. ref

adb shell pm授予app.package com.google.android.things.permission.MANAGE_SENSOR_DRIVERS

推荐答案

要从IoT设备读取数据,应固定接触点,不要松动连接.

To read data from IoT Device, the contact should be fixed without any loose connection.

这只能通过将BMP280与插头条焊接起来来实现

This could be only reached with soldering of BMP280 with header strip

只有这样才能建立连接

这篇关于BMP280 ServiceSpecificException:I/O错误(代码5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆