1

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 using adb shell dumpsys activity services | grep MOVESENSE, and got no hits. I'm on thin ice here, but could it be that there should be an android.intent.action.MOVESENSE in there someplace?
Fred
  • 31
  • 4

1 Answers1

2

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:

  • Download Showcaseapp-debug_adb-bridge-build.apk, and place it in your directory of choice.
  • On your Android device, uninstall the Showcase app if you have installed it already.
  • Install the app using ADB on your computer: adb install Showcaseapp-debug_adb-bridge-build.apk.
  • Start the app on your Android device and connect to the Movesense device.
  • Try a command like:
    • Switch LED on: adb shell am broadcast -a android.intent.action.MOVESENSE --es type put --es path Component/Led --es value '''{\"isOn\":true}'''
    • Switch LED off: 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.

Fred
  • 31
  • 4