is there any way to debug movesense device without movesense programmer? - movesense

I'm developing a product using a Movesense sensor. But I don't have a Movesense programmer. Currently, I'm using the DFU method to update the latest firmware. The issue I'm facing is I can't see the logs of the Movesense device. And that is why I don't know which part of my program isn't working correctly or where I made a mistake. So is there any way that I can see the logs?
Thank you in advance.

I had the same question. What I am doing now is:
Use the adbbridge app found here https://www.movesense.com/docs/esw/tools/
You can then add some debug info logs to your code for example: DebugLogger::info("readTemperatureFromSensor() idx: %u", idx);
Then
Open the movesense adb bridge app and connect to the sensor
Use as instructed on the link above the commend to connect to the logs of the Android device and get the info: adb logcat | grep OUTPUT
Make the sensor do what you have programmed it for. If its whiteboard subscribe etc or some ble action.
Then subscribe also to the debug logs for example python_client % adb shell am broadcast -a "android.intent.action.MOVESENSE" --es type subscribe --es path System/Debug/Verbose --es value '''{}''' --es id 2
2 and 3 are interchangeable of course.
PS. Make sure your app is build with the debug module as well
ie:
OPTIONAL_CORE_MODULE(DebugService, true)

Related

Reading heart-rate data from a Polarbelt with a Raspberry pi

I am trying to retrieive heart-rate date from a polar belt to use as part of emotion recognition algorithm. I am using a Raspberry pi 3b with raspbian. I am able to connect to the device with bluetoothctl When I open info I get a list of the UUID´s
Here is where it stops. I have tried to use hcitool according to the example below, but that does not work. When I try to connect I get the message: Connection Refused(111)
$ sudo gatttool -i hci1 -b 00:22:D0:33:1E:0F -I
[ ][00:22:D0:33:1E:0F][LE]> connect
[CON][00:22:D0:33:1E:0F][LE]>
So I tried to use bleak and pygatt and I´m not able to make this work. I am quite a newbee, so I am probably doing something wrong. But now I have run out of ideas. Any suggestions will be appreciated.
hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool, ciptool, and gatttool were deprecated by the BlueZ project in 2017. If you are following a tutorial that uses them, there is a chance that it might be out of date.
For testing it is best to use the bluetoothctl tool.
You say that you have successfully connected and get a list of UUIDs. Was 00002A37-0000-1000-8000-00805F9B34FB one of them?
If it is then select that inside bluetoothctl e.g.
gatt.select-attribute 00002a37-0000-1000-8000-00805f9b34fb
If that is succussful then you should be able to read the value with:
gatt.read
Or to test notifications:
gatt.notify on
This should start data being displayed from the belt.
gatt.notify off will stop the data being sent.
If you have this working with bluetoothctl then reproducing it with Python should be done with confidence that the RPi and belt are able to connect successfully.
There is an example of building a BLE client with Python at:
https://stackoverflow.com/a/63751113/7721752
I noticed in your gatttool example you are using hci1 rather than the more typical value of hci0. This is normally the case if you have added a USB BLE dongle. I the above example you would have to change ADAPTER_PATH = '/org/bluez/hci0' to end with hci1.
There is also the example with Bleak at:
https://stackoverflow.com/a/72541361/7721752
For bleak to select an alternative adapter would add the adapter address to the BleakClient e.g.:
async with BleakClient(address, adapter="yy:yy:yy:yy:yy:yy") as client:

Back button not working on android emulator

I try to start an android sdk emulator, but when I press the back button this error appears:
INFO | Critical: Failed to load https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true: The 'Access-Control-Allow-Origin' header has a value 'qrc://' that is not equal to the supplied origin. Origin 'qrc://' is therefore not allowed access. (qrc:/html/js/common.js:0, (null))
INFO | Critical: Failed to load https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true: The 'Access-Control-Allow-Origin' header has a value 'qrc://' that is not equal to the supplied origin. Origin 'qrc://' is therefore not allowed access. (qrc:/html/js/common.js:0, (null))
I use Ubuntu and try to start the emulator through terminal, I use the avdmanager of the google cmdline-tools (latest version) and this is the AVD that I try to use:
Name: my_avd_29ii
Path: /home/user/.android/avd/my_avd_29ii.avd
Target: Google APIs (Google Inc.)
Based on: Android 10.0 (Q) Tag/ABI: google_apis/x86
Sdcard: 512 MB
The best option would (Needs to be done for every emulator you install)
Windows
%USERPROFILE%\.adnroid\avd\<Emulator Name>.avd
Edit config.ini
Change hw.keyboard=no to hw.keyboard=yes
Mac
~/.adnroid/avd/<Emulator Name>.avd
Edit config.ini
Change hw.keyboard=no to hw.keyboard=yes
The answer is based on this article
After looking around I found that there were two ways to push hardware events to the emulator:
First method
This method uses telnet, like so:
telnet 127.0.0.1 5554
auth <auth-key>
event send EV_KEY:KEY_BACK:0
event send EV_KEY:KEY_BACK:1
This is going to simulate the pressing down (0) the releasing (1) of a button.
Second method
This method uses adb, like so:
adb shell input keyevent KEYCODE_BACK
Ok so what?
After trying both, I realized that telnet didn't work but adb did work. I also checked the source code of emulator and saw that telnet relies on the same set of functions that are used by the tool-window. So it's probably a bug, and we can wait for the update to fix it, or...
In the meantime
I downloaded the source code, wrote a janky workaround, and built it. Basically instead of using the keypress method, I use the adb method. If you want here it is. It's quite voluminous so be patient. I included a small script to automatically replace the emulator, just run:
$ chmod +x replace
# ./reaplace path-to-android-sdk
This adds a new flag -use-adb-toolwindow to emulator. When you activate it it will use adb (successfully) for most of keyboard inputs, and home, back, apps and power buttons. Like I said it's a quick fix, but for me it works fine.
Note:
I have no clue where the bug is, so I didn't do any report, hopefuly as more people get this issue it will become clearer.

Is there a library for MSR605X that works with Raspberry Pi?

I have been trying to locate a working library for the MSR605X magnetic card reader/writer. At time of writing, I have tried five separate libraries. Only two of these were explicitly for the 605X the other three were for the older 605. All the libraries I have tried either did nothing at all or errored before completing a command (can't figure out the errors either).
I am running Raspberry Pi OS 32 bit on a Raspberry Pi 3 B+ the MSR605X communicates via a USB connection.
So far the library that seems to be most complete is: https://pypi.org/project/msrx/
However, I can not get this library to read or write (either nothing happens or I get a Serial exception "cannot reconfig port).
Any help or links to documentation for this reader is welcome.
EDIT: Adding the commands ran with the above library
msrx -D /dev/input/event4 read
msrx -D /dev/input/jso0 read
The -D is to specify the device path (default is /dev/ttyUSB0 which doesn't exist on my system). I obtained the above two paths by searching for USB serial devices then matching the search result to the device ID which I obtained from lsusb.
Running these commands results in a serial exception (could not reconfig port) which I assume means that I have the wrong device path. I have also checked for any tty* device paths that are changed when I plug in the reader. I consistently get a permission denied error whenever trying to run the above commands with a tty* device path (I am root on this system).
msrx author here — MSR605 requires an external 9V power injected into its cable (via the barrel jack port), otherwise it won't power up properly.

Android CTS - No available device matching the config's requirements

I am trying to do android compatibility test on SC20 EVb by using cts-tradefed and while trying run cts test by using cts run --plan CTS, it shows this log:
No available device matching the config's requirements for cmd id 1.
What to do?
while in tardefed check whether connected device is detected or not with below command:
cts-tf > list devices
Serial State Allocation Product Variant Build Battery
1770c061 ONLINE Available msm8998 msm8998 QKQ1.191014.001 67
1d9d493d ONLINE Available msm8998 msm8998 QKQ1.191014.001 67
Above command should display all connected android devices and allocation status.
If your device is not listed within the output check with the adb installation within the host.
If CTS is triggered on the device Allocation status will be changed from Available to Allocated.
Please make sure first that you have an adb connection with the device. It the device is connected over adb and you are still facing this issue, please wait for a while, sometimes it might take 5-10 mins to start.Hope its helpful.

Geofence alert and remote feature

I have 2 concerns.
1. How can I configure geofence alert in WsO2iot3.1.0-Updte7?
I did it in Update1 but according to documentation online: Monitoring Devices Using Location Based Services
<GeoLocationConfiguration> bloc is missing in cdm-config.xml file of Update7.
This is missing geofence settings in cdm-config.xml file
When I run the script mvn clean install -f siddhi-geo-extention-deployer.xml, and deploy Geo Analytics artifacts in devicemgt, nothing is displayed about geofence alerte (exit, enter, stationnary, speed) as in Update1.
nothing is displayed about geofence alerte (exit, enter, stationnary, speed)
2. New remote feature in devicemgt. We really appreciate but when we clic on active/connected device, it just in waiting device to connect status. Nothing is prompted.
Wainting on device to connect even when the device is active.
Remote session is enabled in cdm-config.xml file.
1. How can I configure geofence alert in WsO2iot3.1.0-Updte7?
From IoTS-3.1.0-Update 5 onward <GeoLocationConfiguration> configuration has been changed as <OperationAnalyticsConfiguration>. Please refer IoTS 3.2.0 Documentation for more details.
2. New remote feature in devicemgt.
This feature is only work with COPE type enrollments. You might need to enroll your device as COPE device, by installing vendor signed system service. Please refer Integrating the Android System Service Application documentation for more details about integrating the system service.