ch340g 芯片 在安卓上的使用問題 咨詢

下載官方的apk demo, 插入ch340g的板子 系統(tǒng)會提示運行,這個時候后續(xù) 操作是正常的,包括打開、關閉和讀寫。 不正常的是:如果安卓重啟,再次運行demo的時候,注意板子沒有插入動作,這時候app就會報錯,請問有什么辦法可以解決這種情況呢? 謝謝。

問題同上:官方demo,USB一直插在安卓上,打開APP,報錯。查看日志為:

08-24 07:47:54.336: I/art(4208): Not late-enabling -Xcheck:jni (already on)
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.681: D/AndroidRuntime(4208): Shutting down VM
08-24 07:47:54.688: E/AndroidRuntime(4208): FATAL EXCEPTION: main
08-24 07:47:54.688: E/AndroidRuntime(4208): Process: com.example.c6zdh, PID: 4208
08-24 07:47:54.688: E/AndroidRuntime(4208): java.lang.RuntimeException: Unable to create application com.example.c6zdh.MyAppLication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4521)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.access$1500(ActivityThread.java:144)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Handler.dispatchMessage(Handler.java:102)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Looper.loop(Looper.java:135)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.main(ActivityThread.java:5221)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Native Method)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Method.java:372)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
08-24 07:47:54.688: E/AndroidRuntime(4208): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.a(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.UartInit(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.initUSB(MyAppLication.java:62)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.onCreate(MyAppLication.java:31)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?... 9 more


? ? ? ? ? ? ? ? ? ? ? ? ? ?

問題同上:官方demo,USB一直插在安卓上,打開APP,報錯。查看日志為:

08-24 07:47:54.336: I/art(4208): Not late-enabling -Xcheck:jni (already on)
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.681: D/AndroidRuntime(4208): Shutting down VM
08-24 07:47:54.688: E/AndroidRuntime(4208): FATAL EXCEPTION: main
08-24 07:47:54.688: E/AndroidRuntime(4208): Process: com.example.c6zdh, PID: 4208
08-24 07:47:54.688: E/AndroidRuntime(4208): java.lang.RuntimeException: Unable to create application com.example.c6zdh.MyAppLication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4521)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.access$1500(ActivityThread.java:144)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Handler.dispatchMessage(Handler.java:102)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Looper.loop(Looper.java:135)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.main(ActivityThread.java:5221)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Native Method)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Method.java:372)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
08-24 07:47:54.688: E/AndroidRuntime(4208): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.a(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.UartInit(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.initUSB(MyAppLication.java:62)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.onCreate(MyAppLication.java:31)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?... 9 more

? ? ? ? ? ? ? ? ? ? ? ?

您好:

????嘗試使用一下,如下鏈接中的APP,看下使用結(jié)果。

????CH341SER_ANDROID.ZIP下載頁面-江蘇沁恒股份有限公司

????http://www.findthetime.net/download/CH341SER_ANDROID_ZIP.html



引用:

? ? ? ? ? ? ? ? ? ? ? ? ? ?

問題同上:官方demo,USB一直插在安卓上,打開APP,報錯。查看日志為:

08-24 07:47:54.336: I/art(4208): Not late-enabling -Xcheck:jni (already on)
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.677: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.678: D/CH34xAndroidDriver(4208): String.format not match
08-24 07:47:54.681: D/AndroidRuntime(4208): Shutting down VM
08-24 07:47:54.688: E/AndroidRuntime(4208): FATAL EXCEPTION: main
08-24 07:47:54.688: E/AndroidRuntime(4208): Process: com.example.c6zdh, PID: 4208
08-24 07:47:54.688: E/AndroidRuntime(4208): java.lang.RuntimeException: Unable to create application com.example.c6zdh.MyAppLication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4521)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.access$1500(ActivityThread.java:144)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Handler.dispatchMessage(Handler.java:102)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.os.Looper.loop(Looper.java:135)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.main(ActivityThread.java:5221)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Native Method)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at java.lang.reflect.Method.invoke(Method.java:372)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
08-24 07:47:54.688: E/AndroidRuntime(4208): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.controlTransfer(int, int, int, int, byte[], int, int)' on a null object reference
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.a(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at cn.wch.ch34xuartdriver.CH34xUARTDriver.UartInit(Unknown Source)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.initUSB(MyAppLication.java:62)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at com.example.c6zdh.MyAppLication.onCreate(MyAppLication.java:31)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
08-24 07:47:54.688: E/AndroidRuntime(4208): ?... 9 more


? ? ? ? ? ? ? ? ? ? ? ?

?

您好:

????嘗試使用一下,如下鏈接中的APP,看下使用結(jié)果。

????CH341SER_ANDROID.ZIP下載頁面-江蘇沁恒股份有限公司

????http://www.findthetime.net/download/CH341SER_ANDROID_ZIP.html


?

使用官方的APP,重新插拔USB,發(fā)現(xiàn)一直彈出未授權權限。

?


有沒有更換過手機,如果一直不彈出權限,可能是當前系統(tǒng)沒有使能 usb host 造成的。


有沒有更換過手機,如果一直不彈出權限,可能是當前系統(tǒng)沒有使能 usb host 造成的。

?

沒更換過,我們使用的是友善之臂的4412的開發(fā)板,問題是和LZ提到的一樣,重新開機后,USB必須要重新插拔一次才可以使用!

http://www.arm9.net/tiny4412.asp


有沒有更換過手機,如果一直不彈出權限,可能是當前系統(tǒng)沒有使能 usb host 造成的。

?

Android系統(tǒng)支持usb host,我是這么確認支持的,外接無線鼠標和鍵盤,都OK可以使用


? ? ? ? ? ? ? ? ? ? ? ? ? ?


引用:

有沒有更換過手機,如果一直不彈出權限,可能是當前系統(tǒng)沒有使能 usb host 造成的。


?

Android系統(tǒng)支持usb host,我是這么確認支持的,外接無線鼠標和鍵盤,都OK可以使用

? ? ? ? ? ? ? ? ? ? ? ?

您好:

????這樣是只能確保支持OTG,也即USB主機功能,不能保證手機上的Host API support 功能打開,可以參考下列博客:http://blog.csdn.net/jazzsoldier/article/details/71097697



我按照教程查看微信截圖_20171013150227.png

其中哪一條是可以證明的Host API support 功能打開,勞煩大神了


? ? ? ? ? ? ? ? ? ? ? ? ? ?

我按照教程查看微信截圖_20171013150227.png

其中哪一條是可以證明的Host API support 功能打開,勞煩大神了

? ? ? ? ? ? ? ? ? ? ? ?

使用步驟一推薦的APK:USB主機診斷,或者按照步驟二的說明:進入/system/lib ,查看是否有驅(qū)動 libusbhost.so


只有登錄才能回復,可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频