openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.34k stars 2.78k forks source link

Problem with minitouch on device without touchscreen #599

Open d0c3ntOS opened 7 years ago

d0c3ntOS commented 7 years ago

I need use android device without screen - tests some device. In my case Odrino C2. I think the same problem will by with Raspberry Pi, Banana Pi, Orange Pi, LattePanda etc.

When I start OpenSTF, minitouch doesn't work. Dosen't see any touchscreen and stops working.

Following I have the STF log.

[32mINF[39m/device:plugins:service 9382 [192.168.102.20:5555] Launching agent [32mINF[39m/device:plugins:service 9382 [192.168.102.20:5555] Agent says: "Listening on @stfagent" [32mINF[39m/device:plugins:service 9382 [192.168.102.20:5555] Launching service [32mINF[39m/device:plugins:service 9382 [192.168.102.20:5555] Agent says: "InputClient started" [32mINF[39m/device:plugins:display 9382 [192.168.102.20:5555] Reading display info [32mINF[39m/provider 9311 [*] Providing 0 of 1 device(s); waiting for "192.168.102.20:5555" [32mINF[39m/device:plugins:phone 9382 [192.168.102.20:5555] Fetching phone info [32mINF[39m/device:plugins:identity 9382 [192.168.102.20:5555] Solving identity [32mINF[39m/device:plugins:solo 9382 [192.168.102.20:5555] Subscribing to permanent channel "c74jdStqmG+oGQiuHsVFN5JbloI=" [32mINF[39m/device:plugins:screen:stream 9382 [192.168.102.20:5555] Starting WebSocket server on port 7400 [33mWRN[39m/device:plugins:data 9382 [192.168.102.20:5555] Unable to find device data { serial: '192.168.102.20:5555', platform: 'Android', manufacturer: 'HARDKERNEL CO., LTD.', operator: null, model: 'C2', version: '6.0.1', abi: 'armeabi-v7a', sdk: '23', product: 'odroidc2', display: { id: 0, width: 800, height: 480, xdpi: 160, ydpi: 160.42100524902344, fps: 60.000003814697266, density: 1, rotation: 0, secure: true, size: 5.8269051128633444, url: 'ws://192.168.102.10:7400' }, phone: { network: 'UNKNOWN' } } [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Touch origin is top left [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Requesting touch consumer to start [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Launching screen service [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Connecting to minitouch service [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mice is not supported by libevdev" [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mouse0 is not supported by libevdev" [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mouse1 is not supported by libevdev" [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] minitouch says: "Unable to find a suitable touch device" [33mWRN[39m/device:plugins:touch 9382 [192.168.102.20:5555] Shell keeping minitouch running ended unexpectedly [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Disconnecting from minitouch service [32mINF[39m/device:plugins:touch 9382 [192.168.102.20:5555] Stopping minitouch service

When I connect touchscreen (even if they doesn't works) everything works:

root@OpenSTF:~# shell dumpsys input INPUT MANAGER (dumpsys input)

Input Manager State:

Interactive: true System UI Visibility: 0x400 Pointer Speed: 0 Pointer Gestures Enabled: true Show Touches: true

Event Hub State: BuiltInKeyboardId: -2 Devices: -1: Virtual Classes: 0x40000023 Path:

.............

8: RPI_TOUCH By ZH851 Classes: 0x00000014 Path: /dev/input/event6 Descriptor: 9287fe304329fd54909b5ad18b1e6a777db80b26 Location: usb-dwc2_b-1.1/input0 ControllerNumber: 0 UniqueId: Identifier: bus=0x0003, vendor=0x0eef, product=0x0005, version=0x0200 KeyLayoutFile: KeyCharacterMapFile: ConfigurationFile: /system/usr/idc/Vendor_0eef_Product_0005.idc HaveKeyboardLayoutOverlay: false

Input Reader State: Device -1: Virtual Generation: 2

.............

Device 8: RPI_TOUCH By ZH851 Generation: 25 IsExternal: false HasMic: false Sources: 0x0000d002 KeyboardType: 0 Motion Ranges: X: source=0x0000d002, min=0.000, max=799.000, flat=0.000, fuzz=0.000, resolution=0.000 Y: source=0x0000d002, min=0.000, max=479.000, flat=0.000, fuzz=0.000, resolution=0.000 PRESSURE: source=0x0000d002, min=0.000, max=1.000, flat=0.000, fuzz=0.000, resolution=0.000 Touch Input Mapper: Parameters: GestureMode: spots DeviceType: touchScreen AssociatedDisplay: hasAssociatedDisplay=true, isExternal=false OrientationAware: true Raw Touch Axes: X: min=0, max=800, flat=0, fuzz=0, resolution=0 Y: min=0, max=480, flat=0, fuzz=0, resolution=0 Pressure: unknown range TouchMajor: unknown range TouchMinor: unknown range ToolMajor: unknown range ToolMinor: unknown range Orientation: unknown range Distance: unknown range TiltX: unknown range TiltY: unknown range TrackingId: min=0, max=65535, flat=0, fuzz=0, resolution=0 Slot: min=0, max=4, flat=0, fuzz=0, resolution=0 Calibration: touch.size.calibration: none touch.pressure.calibration: none touch.orientation.calibration: none touch.distance.calibration: none touch.coverage.calibration: none Affine Transformation: X scale: 1.000 X ymix: 0.000 X offset: 0.000 Y xmix: 0.000 Y scale: 1.000 Y offset: 0.000 Viewport: displayId=0, orientation=0, logicalFrame=[0, 0, 800, 480], physicalFrame=[0, 0, 800, 480], deviceSize=[800, 480] SurfaceWidth: 800px SurfaceHeight: 480px SurfaceLeft: 0 SurfaceTop: 0 SurfaceOrientation: 0 Translation and Scaling Factors: XTranslate: 0.000 YTranslate: 0.000 XScale: 0.999 YScale: 0.998 XPrecision: 1.001 YPrecision: 1.002 GeometricScale: 0.998 PressureScale: 0.000 SizeScale: 0.000 OrientationScale: 0.000 DistanceScale: 0.000 HaveTilt: false TiltXCenter: 0.000 TiltXScale: 0.000 TiltYCenter: 0.000 TiltYScale: 0.000 Last Raw Button State: 0x00000000 Last Raw Touch: pointerCount=0 Last Cooked Button State: 0x00000000 Last Cooked Touch: pointerCount=0 Stylus Fusion: ExternalStylusConnected: true External Stylus ID: -1 External Stylus Data Timeout: 9223372036854775807 External Stylus State: When: 9223372036854775807 Pressure: 0.000000 Button State: 0x00000000 Tool Type: 0 Configuration: ExcludedDeviceNames: [] VirtualKeyQuietTime: 0.0ms PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000 WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000 PointerGesture: Enabled: true QuietInterval: 100.0ms DragMinSwitchSpeed: 50.0px/s TapInterval: 150.0ms TapDragInterval: 300.0ms TapSlop: 20.0px MultitouchSettleInterval: 100.0ms MultitouchMinDistance: 15.0px SwipeTransitionAngleCosine: 0.3 SwipeMaxWidthRatio: 0.2 MovementSpeedRatio: 0.8 ZoomSpeedRatio: 0.3 Input Dispatcher State: DispatchEnabled: 1 DispatchFrozen: 0

[32mINF[39m/device:plugins:service 9534 [192.168.102.20:5555] Launching agent [32mINF[39m/device:plugins:service 9534 [192.168.102.20:5555] Agent says: "Listening on @stfagent" [32mINF[39m/device:plugins:service 9534 [192.168.102.20:5555] Launching service [32mINF[39m/device:plugins:service 9534 [192.168.102.20:5555] Agent says: "InputClient started" [32mINF[39m/device:plugins:display 9534 [192.168.102.20:5555] Reading display info [32mINF[39m/device:plugins:phone 9534 [192.168.102.20:5555] Fetching phone info [32mINF[39m/provider 9463 [] Providing 0 of 1 device(s); waiting for "192.168.102.20:5555" [32mINF[39m/device:plugins:identity 9534 [192.168.102.20:5555] Solving identity [32mINF[39m/device:plugins:solo 9534 [192.168.102.20:5555] Subscribing to permanent channel "c74jdStqmG+oGQiuHsVFN5JbloI=" [32mINF[39m/device:plugins:screen:stream 9534 [192.168.102.20:5555] Starting WebSocket server on port 7400 [33mWRN[39m/device:plugins:data 9534 [192.168.102.20:5555] Unable to find device data { serial: '192.168.102.20:5555', platform: 'Android', manufacturer: 'HARDKERNEL CO., LTD.', operator: null, model: 'C2', version: '6.0.1', abi: 'armeabi-v7a', sdk: '23', product: 'odroidc2', display: { id: 0, width: 800, height: 480, xdpi: 160, ydpi: 160.42100524902344, fps: 60.000003814697266, density: 1, rotation: 0, secure: true, size: 5.8269051128633444, url: 'ws://192.168.102.10:7400' }, phone: { network: 'UNKNOWN' } } [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] Touch origin is top left [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] Requesting touch consumer to start [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] Launching screen service [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] Connecting to minitouch service [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mouse2 is not supported by libevdev" [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mice is not supported by libevdev" [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mouse0 is not supported by libevdev" [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Note: device /dev/input/mouse1 is not supported by libevdev" [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Type B touch device RPI_TOUCH By ZH851 (800x480 with 5 contacts) detected on /dev/input/event6 (score 1100)" [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] Reading minitouch banner [32mINF[39m/device:plugins:touch 9534 [192.168.102.20:5555] minitouch says: "Connection established" [32mINF[39m/device:plugins:vnc 9534 [192.168.102.20:5555] Starting VNC server on port 7402 [32mINF[39m/device:plugins:browser 9534 [192.168.102.20:5555] Loading browser list [32mINF[39m/device:plugins:browser 9534 [192.168.102.20:5555] Updating browser list [32mINF[39m/device:plugins:mute 9534 [192.168.102.20:5555] Will not mute master volume during use [32mINF[39m/device:plugins:forward 9534 [192.168.102.20:5555] Launching reverse port forwarding service [32mINF[39m/device:plugins:forward 9534 [192.168.102.20:5555] Connecting to reverse port forwarding service [32mINF[39m/device:plugins:connect 9534 [192.168.102.20:5555] Listening on port 7401 [32mINF[39m/device 9534 [192.168.102.20:5555] Fully operational [32mINF[39m/provider 9463 [] Providing all 1 device(s)

I plant use more then 100 devices and I can't use 100 touchscreens. I think about virtual touchscreen, but I don't have any idea how to do it. Any idea ?

sorccu commented 7 years ago

Well I'd say that's beyond our use case. We can't support everything. However, https://github.com/openstf/minitouch/pull/15 might work once merged.

d0c3ntOS commented 7 years ago

I use Git repository: https://github.com/LoCorVin/minitouch.git

root@OpenSTF:~/git/minitouch# adb connect 192.168.102.20:5555 connected to 192.168.102.20:5555

root@OpenSTF:~/git/minitouch# ./run.sh + /home/user/Android/Sdk/ndk-bundle/ndk-build [arm64-v8a] Compile : minitouch-common <= minitouch.c [arm64-v8a] StaticLibrary : libminitouch-common.a [arm64-v8a] Compile : evdev <= libevdev.c [arm64-v8a] Compile : evdev <= libevdev-names.c [arm64-v8a] StaticLibrary : libevdev.a [arm64-v8a] Executable : minitouch [arm64-v8a] Install : minitouch => libs/arm64-v8a/minitouch [arm64-v8a] Executable : minitouch-nopie [arm64-v8a] Install : minitouch-nopie => libs/arm64-v8a/minitouch-nopie [x86_64] Compile : minitouch-common <= minitouch.c [x86_64] StaticLibrary : libminitouch-common.a [x86_64] Compile : evdev <= libevdev.c [x86_64] Compile : evdev <= libevdev-names.c [x86_64] StaticLibrary : libevdev.a [x86_64] Executable : minitouch [x86_64] Install : minitouch => libs/x86_64/minitouch [x86_64] Executable : minitouch-nopie [x86_64] Install : minitouch-nopie => libs/x86_64/minitouch-nopie [mips64] Compile : minitouch-common <= minitouch.c [mips64] StaticLibrary : libminitouch-common.a [mips64] Compile : evdev <= libevdev.c [mips64] Compile : evdev <= libevdev-names.c [mips64] StaticLibrary : libevdev.a [mips64] Executable : minitouch [mips64] Install : minitouch => libs/mips64/minitouch [mips64] Executable : minitouch-nopie [mips64] Install : minitouch-nopie => libs/mips64/minitouch-nopie [armeabi-v7a] Compile thumb : minitouch-common <= minitouch.c [armeabi-v7a] StaticLibrary : libminitouch-common.a [armeabi-v7a] Compile thumb : evdev <= libevdev.c [armeabi-v7a] Compile thumb : evdev <= libevdev-names.c [armeabi-v7a] StaticLibrary : libevdev.a [armeabi-v7a] Executable : minitouch [armeabi-v7a] Install : minitouch => libs/armeabi-v7a/minitouch [armeabi-v7a] Executable : minitouch-nopie [armeabi-v7a] Install : minitouch-nopie => libs/armeabi-v7a/minitouch-nopie [armeabi] Compile thumb : minitouch-common <= minitouch.c [armeabi] StaticLibrary : libminitouch-common.a [armeabi] Compile thumb : evdev <= libevdev.c [armeabi] Compile thumb : evdev <= libevdev-names.c [armeabi] StaticLibrary : libevdev.a [armeabi] Executable : minitouch [armeabi] Install : minitouch => libs/armeabi/minitouch [armeabi] Executable : minitouch-nopie [armeabi] Install : minitouch-nopie => libs/armeabi/minitouch-nopie [x86] Compile : minitouch-common <= minitouch.c [x86] StaticLibrary : libminitouch-common.a [x86] Compile : evdev <= libevdev.c [x86] Compile : evdev <= libevdev-names.c [x86] StaticLibrary : libevdev.a [x86] Executable : minitouch [x86] Install : minitouch => libs/x86/minitouch [x86] Executable : minitouch-nopie [x86] Install : minitouch-nopie => libs/x86/minitouch-nopie [mips] Compile : minitouch-common <= minitouch.c [mips] StaticLibrary : libminitouch-common.a [mips] Compile : evdev <= libevdev.c [mips] Compile : evdev <= libevdev-names.c [mips] StaticLibrary : libevdev.a [mips] Executable : minitouch [mips] Install : minitouch => libs/mips/minitouch [mips] Executable : minitouch-nopie [mips] Install : minitouch-nopie => libs/mips/minitouch-nopie ++ adb shell getprop ro.product.cpu.abi ++ tr -d '\r' + abi=armeabi-v7a ++ adb shell getprop ro.build.version.sdk ++ tr -d '\r' + sdk=23 + (( 23 >= 16 )) + bin=minitouch + adb push libs/armeabi-v7a/minitouch /data/local/tmp/ 430 KB/s (34320 bytes in 0.077s) + adb shell /data/local/tmp/minitouch Note: device /dev/input/mice is not supported by libevdev Note: device /dev/input/mouse1 is not supported by libevdev Note: device /dev/input/mouse0 is not supported by libevdev Unable to find a suitable touch device root@OpenSTF:~/git/minitouch#

Didn't help :(

Any ideas ? What can I do more ?

sorccu commented 7 years ago

I don't think there's anything I can do about that right now, too busy. However, please post your feedback on that minicap issue where it is more appropriate.

ondrj commented 6 years ago

@d0c3ntOS Hello, have you found any solution? I fell into similar issue...

simion-iulian commented 6 years ago

I have a similar problem on ODROID C2 when trying to connect to it. I can get Minicap to stream on one device, but not OpenSTF. Is there a way to disable the minitouch feature?

ondrj commented 6 years ago

I have already tried to comment code here 'https://github.com/openstf/stf/blob/badb3ed3be5d1b5cf889ad61244c3ca1a4fc6de5/lib/units/device/index.js#L31', but unfortunately it did not help..

xingkong130 commented 6 years ago

@ d0c3ntOS

I also encountered the same problem with you. My device does not have a touch screen. error is Unable to find a suitable touch device。 I have already solved。 Find out the device's initialization code and modify it.

simion-iulian commented 6 years ago

@xingkong130 , what part of the device initialization code did you modify, and on what device, and android version?

gwillden commented 5 years ago

@xingkong130 Did you have a chance to answer @simion-iulian? I too would like to know what changes you made to the device's initialization code to make stf work with a non-touchscreen device.