看起来UsbManager在构建中消失了.我们现在如何与USB外围设备通信?
像usb-> serial等使用https://github.com/mik3y/usb-serial-for-android
我正在浏览Android的示例程序,我在那里找到了2个.
一个人在拥有<category android:name="android.intent.category.LAUNCHER" />,另一个在拥有<category android:name="android.intent.category.IOT_LAUNCHER"/>,那么两者之间的基本差异是什么?
找不到如何从相机拍摄单张照片的方法.
使用图像阅读器并使用TEMPLATE_STILL_CAPTURE发送捕获请求时,应用程序只在此处停止,不再发生任何事情.
试过我的代码,思想问题就在那里.但是在尝试了门铃教程之后,同样的事情发生了.我得到的是最后一条日志消息:"会话初始化".在15分钟内再次按下按钮后:"CAMERA_ERROR(3):waitUntilIdle:777:摄像机0:等待排空错误:连接超时(-110)".
有人遇到过这个问题吗?它可以修复吗?或者只需要等待下一个版本的android-things
PS:当预览相机到表面视图时,一切正常,所以它不应该是相机的问题
我正在尝试从simplepio实现按钮示例.我已经如原理图所示建立了连接.按下按钮后,我没有得到GPIO回调.
我使用的代码与示例代码相同.没有例外,只有"启动活动"在日志中打印
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "Starting ButtonActivity");
PeripheralManagerService service = new PeripheralManagerService();
try {
String pinName = BoardDefaults.getGPIOForButton();
mButtonGpio = service.openGpio(pinName);
mButtonGpio.setDirection(Gpio.DIRECTION_IN);
mButtonGpio.setEdgeTriggerType(Gpio.EDGE_FALLING);
mButtonGpio.registerGpioCallback(new GpioCallback() {
@Override
public boolean onGpioEdge(Gpio gpio) {
Log.i(TAG, "GPIO changed, button pressed");
// Return true to continue listening to events
return true;
}
});
} catch (IOException e) {
Log.e(TAG, "Error on PeripheralIO API", e);
}
}
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试了什么:
通过使用以下代码运行python按钮程序,验证电路和按钮是否正常工作
raspbian jessie
#!/usr/bin/env python
import …Run Code Online (Sandbox Code Playgroud)我希望更改运行Android Things OS的Raspberry Pi3板的以太网IP地址.目前,它会自动获取连接网络中可用的IP地址.但我希望为设备分配固定/静态IP.是否可以使用ADB设置静态IP?
昨天我开始了一个Android Things项目,我正在使用Android Studio测试应用程序.为了使用连接到设备adb.exe,我使用了我在默认操作系统的应用程序(开始屏幕)上看到的Android设备的IP.所以,在昨天的测试之后,我的应用程序现在似乎是默认的应用程序,即使我没有连接到PC.
问题是现在我看不到设备的IP地址,所以我可以使用它连接到它adb.exe.
有没有办法回到默认操作系统的应用程序?
PS.我找到的唯一解决方案是重新安装Android Things OS.
我可以为Brillio找到git repository/branch但是没有单独的Android东西.是不是尚未开源或公开发布?
我正在尝试在 Android Things 的帮助下制作一个模块。我需要借助 GSM/GPRS 调制解调器通过互联网将温度和压力读数发送到服务器。我正在将 Raspberry Pi 3 与 AndroidThings SDK 一起使用。我能够在 BMP 280 传感器的帮助下获得温度和压力读数,但必须使用外部 GSM 调制解调器将数据发送到服务器。是否可以将 GSM 调制解调器与 Android Things (Raspberry pi 3) 集成?由于我是 Android Things 和 IoT 的新手,我从哪里可以获得学习和执行此操作的资源?
我正在尝试将USB大容量存储设备安装到运行android的Raspberry Pi上.我遇到了这个答案,它展示了如何使用命令行ADB shell安装它.但问题是每次我的设备启动时都必须运行这些命令.我想在onCreate()我的发布活动中安装USB驱动器.这是代码:
//Here is the mount drive function which I called in onCreate of my activity.
private void mountDrive() throws IOException, InterruptedException {
Process mProcess = Runtime.getRuntime().exec("/system/xbin/su");
BufferedReader reader = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));
DataOutputStream dos = new DataOutputStream(mProcess.getOutputStream());
dos.writeBytes("mkdir /mnt/usb\n");
dos.flush();
dos.writeBytes("mount -t vfat -o rw /dev/block/sda1 /mnt/usb\n");
dos.flush();
dos.writeBytes("exit\n");
//Read the response
String line, result = "";
while ((line = reader.readLine()) != null) {
result += line;
Log.d("CMD","RESULT:"+result);
}
reader.close();
dos.flush();
dos.close();
mProcess.waitFor();
} …Run Code Online (Sandbox Code Playgroud) 我有一个 USB 加密狗,它通过 USB 使用以太网作为网络适配器。在 Ubuntu 上,它使用 usbnet 驱动程序,一旦我插入加密狗,操作系统就会识别它并获得一个新的网络接口。但是,在 Android Things 上,它只能被识别为 USB 设备。
我安装了 busybox 并尝试使用 modprobe 来激活 g_ether 或 usbnet 但 modprobe 抱怨/lib/modules不存在。此外,我尝试使用 lsmod 命令找出哪些驱动程序处于活动状态,但 lsmod 也不起作用,因为/proc/modules它不存在。
我找到了目录/sys/module/usb_f_rndis,/sys/bus/usb/drivers/cdc_ether这让我相信应该可以通过 USB 功能以某种方式激活以太网。
有没有人有在 Android Things 上通过 USB 使用以太网的经验?任何人都可以指导我完成激活必要驱动程序以使其工作的过程吗?我必须重建内核吗?感谢您提供的任何建议。
android-things ×10
android ×6
driver ×1
git-repo ×1
gsm ×1
iot ×1
linux ×1
raspberry-pi ×1
usb-drive ×1