Cannot configure LSM6DS3 from AdbBridge - movesense

I'm trying to configure the TapParams of the LSM6DS3 through Showcase App's AdbBridge feature.
I have no problems reading the current config with
.\adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type get --es path Component/LSM6DS3/TapParams --es value '''{}'''
But when I try to write back my config (even the one I got with the previous command) with
.\adb.exe shell am broadcast -a "android.intent.action.MOVESENSE" --es type put --es path Component/LSM6DS3/TapParams --es value '''{\"doubleTapDur\": 0, \"doubleTapQuiet\": 0, \"tapThs\": 2, \"axes\": 0}'''
I get this error on logcat
2021-06-14 16:48:42.735 22813-22813/com.movesense.showcaseapp E/AdbBridge: onError()
com.movesense.mds.MdsException: Failed status: 400, reason: BAD_REQUEST
at com.movesense.mds.internal.operation.MdsRestOperation.onResponse(MdsRestOperation.java:81)
at com.movesense.mds.internal.operation.MdsResponseOperation.protectedRun(MdsResponseOperation.java:26)
at com.movesense.mds.internal.workqueue.QueueOperation.run(QueueOperation.java:70)
at com.movesense.mds.internal.workqueue.WorkQueueImpl.runOperation(WorkQueueImpl.java:79)
at com.movesense.mds.internal.workqueue.WorkQueueImpl$1.run(WorkQueueImpl.java:30)
at java.lang.Thread.run(Thread.java:760)
What's wrong with my request?

The LSM6DS API defines a put parameter with name "newParams". So your object needs to provide the correct name like this (just like when calling from code using MDS):
{\"newParams\":{\"doubleTapDur\": 0, \"doubleTapQuiet\": 0, \"tapThs\": 2, \"axes\": 0}}
Full disclosure: I work for the Movesense team

Related

What is the proper way to configure openbmc to get ipmitool fru print valid data?

I am having problems generating the correct configuration to get ipmitool fru print to work.
What I see is:
ipmitool fru print
...
FRU Device Description : Caracal1_FRU (ID 112)
Device not present (Requested sensor, data, or record not found)
All my FRUs are listed. All have the same Device not present message.
At startup I see the following messages get displayed on the console.
Starting Read system/chassis/Caracal1_FRU EEPROM...
[ OK ] Finished Read system/chassis/Caracal1_FRU EEPROM.
I also see valid data in output of commands:
busctl introspect --no-pager xyz.openbmc_project.Inventory.Manager \ /xyz/openbmc_project/inventory/system/chassis/Caracal1_FRU
and
busctl introspect --no-pager xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice/Caracal
I don't understand why the difference in names betreen Inventory.Manager and FruDevice. It looks like the differences are mapped as follows:
Caracal1_FRU <=> Caracal
I have validated that I have correct data in the yaml file under build/.
I would be happy to copy meta-pavailion/ if needed.
Thanks in advance

Where does dev_dbg writes log to?

In a device driver source in the Linux tree, I saw dev_dbg(...) and dev_err(...), where do I find the logged message?
One reference suggest to add #define DEBUG . The other reference involves dynamic debug and debugfs, and I got lost.
dev_dbg() expands to dynamic_dev_dbg(), dev_printk(), or no-op depending on the compilation flags.
#if defined(CONFIG_DYNAMIC_DEBUG)
#define dev_dbg(dev, format, ...) \
do { \
dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
} while (0)
#elif defined(DEBUG)
#define dev_dbg(dev, format, arg...) \
dev_printk(KERN_DEBUG, dev, format, ##arg)
#else
#define dev_dbg(dev, format, arg...) \
({ \
if (0) \
dev_printk(KERN_DEBUG, dev, format, ##arg); \
})
#endif
dynamic_dev_dbg() and dev_printk() call dev_printk_emit() which calls vprintk_emit().
This very same function is called in a normal mode when you just do a printk(). Just note here, that the rest functions like dev_err() will end up in the same function.
Thus, obviously, the buffer is all the same, i.e. kernel intrenal buffer.
The logged message at the end is printed to
Current console if kernel loglevel value (can be changed via kernel command line or via procfs) is high enough for certain message, here KERN_DEBUG.
Internal buffer which can be read by running dmesg command.
Note, data in 2 is kept as long as there still room in the buffer. Since it's limited and circular, newer data preempts old one.
Additional information how to enable Dynamic Debug.
First of all, be sure you have CONFIG_DYNAMIC_DEBUG=y in the kernel configuration.
Assume we would like to enable all debug prints in the built-in module with name 8250. To achieve that we simple add to the kernel command line the following 8250.dyndbg=+p.
If the same driver is compiled as loadable module we may either add options 8250 dyndbg to the modprobe configuration or to the shell command line when do it manually, like modprobe 8250 dyndbg.
More details are described in the Dynamic Debug documentation.
The "How certain debug prints are automatically enabled in linux kernel?" raises the question why some debug prints are automatically enabled and how DEBUG affects that when CONFIG_DYNAMIC_DEBUG=y. The answer is lying in the dynamic_debug.h and since it's used during compilation the _DPRINTK_FLAGS_DEFAULT defines the certain message appearence.
#if defined DEBUG
#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT
#else
#define _DPRINTK_FLAGS_DEFAULT 0
#endif
you can find dev_err(...) in kernel messages. As the name implies, dev_err(...) messages are error messages, so they will definitely be printed if the execution comes to that point. dev_dbg(...) are debug messages which are more generously used in the kernel driver code and they are not printed by default. So everything you have read about dynamic_debugging comes into play with dev_dbg(...).
There are several pre-conditions to have dynamic debugging working, below 1. and 2. are general preconditions for dynamic debugging. 3. and later are for your particular driver/module/subsystem and can be .
Dynamic debugging support has to be in your kernel config CONFIG_DYNAMIC_DEBUG=y. You may check if it is the case zgrep DYNAMIC_DEBUG /proc/config.gz
debugfs has to be mounted. You can check with sudo mount | grep debugfs and if not existing, you can mount with sudo mount -t debugfs /sys/kernel/debug
refer to dynamic_debugging and enable the particular file/function/line you are interested

Pub/Sub notification for GCS - event filter doesn't work

What I wanted is whenever (and only when) a file is created on GCS, my pub/sub subscription can receive a notification.
So I did this:
gsutil notification create -t projects/[my-project-id]/topics/new-raw-file -f none -m eventType:OBJECT_FINALIZE gs://[the-target-bucket]
I think this config is set up successfully, because when I ran gsutil notification list , it shows:
projects/_/buckets/[the-target-bucket]/notificationConfigs/7
Cloud Pub/Sub topic: projects/[my-project-id]/topics/new-raw-file
Custom attributes:
eventType: OBJECT_FINALIZE
This is the only config.
However, other than file creation, I also receive file deletion notification:
Received 1 messages.
* 118758642722910: message - , attributes - {u'resource': u'projects/_/buckets/[the-target-bucket]/objects/2466870.3.txt#1493038968423735', u'objectId': u'2466870.3.txt', u'bucketId': u'[the-target-bucket]', u'notificationConfig': u'projects/_/buckets/[the-target-bucket]/notificationConfigs/7', u'payloadFormat': u'NONE', u'eventType': u'OBJECT_DELETE', u'objectGeneration': u'1493038968423735'}
didn't get what was going wrong.
Turns out I misused one command option. According to this page, "-m" actually just append a key:value attribute to the notification, it has nothing to do with the event filter that I wanted. The right option to use should be "-e" . So, the following config command actually works properly:enter code here
gsutil notification create -t [TOPIC_NAME] -f json -e OBJECT_FINALIZE gs://[BUCKET_NAME]

ares-inspect luna-send command failed

I'm trying to debug my webos3 tv but I keep getting the following error:
ares-inspect --device web30 com.starz.lgtv.app_0.0.1_all.ipk
ares-inspect ERR! ares-inspect: Error: luna-send command failed (not exist)
It doesn't say anywhere in the documentation what luna-send is and it's closed source. I'm running on mac using the cli for webos. Is there anything I need to install?
Thanks
By trial and error, I found that you need to omit the version numbers for it to work:
ares-inspect --device web30 com.starz.lgtv.app --open
Don't forget the --open argument to open the inspector. :-)
The documentation doesn't explicitly say that you need to omit it but it is inferred in the demo code:
http://webostv.developer.lge.com/sdk/using-webos-tv-cli/debugging-web-applications-cli/
It's not about omitting version or removing suffixes from filenames. You should use the app id here, same as in your appinfo.json file.
ares-inspect [OPTION...] [--app|-a] APP_ID
APP_ID = ID of the app whose information is to be viewed using Web Inspector.
See http://webostv.developer.lge.com/sdk/tools/using-webos-tv-cli/ for reference.

ldapmodify: Invalid parameter ... specified for changetype modify

I'm using a script that is supposed to add an attribute to an LDAP record. It used to work, then we moved the LDAP server from Solaris Unix to Linux.
Now the script doesn't work and throws an error
The LDIF file looks like this :
dn:cn=template-uid,ou=Groups,o=mycompany.com,o=Company
changetype:modify
mgrpRFC822MailMember:new#gmail.com
ldapmodify gets called like this :
ldapmodify -h ldap.mycompany.com -D "cn=LDAPuser" -w *pswd* -v -p 636 -f updateUser.ldif
This is the error that gets thrown :
ldapmodify: Invalid parameter "mgrpRFC822MailMember" specified for changetype modify
If I log into LDAP using an LDAP browser with the same user, I can manually add the attribute without any problem. I just can't do it from command line.
Any ideas ?
Thanks
Assuming it should add a value to mgrpRFC822MailMember, it should be:
dn: cn=template-uid,ou=Groups,o=mycompany.com,o=Company
changetype: modify
add: mgrpRFC822MailMember
mgrpRFC822MailMember: new#gmail.com
A changetype of modify needs an action defined, which would be one of: add, delete, replace. That is then followed by the attribute name to take the action on. I'm surprised it worked at all in the previous form.