SEVERE: Error sending touch event
Hi, thanks for this awesome tool!
I tried to connect to my android phone with broken screen. It shows the screen, but when I interact with it, I get error in the terminal.
SEVERE: Error sending touch event: 80 1540 UP
java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)
at java.io.BufferedWriter.flush(BufferedWriter.java:253)
at com.android.chimpchat.ChimpManager.sendMonkeyEventAndGetResponse(ChimpManager.java:187)
at com.android.chimpchat.ChimpManager.sendMonkeyEvent(ChimpManager.java:235)
at com.android.chimpchat.ChimpManager.touchUp(ChimpManager.java:100)
at com.android.chimpchat.adb.AdbChimpDevice.touch(AdbChimpDevice.java:364)
at de.nsvb.monkeyremote.MonkeyRemote$GestureListener.sendTouchEvent(MonkeyRemote.java:209)
at de.nsvb.monkeyremote.MonkeyRemote$GestureListener.mouseReleased(MonkeyRemote.java:185)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
For me this problem only occurs if my screen is off and it doesn't wake up automatically.
The broken pipe error sounds like a broken connection to your phone but as I understand you're still seeing your phones screen?
@ns130291
but as I understand you're still seeing your phones screen?
Yes that happens to me also. 1/3 or 1/2 of the times I have to restart program to get touch working. Even if screen view works.
Would it be easy enough to catch the broken pipe error and reset the connection or something like that? Are there two connection? Because the screen view is still working at that time.
Sometimes, screen view freezes though.
reset the connection or something like that?
That would also handle the pipe breaking due to screen locking.
@tuxayo please try version v0.5: https://github.com/ns130291/MonkeyRemote/releases/tag/v0.5 I implemented a automatic restart if the connection breaks. Just trying to reestablish the connection didn't work, it seems it has to be completely restartet.