Coder Social home page Coder Social logo

sample-lowpan's People

Contributors

fleker avatar mangini avatar proppy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sample-lowpan's Issues

Example on how to use samples with nrf52840 Dongle

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 [email protected]::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

Unable to Access the Internet over Thread from Android Things

I'm trying to connect to the Internet from Android Things connected to an NCP through the OpenThread Border Router.

1 Raspberry PI running Open Thread Border Router. This device is also connected to IPv4 ethernet connection to the Internet.
2 Raspberry PIs running Android Things
Each device is connected to a Nordic nRF52840-PDK over USB.

The border router is configured as described here: https://openthread.io/guides/border-router/build
I have tested with and without performing the "Wi-Fi Access Point Setup" steps, performing or not performing them makes no difference.

I am able to run non Android Things examples and connect to the Internet through the Thread network, so Internet connectivity through Thread is working.

Using the Android Things LowPan sample and Thread network created by the Border Router, two Android Things devices are able to see and connect to one another.

I then modified the LowPan sample to connect to servers outside the Thread network (making a socket connection to a public web server), but am not able to connect to anything.

If I try to connect to a public external IPv4 address (converted to IPv6 with the 64:ff9b:: prefix) I get:

android.system.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)

If I try to connect to a public host name I get:

android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname).

What is required to have Android Things connect to a server over the Internet through a Thread network?

Issues with UDP Sockets

There is pretty much no error logs but it can't actually send anything over mesh network on udp. Seems to receive without any issues but on send it doesn't go.

try {
sock = new DatagramSocket(null);
udpPacket = new DatagramPacket(data.getBytes(), data.length(), InetAddress.getByName(deviceAddr), portServer);

                    sock.send(udpPacket);
                    Log.e(TAG, "Connection send: " + data);

                    if (!sock.isClosed()) {
                        sock.close();
                        Log.e(TAG, "Socket Closed");
                    }
                } catch (SocketException e) {
                    Log.e(TAG, "Socket Issue: " + e.getMessage());
                } catch (UnknownHostException e) {
                    Log.e(TAG, "Host Issue: " + e.getMessage());
                } catch (IOException e) {
                    Log.e(TAG, "IO Issue: " + e.getMessage());
                }

thats the code for send over udp. Here is the addr: fdde:ad00:beef:0:8142:58d9:a2a3:7377 port is 1212 and on receive there are no trouble.

Any thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.