Android 无法使用 AVRDUDE 与 Arduino 通话 [英] Android cannot talk to Arduino using AVRDUDE

查看:23
本文介绍了Android 无法使用 AVRDUDE 与 Arduino 通话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android 上使用 AVRDUDE (http://code.google.com/p/andavr/).我可以编译 C 代码.我可以跑

I am using AVRDUDE for Android (http://code.google.com/p/andavr/). I can compile the C code. I can run

$ avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o led.o led.c
$ avr-gcc -mmcu=atmega328p led.o -o led
$ avr-objcopy -O ihex -R .eeprom led led.hex

一切都没有问题.然后我尝试运行:

all without issues. Then I try to run:

avrdude -F -V -c arduino -p ATMEGA328P -P /dev/bus/usb/002/002  -b 115200 -C /data/data/jackpal.androidterm/local/etc/avrdude.conf -U flash:w:led.hex

结果是:

avrdude: ser_open(): can't open device "/dev/bus/usb/002/002"; Permission denied
loctl("TIOCMGET"): Invalid argument

avrdude done. Thank you.

我跑的时候情况类似:

avrdude -F -V -c arduino -p ATMEGA328P -P /dev/bus/usb/002/001  -b 115200 -C /data/data/jackpal.androidterm/local/etc/avrdude.conf -U flash:w:led.hex

我可以确认/dev/bus/usb/002/002是连接到OTG 电缆.在连接之前,我运行

I can confirm that /dev/bus/usb/002/002 is the Arduino device connected with the OTG cable. Before connecting, I run

ls -l /dev/bus/usb/002/

我得到:

total 0

通过 USB 将 Arduino 连接到平板电脑后,我运行以下命令:

After I connect the Arduino via USB to my tablet I run the command:

ls -l /dev/bus/usb/002

我明白了

crw-rw----   1 0   1018  180,128 Mar 24 07:53 001
crw-rw----   1 0   1018  180,129 Mar 24 07:53 002

这清楚地向我展示了 Arduino 已连接.我很想知道是否有人能看到我做错了什么.

This clearly shows me that the Arduino is connected. I would love to know if anyone can see what I am doing wrong.

PS:我正在尝试创建一个允许直接从 Android 平板电脑进行 Arduino 编程的 Android 应用程序.

PS: I am trying to create an Android application that allows Arduino programming directly from an Android tablet.

推荐答案

它说权限被拒绝"并且您似乎没有使用 root shell.尝试su",然后尝试失败的命令.如果你的手机没有root,我认为它不能工作.

It says 'permission denied' and you do not seem to be using a root shell. Try 'su' and then the command that failed. If your phone is not rooted, I don't think it could work.

我什至不确定当你是 root 时它是否会正常工作,所以请发布结果!我的猜测是,如果您的手机不充当 USB 主机,则不会(只有某些可以)

I'm not even sure if it will work right when you are root, so please post the result! My guess is that it won't if your phone does not act as usb host (only some can)

这篇关于Android 无法使用 AVRDUDE 与 Arduino 通话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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