1

很长一段时间以来,我一直在尝试通过 Telnet 将字符串从 android 应用程序发送到 esp8266。我希望在 arduino IDE 的串行监视器上看到输出。我使用了从发送字符串到 esp8266 的代码,通过 android 使用 telnet

这是我在连接连接和发送按钮时运行我的 android 代码的日志。

01/18 20:02:32: Launching app
Cold swapped changes.
$ adb shell am start -n "com.example.manveenkaur.optimized/com.example.manveenkaur.optimized.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 9556 on device samsung-sm_e700h-268ada67
I/InstantRun: Instant Run Runtime started. Android package is com.example.manveenkaur.optimized, real application class is null.
D/SecWifiDisplayUtil: Metadata value : none
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/PhoneWindow: *FMB* installDecor mIsFloating : false
D/PhoneWindow: *FMB* installDecor flags : -2139029248
D/ViewRootImpl: Buffer Count from app info with  ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build:  (I716aebe4f9)
              OpenGL ES Shader Compiler Version: E031.25.03.04
              Build Date: 07/01/15 수
              Local Branch: AU_LINUX_ANDROID_LA.BR.1.1.3_RB1.05.01.00.032.031_02060873_02063264
              Remote Branch: 
              Local Patches: 
              Reconstruct Branch: 
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096
D/OpenGLRenderer: Enabling debug mode 0
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@1e34142f time:924988396
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: Buffer Count from app info with  ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN`

1.我无法解决此ACTION_DOWN声明

2.我也想知道`Buffer Count from app info with ::-1 && -1 for :: com.example.manveenkaur.optimized from View :: -1 DBQ Enabled ::false false 是什么意思

3.进一步点击断开连接它向我显示以下内容:-

W/System.err: java.io.IOException: BufferedInputStream is closed
W/System.err:     at java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:125)
W/System.err:     at java.io.BufferedInputStream.read(BufferedInputStream.java:257)
W/System.err:     at java.io.BufferedInputStream.read(BufferedInputStream.java:290)
W/System.err:     at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:98)
W/System.err:     at org.apache.commons.io.input.TeeInputStream.read(TeeInputStream.java:127)
W/System.err:     at java.io.InputStreamReader.read(InputStreamReader.java:231)
W/System.err:     at java.io.BufferedReader.fillBuf(BufferedReader.java:145)
W/System.err:     at java.io.BufferedReader.readLine(BufferedReader.java:397)
W/System.err:     at com.example.manveenkaur.optimized.PioneerController$1.run(PioneerController.java:41)
W/System.err:     at java.lang.Thread.run(Thread.java:818)  

还有这里的activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.manveenkaur.optimized.MainActivity">


    <EditText
        android:id="@+id/EditTextMessage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:hint="@string/message"
        android:inputType="text"></EditText>

    <Button
        android:id="@+id/sendButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/send_button_text"></Button>

    <Button
        android:id="@+id/connectButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/connect_button_text"></Button>

    <Button
        android:id="@+id/disconnectButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/disconnect_button_text"></Button>
</LinearLayout>
</FrameLayout>
4

1 回答 1

0

预先提出一个问题:您是使用 SoftwareSerial 还是 HardwareSerial 与 ESP8266 通信?使用 SoftwareSerial 不会让你开心。

于 2017-01-18T15:29:01.240 回答