Android Question Android Things Pull Up/Down

fbritop

Active Member
Licensed User
Longtime User
When configuring a built, for reading the state of a GPIO (button press), the board in google things console hardware config should be GPIO Pull Up/Pull Down/none?

Thanks
FBP
 

walterf25

Expert
Licensed User
Longtime User
When configuring a built, for reading the state of a GPIO (button press), the board in google things console hardware config should be GPIO Pull Up/Pull Down/none?

Thanks
FBP
Pull Up.

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Thanks... do you have an idea what OnGpioError: 19 is related to?
Not sure without looking at the full Logs, have you configured the Pins either as Input as Output?

If you're reading a pin, you need to configure it as Input, if you're outputting a signal then you need to configure it as an Output.

Walter
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
Yes input, but throws that erro in the logs (in red)
B4X:
GPIOBtn1=pm.OpenGpio("BCM26")
GPIOBtn1.Direction=GPIOBtn1.DIRECTION_IN
GPIOBtn1.AddListener("GPIOBtn1")
It throws the error at the end of StateChange event.
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
@walterf25
This is the unfiltered logs at the moment of crash

B4X:
OPEN R1 MANUAL
Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa949fa50 in tid 4228 (peripheralman), pid 4184 (peripheralman)
false
OPEN R1 MANUAL
type=1400 audit(0.0:446): avc: denied { write } for name="trace_marker" dev="tracefs" ino=47 scontext=u:r:crash_dump:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
type=1400 audit(0.0:447): avc: denied { open } for path="/sys/kernel/debug/tracing/trace_marker" dev="tracefs" ino=47 scontext=u:r:crash_dump:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
obtaining output fd from tombstoned, type: kDebuggerdTombstone
received crash request for pid 4184
performing dump of process 4184 (target tid = 4228)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Things/iot_rpi3/rpi3:8.1.0/OIM1.180327.072/5271878:userdebug/dev-keys'
Revision: '0'
ABI: 'arm'
pid: 4184, tid: 4228, name: peripheralman  >>> /system/bin/peripheralman <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xa949fa50
    r0 a94993f0  r1 00000013  r2 00000000  r3 00000000
    r4 00000013  r5 a94993f0  r6 a949fa50  r7 ffffffff
    r8 ffffffff  r9 ffffffff  sl 00000013  fp ffffffff
    ip 8c4a8e94  sp a9111678  lr 8c49c42b  pc a949fa50  cpsr 600f0010
backtrace:
    #00 pc 0009fa50  [anon:libc_malloc:a9400000]
    #01 pc 00025429  /system/bin/peripheralman (_ZN7android15GpioDriverSysfs16StartGpioWatcherEixN4base8CallbackIFvPNS_4base14unique_fd_implINS3_13DefaultCloserEEEsxPNS_19CharDeviceInterfaceEELNS1_8internal8CopyModeE1EEES9_+36)
    #02 pc 0002573f  /system/bin/peripheralman (android::GpioDriverSysfs::CommunicationPipeEvent(android::base::unique_fd_impl<android::base::DefaultCloser>*, android::base::unique_fd_impl<android::base::DefaultCloser>*, short, long long, android::CharDeviceInterface*)+126)
    #03 pc 0001bfa9  /system/bin/peripheralman (_ZN4base8internal7InvokerINS0_9BindStateIPFvPN7android4base14unique_fd_implINS4_13DefaultCloserEEES8_sxPNS3_19CharDeviceInterfaceEEJNS0_12OwnedWrapperIS7_EEEEEFvS8_sxSA_EE3RunEPNS0_13BindStateBaseEOS8_OsOxOSA_+28)
    #04 pc 0000aabd  /system/bin/peripheralman (android::FileDescriptorWatcher::HandleEvent(int, short)+112)
    #05 pc 0000a957  /system/bin/peripheralman (android::FileDescriptorWatcher::RunOnce(bool)+350)
    #06 pc 0000b07f  /system/bin/peripheralman (_ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN7android21FileDescriptorWatcher5StartEvE3$_0EEEEEPvSB_+26)
    #07 pc 000474cf  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001af39  /system/lib/libc.so (__start_thread+32)
Couldn't find ProcessRecord for pid 4184
Tombstone written to: /data/tombstones/tombstone_18
Copying /data/tombstones/tombstone_18 to DropBox (SYSTEM_TOMBSTONE)
Received crash notification for peripheralman[4184] sig 11, user 0 (sending notification report)
Writing minimal crash report.
Crash directory /data/misc/crash_reporter/crash not yet full, free space of 1696808960 bytes is greater than 268435456
Crash directory /data/misc/crash_reporter/crash already full with 32 pending reports
Directory /data/misc/crash_reporter/crash is out of capacity.
Could not get log directory; out of capacity: 1
Out of capacity.
Unable to generate minimal crash report.
I/O BCM26 has been unregistered; stopping interrupt listener
service 'com.google.android.things.pio.IPeripheralManager' died
OnGpioError: 19
I/O BCM26 has been unregistered; stopping interrupt listener
OnGpioError: 19
service 'devicemanagementservice' died
service 'metricsmanagementservice' died
service 'updatemanagementservice' died
[0226/202557:INFO:binder_service_brillo.cc(228)] Erasing orphan callback
service 'mediacontrolservice' died
service 'bluetoothprofilemanagerservice' died
service 'bluetoothconnectionservice' died
ActivityManager disconnected
Closing Activity Manager data connection
service 'bluetooth_manager' died
service 'connmetrics' died
service 'netd_listener' died
service 'contexthub' died
service 'otadexopt' died
service 'package_native' died
service 'package' died
Set power mode=2, type=0 flinger=0xa5f51000
power manager service died !!!
service 'usagestats' died
service 'dropbox' died
service 'overlay' died
service 'battery' died
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
@walterf25
This is the unfiltered logs at the moment of crash

B4X:
OPEN R1 MANUAL
Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa949fa50 in tid 4228 (peripheralman), pid 4184 (peripheralman)
false
OPEN R1 MANUAL
type=1400 audit(0.0:446): avc: denied { write } for name="trace_marker" dev="tracefs" ino=47 scontext=u:r:crash_dump:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
type=1400 audit(0.0:447): avc: denied { open } for path="/sys/kernel/debug/tracing/trace_marker" dev="tracefs" ino=47 scontext=u:r:crash_dump:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
obtaining output fd from tombstoned, type: kDebuggerdTombstone
received crash request for pid 4184
performing dump of process 4184 (target tid = 4228)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Things/iot_rpi3/rpi3:8.1.0/OIM1.180327.072/5271878:userdebug/dev-keys'
Revision: '0'
ABI: 'arm'
pid: 4184, tid: 4228, name: peripheralman  >>> /system/bin/peripheralman <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xa949fa50
    r0 a94993f0  r1 00000013  r2 00000000  r3 00000000
    r4 00000013  r5 a94993f0  r6 a949fa50  r7 ffffffff
    r8 ffffffff  r9 ffffffff  sl 00000013  fp ffffffff
    ip 8c4a8e94  sp a9111678  lr 8c49c42b  pc a949fa50  cpsr 600f0010
backtrace:
    #00 pc 0009fa50  [anon:libc_malloc:a9400000]
    #01 pc 00025429  /system/bin/peripheralman (_ZN7android15GpioDriverSysfs16StartGpioWatcherEixN4base8CallbackIFvPNS_4base14unique_fd_implINS3_13DefaultCloserEEEsxPNS_19CharDeviceInterfaceEELNS1_8internal8CopyModeE1EEES9_+36)
    #02 pc 0002573f  /system/bin/peripheralman (android::GpioDriverSysfs::CommunicationPipeEvent(android::base::unique_fd_impl<android::base::DefaultCloser>*, android::base::unique_fd_impl<android::base::DefaultCloser>*, short, long long, android::CharDeviceInterface*)+126)
    #03 pc 0001bfa9  /system/bin/peripheralman (_ZN4base8internal7InvokerINS0_9BindStateIPFvPN7android4base14unique_fd_implINS4_13DefaultCloserEEES8_sxPNS3_19CharDeviceInterfaceEEJNS0_12OwnedWrapperIS7_EEEEEFvS8_sxSA_EE3RunEPNS0_13BindStateBaseEOS8_OsOxOSA_+28)
    #04 pc 0000aabd  /system/bin/peripheralman (android::FileDescriptorWatcher::HandleEvent(int, short)+112)
    #05 pc 0000a957  /system/bin/peripheralman (android::FileDescriptorWatcher::RunOnce(bool)+350)
    #06 pc 0000b07f  /system/bin/peripheralman (_ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN7android21FileDescriptorWatcher5StartEvE3$_0EEEEEPvSB_+26)
    #07 pc 000474cf  /system/lib/libc.so (__pthread_start(void*)+22)
    #08 pc 0001af39  /system/lib/libc.so (__start_thread+32)
Couldn't find ProcessRecord for pid 4184
Tombstone written to: /data/tombstones/tombstone_18
Copying /data/tombstones/tombstone_18 to DropBox (SYSTEM_TOMBSTONE)
Received crash notification for peripheralman[4184] sig 11, user 0 (sending notification report)
Writing minimal crash report.
Crash directory /data/misc/crash_reporter/crash not yet full, free space of 1696808960 bytes is greater than 268435456
Crash directory /data/misc/crash_reporter/crash already full with 32 pending reports
Directory /data/misc/crash_reporter/crash is out of capacity.
Could not get log directory; out of capacity: 1
Out of capacity.
Unable to generate minimal crash report.
I/O BCM26 has been unregistered; stopping interrupt listener
service 'com.google.android.things.pio.IPeripheralManager' died
OnGpioError: 19
I/O BCM26 has been unregistered; stopping interrupt listener
OnGpioError: 19
service 'devicemanagementservice' died
service 'metricsmanagementservice' died
service 'updatemanagementservice' died
[0226/202557:INFO:binder_service_brillo.cc(228)] Erasing orphan callback
service 'mediacontrolservice' died
service 'bluetoothprofilemanagerservice' died
service 'bluetoothconnectionservice' died
ActivityManager disconnected
Closing Activity Manager data connection
service 'bluetooth_manager' died
service 'connmetrics' died
service 'netd_listener' died
service 'contexthub' died
service 'otadexopt' died
service 'package_native' died
service 'package' died
Set power mode=2, type=0 flinger=0xa5f51000
power manager service died !!!
service 'usagestats' died
service 'dropbox' died
service 'overlay' died
service 'battery' died
Have you tried with any other pin?

Walter
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
Yes it works, until the app crashes for any erro, then the PIN gets like holded by the OS, removing the App with ADB, restarting the device, and reinstall it, solves the issue temporarily. It seems that the Ph Manager, where inits, can reset old taken pins.
 
Upvote 0
Top