androidthings / sample-lowpan

Discover and connect to Thread mesh networks on Android Things
Apache License 2.0
27 stars 11 forks source link

Example on how to use samples with nrf52840 Dongle #3

Open tyczj opened 5 years ago

tyczj commented 5 years ago

So far I have only got these examples to work with the nrf52840-DK board and at the time that is all there was I believe. Now there is a more reasonable/smaller nrf52840 option the USB Dongle.

The setup for the DK board does not apply to the dongle because it does not have a debugger on it that you can flash with. I have yet to find a way to get the dongle to work with the LowPAN API fully.

To get where I am today I had to manually build a .hex file with some extra flags

make -f examples/Makefile-nrf52840 clean
make -f examples/Makefile-nrf52840 USB=1 BOOTLOADER=1 BORDER_AGENT=1 BORDER_ROUTER=1 COMMISSIONER=1 UDF_FORWARD=1 LINK_RAW=1
arm-none-eabi-objcopy output/nrf52840/bin/ot-ncp-ftd -O ihex ncp.hex

Whenever register gets called for the LowPANDriver This exception happens in the receiver and transmitter samples with the dongle

2019-01-20 20:13:25.145 2461-2461/? I/wpantund: Starting wpantund 0.08.00d (Mar  6 2018 15:44:42) . . .
2019-01-20 20:13:25.145 2461-2461/? I/wpantund:     SOURCE_VERSION = 0.07.01-130-g2a5f9cd
2019-01-20 20:13:25.145 2461-2461/? I/wpantund:     BUILD_VERSION = 0.07.01-130-g2a5f9cd-dirty
2019-01-20 20:13:25.145 2461-2461/? W/wpantund: wpantund was not started as 'root'! If wpantund fails immediately, this is probably why.
2019-01-20 20:13:25.145 2461-2461/? W/wpantund: Configuration file "/system/etc/wpantund.conf" not found, will use defaults.
2019-01-20 20:13:25.148 2462-2462/? I/wpantund: About to exec "/system/bin/lowpan_hdlc_adapter userdriver"
2019-01-20 20:13:25.191 2462-2462/? I/lowpan_hdlc_ada: type=1400 audit(0.0:234): avc: denied { write } for name="trace_marker" dev="tracefs" ino=47 scontext=u:r:lowpan_hdlc_adapter:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
2019-01-20 20:13:25.203 133-133/? W//system/bin/hwservicemanager: getTransport: Cannot find entry android.hardware.lowpan@1.0::ILowpanDevice/userdriver in either framework or device manifest.
2019-01-20 20:13:25.205 2462-2462/? D/lowpan-hdlc-adapter: userdriver: open() ok.
2019-01-20 20:13:25.236 2439-2453/com.example.things.lowpan.transmitter E/JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
    java.lang.NoSuchMethodError: No interface method registerUartDeviceCallback(Landroid/os/Handler;Lcom/google/android/things/pio/UartDeviceCallback;)V in class Lcom/google/android/things/pio/UartDevice; or its super classes (declaration of 'com.google.android.things.pio.UartDevice' appears in /system/framework/com.google.android.things.jar)
        at com.google.android.things.contrib.driver.lowpan.UartLowpanModule.<init>(UartLowpanModule.java:133)
        at com.google.android.things.contrib.driver.lowpan.UartLowpanDriver.start(UartLowpanDriver.java:211)
        at com.google.android.things.userdriver.lowpan.LowpanDriver$1.start(LowpanDriver.java:115)
        at com.google.android.things.userdriver.lowpan.ILowpanDriver$Stub.onTransact(ILowpanDriver.java:55)
        at android.os.Binder.execTransact(Binder.java:697)
2019-01-20 20:13:25.241 2439-2453/com.example.things.lowpan.transmitter E/AndroidRuntime: FATAL EXCEPTION: Binder:2439_2
    Process: com.example.things.lowpan.transmitter, PID: 2439
    java.lang.NoSuchMethodError: No interface method registerUartDeviceCallback(Landroid/os/Handler;Lcom/google/android/things/pio/UartDeviceCallback;)V in class Lcom/google/android/things/pio/UartDevice; or its super classes (declaration of 'com.google.android.things.pio.UartDevice' appears in /system/framework/com.google.android.things.jar)
        at com.google.android.things.contrib.driver.lowpan.UartLowpanModule.<init>(UartLowpanModule.java:133)
        at com.google.android.things.contrib.driver.lowpan.UartLowpanDriver.start(UartLowpanDriver.java:211)
        at com.google.android.things.userdriver.lowpan.LowpanDriver$1.start(LowpanDriver.java:115)
        at com.google.android.things.userdriver.lowpan.ILowpanDriver$Stub.onTransact(ILowpanDriver.java:55)
        at android.os.Binder.execTransact(Binder.java:697)
2019-01-20 20:13:25.249 298-1085/system_process W/ActivityManager:   Force finishing activity com.example.things.lowpan.transmitter/.TransmitterActivity
2019-01-20 20:13:25.252 298-362/system_process I/InputReader: Reconfiguring input devices.  changes=0x00000004
2019-01-20 20:13:25.255 2439-2453/com.example.things.lowpan.transmitter I/Process: Sending signal. PID: 2439 SIG: 9
2019-01-20 20:13:25.306 298-1085/system_process D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=17, [ Transports: LOWPAN Capabilities: NOT_RESTRICTED&TRUSTED&NOT_VPN&FOREGROUND] ], android.os.BinderProxy@a2db399)
2019-01-20 20:13:25.306 298-550/system_process I/ActivityManager: Process com.example.things.lowpan.transmitter (pid 2439) has died: fore TOP 
2019-01-20 20:13:25.307 298-315/system_process W/system_server: kill(-2439, 9) failed: No such process
2019-01-20 20:13:25.334 599-2472/com.android.iotlauncher W/AndroidThingsLauncher: Could not find accessibility settings
2019-01-20 20:13:25.338 599-599/com.android.iotlauncher I/AndroidThingsLauncher: TimeZone is now GMT GMT
2019-01-20 20:13:25.341 599-599/com.android.iotlauncher I/AndroidThingsLauncher: Peripheral I/O ports
2019-01-20 20:13:25.341 599-599/com.android.iotlauncher I/AndroidThingsLauncher: PWM
    PWM0, PWM1

    UART
    MINIUART, UART0, USB1-1.2:1.1

    I2C
    I2C1

    SPI
    SPI0.0, SPI0.1

    GPIO
    BCM10, BCM11, BCM12, BCM13, BCM14, BCM15, BCM16, BCM17, BCM18, BCM19, BCM2, BCM20, BCM21, BCM22, BCM23, BCM24, BCM25, BCM26, BCM27, BCM3, BCM4, BCM5, BCM6, BCM7, BCM8, BCM9
2019-01-20 20:13:25.345 298-315/system_process W/system_server: kill(-2439, 9) failed: No such process
2019-01-20 20:13:25.346 298-315/system_process I/system_server: Successfully killed process cgroup uid 10038 pid 2439 in 39ms
2019-01-20 20:13:25.353 599-599/com.android.iotlauncher D/AndroidThingsLauncher: handleSignalChanged: 4(-54)
2019-01-20 20:13:25.355 599-599/com.android.iotlauncher D/AndroidThingsLauncher: handleSignalChanged: 4(-54)
2019-01-20 20:13:25.369 171-235/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-01-20 20:13:25.381 171-496/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-01-20 20:13:25.388 298-362/system_process I/InputReader: Reconfiguring input devices.  changes=0x00000004
2019-01-20 20:13:25.397 171-171/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-01-20 20:13:25.397 171-234/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-01-20 20:13:25.413 171-171/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
2019-01-20 20:13:28.891 298-427/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
2019-01-20 20:13:45.019 298-424/system_process D/WificondControl: Scan result ready event

This exception does not happen with the DK board and the samples seem to run fine