Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ICMP example interface removed

Hi,
I'm testing the ICMP example, using a Raspberry and a custom board with a nRF52840. I follow the instructions on the "Connecting devices to the router" found in the infocenter. I'm using the Raspberry's bluetooth interface.

I can successfully connect to my custom board (with the command echo "connect 00:AA:BB:XX:YY:ZZ 1" > /sys/kernel/debug/bluetooth/6lowpan_control), but only for a short period of time after the interface is removed (the physical layer is disconnected) automatically. The time that the interface is up is random, but it never exceeds the 30 seconds aprox., and sometimes it disconnects almost inmediately.

The log messages when the interface disconnects:
<info> app: Got IP Application Handler Event on interface 0x20003EE8
<info> app: Interface removed!
<info> app: Physical layer disconnected.
<info> app: Physical layer in connectable mode.

I was able to perform a ping successfully when the interface was up (from the Raspberry to my custom board).
I was able to send a neighbor solicitation (pressing button 1) and get the neighbor advertisement from the Raspberry.
The two above operations are aborted if the interface goes down (removed) in the middle of the operation.

I previously search in the Devzone for similar topics, and I found a couple but without a resolution of the problem.

Note: The only change I needed to do was to set to zero the BLE_6LOWPAN_LEGACY_MODE in the sdk_config file.

My setup:
- Raspberry Pi 3 B+, with Raspbian 10 (buster), (Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux)
- Custom Board with nRF52840
- SDK v16.0.0.
- Softdevice s140 v7.0.1

- Visual Studio Code / gcc

Thank in advance,
Best Regards,

José Forno

Parents
  • Hi, are you able to keep the connection if you use a normal BLE example and connect to your phone? Can you try for instance the ble_app_hrs example in the SDK and connect using nRF Connect app on Android/iOS. There are precompiled hex files in the SDK you can use to test.

    Are you able to provide a BLE sniffer log?

  • Hi Stian,
    Thanks for the answer.
    Before doing this ICMP test with the IoT library, I successfully tested some basic applications with the BLE library. I was able to run some custom services in my custom board and it connected to my iPhone (with nRF Connect app) with no issue.
    Now, for only test, I tried to connect using the ICMP application with the nRF Connect app in my iPhone. It connected ok, but only for 30 seconds (approx) and then it disconnects. My iPhone don't have Bluetooth BLE, so I did another test. This time I used the desktop PC version of the nRF Connect and a nRF52 Dongle as a interface. It connected ok, and this time it stay connected all the time.

    I'm also now testing with another distribution of linux in my raspberry. The distro is Ubuntu 18.04.4 LTS (Bionic Beaver), and the kernel is 5.3.0-1022-raspi2.
    It didn't have the bluetooth interface enabled, so after some struggle I was able to do a scan and it detects my custom board with the ICMP firmware, but I can't connect , the command:
    echo "connect 00:AA:BB:XX:YY:ZZ 1" > /sys/kernel/debug/bluetooth/6lowpan_control
    , don't do anything.

    I can't do BLE sniffer because I don't have the proper board to flash.
    I'm going to keep trying.

    Thanks,

    José Forno

  • Thanks for the explanation. What we can try to do is if you send me the ICMP hex-file, then I can flash it here on a test board, and try to connect to iPhone or RPi and see if I can reproduce the disconnections. I can run the sniffer here and see what happens over air. Which iPhone version do you have?

    I'm also running Ubuntu 18.04 here, so I though I could share a script which I use to connect to BLE 6LowPAN devices:

    init_6lowpan.sh

    Usage: sudo ./init_6lowpan.sh 00:AA:BB:XX:YY:ZZ

    It should initialize what is needed and try to connect to the given mac address.

  • Hi Stian,

    Thanks for your help.
    I attach the hex file. I also attach the "nrf52840_mdk.h" file only for reference, which defines the pinout of my custom board (buttons and leds).
    (By the way, the firmware is the same as the ICMP example, only the pins definitions and the BLE_6LOWPAN_LEGACY_MODE = 0 were changed).

    I have a iPhone 5C (pretty old :).
    Thanks for sharing the script file!

    <********EDIT*********>

    I just tested with Ubuntu MATE (18.04.2 LTS (Bionic Beaver) kernel 4.15.0-1032-raspi2), and it worked!.

    Now I can connect and ping without disconnections, so the ICMP firmware wasn't the problem.

    I don't now the reason why the raspbian and the other Ubuntu didn't work, but for now it allows me to keep with my development process.

    Best regards

    José Forno

    4848.nrf52840_xxaa.hex

    nrf52840_mdk.h

Reply
  • Hi Stian,

    Thanks for your help.
    I attach the hex file. I also attach the "nrf52840_mdk.h" file only for reference, which defines the pinout of my custom board (buttons and leds).
    (By the way, the firmware is the same as the ICMP example, only the pins definitions and the BLE_6LOWPAN_LEGACY_MODE = 0 were changed).

    I have a iPhone 5C (pretty old :).
    Thanks for sharing the script file!

    <********EDIT*********>

    I just tested with Ubuntu MATE (18.04.2 LTS (Bionic Beaver) kernel 4.15.0-1032-raspi2), and it worked!.

    Now I can connect and ping without disconnections, so the ICMP firmware wasn't the problem.

    I don't now the reason why the raspbian and the other Ubuntu didn't work, but for now it allows me to keep with my development process.

    Best regards

    José Forno

    4848.nrf52840_xxaa.hex

    nrf52840_mdk.h

Children
No Data
Related