使用 adb 与 MOVESENSE 通信时出现问题
我试图遵循Movesense的说明,以了解如何使用ADB进行白板通信。这无法正常工作。
在旁注上 - 我只是想设置少数传感器,以开始一些心率和运动测量,并将数据存储到日志中。 30-40分钟后,我想停止测量并从每个设备中获取数据。我的第一个梦想是,我可以使用BLE上的白板(来自Matlab,Python,Labview,...)来做到这一点,而无需使用ADB或类似解决方案。但是我想这太乐观了。
设置
- 安装了ADB工具:OK
- 在Android电话上启用USB调试:OK
- 测试ADB可以安装应用程序并处理电话:OK
- 安装
SampleApp-Debug-1.5.1.apk
:- 尝试使用ADB安装:OK
- 试图通过将文件复制到手机并在此处安装来安装:OK
- 我收到了一条消息,说示例应用程序未针对当前版本的Android编译(我正在使用三星S10E运行一个UI版本4.0和Android版本12,Security Fix Level 01.02.2022)。
我正在使用大量资源的Intel Mac 11.6.5运行Big Sur。
我到目前为止尝试的内容
首先是我启动应用程序并连接到Movesense设备。
尝试从Movesense进行示例命令时,我获得:
打开LED:
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type put --es path Component/Led --es value '''{\"isOn\":true}'''
Broadcasting: Intent { act=android.intent.action.MOVESENSE flg=0x400000 (has extras) }
Broadcast completed: result=0
获取信息
获取信息仅在我将卷发括号放在配额之间时才能正常工作。有关两个变体的结果,请参见下面的结果。
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type get --es path Info --es value ''''''
Exception occurred while executing 'broadcast':
java.lang.IllegalArgumentException: Argument expected after "value"
at com.android.modules.utils.BasicShellCommandHandler.getNextArgRequired(BasicShellCommandHandler.java:295)
at android.content.Intent.parseCommandArgs(Intent.java:8329)
at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:367)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:788)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:214)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10429)
at android.os.Binder.shellCommand(Binder.java:986)
at android.os.Binder.onTransact(Binder.java:860)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6049)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3034)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type get --es path Info --es value '''{}'''
Broadcasting: Intent { act=android.intent.action.MOVESENSE flg=0x400000 (has extras) }
Broadcast completed: result=0
犯罪嫌疑人
- 是由于Android应用的旧版本而导致的问题吗?我找不到比1.5.1的新东西。
- 我试图使用
adb shell umpsys活动服务在手机中戳一下| grep android.intent.action
,并获得了大量结果,然后我开始使用adb shell umpsys活动服务来寻找movesense | grep movesense
,并获得 no 命中。我在这里很瘦,但是是否应该在某个地方有一个android.intent.Intent.Movesense
?
I have tried to follow the instructions from Movesense on how to do Whiteboard communication using ADB. This does not work as expected.
On a sidenote - I'm just trying to set up a handful of sensors to start some heart rate and movement measurement and store data to the logbook. After 30-40 minutes, I want to stop measurements and fetch the data from each device. My first dream was that I could do this using Whiteboard over BLE (from Matlab, Python, LabVIEW, ...) without having to use ADB or similar solutions. But I guess this was a bit too optimistic.
Setup
- Installed the adb tools: OK
- Enabled USB debugging on an Android phone: OK
- Tested that adb can install apps and handle the phone: OK
- Installed
sampleapp-debug-1.5.1.apk
:- Tried to install using adb: OK
- Tried to install by copying the file to the phone and installing it there: OK
- I got a message saying that the sample app was not compiled for the current version of Android (I'm using a Samsung S10e running One UI version 4.0 and Android version 12, security fix level 01.02.2022).
Im working on an Intel Mac running Big Sur 11.6.5 with plenty of resources.
What I've tried so far
First of all, I start the app and connect to the MOVESENSE device.
When trying the example commands from Movesense, I get:
Switch on LED:
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type put --es path Component/Led --es value '''{\"isOn\":true}'''
Broadcasting: Intent { act=android.intent.action.MOVESENSE flg=0x400000 (has extras) }
Broadcast completed: result=0
Get Info
Get Info does only work if I place curly braces between the quotas. See results below for both variants.
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type get --es path Info --es value ''''''
Exception occurred while executing 'broadcast':
java.lang.IllegalArgumentException: Argument expected after "value"
at com.android.modules.utils.BasicShellCommandHandler.getNextArgRequired(BasicShellCommandHandler.java:295)
at android.content.Intent.parseCommandArgs(Intent.java:8329)
at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:367)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:788)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:214)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10429)
at android.os.Binder.shellCommand(Binder.java:986)
at android.os.Binder.onTransact(Binder.java:860)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6049)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3034)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
fjp@fMac-19 sensorsw % adb shell am broadcast -a android.intent.action.MOVESENSE --es type get --es path Info --es value '''{}'''
Broadcasting: Intent { act=android.intent.action.MOVESENSE flg=0x400000 (has extras) }
Broadcast completed: result=0
The suspects
- Is my problems due to an old version of the Android app? I could not find anything newer than 1.5.1.
- I tried to poke around a bit in the phone using
adb shell dumpsys activity services | grep android.intent.action
, and got a load of results, I then started to look for MOVESENSE as well usingadb shell dumpsys activity services | grep MOVESENSE
, and got no hits. I'm on thin ice here, but could it be that there should be anandroid.intent.action.MOVESENSE
in there someplace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大量反复试验,我终于找到了解决方案。
我找到了A bitbucket目录
,并带有许多预编译的Android应用程序。
文件
ShowCaseApp-debug_adb-bridge-build.apk
是您想要的。这是您要做的:showcaseapp-debug_adb-bridge-build.apk
,并将其放置在您选择的目录中。adb install showcaseapp-debug_adb-bridge-build.apk
。adb shell Am广播-A android.intent.Action.Movesense -es type put -es path path component/led -es value'''''{\“ ison \”:true }'''
adb shell am bardy -a android.intent.action.movesense -es type put -es path path component/led -es value'''''{\“ ison \”:false }'''
在一个完美世界中的最终音符
,Movesense将使WBCMD能够使用大多数/所有PC中的Theble设备,无论是Windows,Linux还是Mac。甚至是完美的(这是一个单词?),制作一个使用TCP/IP而不是标准内/输出的变体。
After a lot of trial and error, I have finally found a solution.
The solution
I found aBitbucket directory with a lot of precompiled Android apps.
The file
Showcaseapp-debug_adb-bridge-build.apk
is the one you want. Here is what you do:Showcaseapp-debug_adb-bridge-build.apk
, and place it in your directory of choice.adb install Showcaseapp-debug_adb-bridge-build.apk
.adb shell am broadcast -a android.intent.action.MOVESENSE --es type put --es path Component/Led --es value '''{\"isOn\":true}'''
adb shell am broadcast -a android.intent.action.MOVESENSE --es type put --es path Component/Led --es value '''{\"isOn\":false}'''
A final note
In a perfect world, Movesense would make wbcmd capable of using theBLE device built into most/all PCs, be it Windows, Linux, or Mac. Or even perfecter (is that a word?), make a variant that used TCP/IP instead of standard in/out.