Rak4631 bleuart doesn't work

I’ve tried all the bleuart example sketches for my Rak4631 in arduino. Nothing ever works. The service uid just never seems to be correct for any app to recognize it. When I use the nrf toolbox the uart tool says “Device was disconnected because required services are missing”. Why does bluetooth have to be so frustratingly difficult to use. All I want to do is to be able to send some settings via uart to the device.

Welcome to the forum @tavdog

Are you using RAK4631 with Arduino bootloader or RAK4631 with RUI3 bootloader?

What examples are you trying?

I am using the Arduino bootloader. The examples I have tried are :slight_smile:
ble_uart.ino from Rak board examples : ble_uart.ino · GitHub
I also tried the Adafruit Bluefruit example Adafruit_nRF52_Arduino/libraries/Bluefruit52Lib/examples/Peripheral/bleuart/bleuart.ino at master · adafruit/Adafruit_nRF52_Arduino · GitHub

Not an example, but a framework on top of Arduino: WisBlock-API-V2

  • LoRaWAN and LoRa drivers integrated
  • AT command interface (RUI3 compatible RUI3 AT command manual)
  • Setup of LoRaWAN over BLE UART with AT commands
  • Designed for event driven low power applications
  • Might still be working with an Android app WisBlock Tool Box for LoRaWAN settings as well, but that might be broken now as I could not keep up with new Android versions coming out.
    Still working on my old Android phone:

Not the easiest for beginners. But I am using this as a base for all my own applications.

If you want only the BLE part and AT command part, look at at_cmd.cpp and ble-nrf52.cpp

WisBlock API V2 and WisBlock Tool Box are not RAKwireless products! They are my own framework and tool that I created in my free time.

Ok, thanks. I didn’t realize you were the author of that library ! Thanks for doing that.
My application is reading constant serial data from a wind meter , calculating averages and then sending to lorawan on an interval. I’m sure the API framwork work great but I don’t have it in me to try to get all that serial interrupt stuff working for this small project. I created an issue on your 1267 github page asking you for an ble config example. Feel free to close it if you don’t want to do it.

I honestly don’t have the time for an BLE config example.

Why is the ble-uart.ino example not working for you? It is compiling and working for me.

I stitched something together. Hope it helps.

RAK4631-BLE-LORA-Setup

It is not very well tested. Use at your own risk.

Wow thank you so much. This compiles and runs on my rak4631 however I get the same problem as before. The serialUART doesn’t seem to be recognized by any of my ble serial apps. NRF toolbox uart mode : “Device was disconnected, because required services are missing.”
Adafruit Bluefruit : no uart service detected
NRF Connect shows all the DFU service, Batter Service, etc and Unknown service ending in EAFD (no UART service)
This same thing was happening with all the other examples.

I also installed your Wisblock-toolbox app on my Pixel7a (it still runs!). I also get the “The device does not have the required services”

So wierd.

BTW you’re the only other person I’ve found who puts the space in front of the build flag for easier readability ! Cheers! (eg. build_flags =
-D APP_DEBUG=1)

Here are the versions from pio

PACKAGES: 
 - framework-arduinoadafruitnrf52 @ 1.10601.0+sha.e13f5820 
 - framework-cmsis @ 2.50700.210515 (5.7.0) 
 - tool-adafruit-nrfutil @ 1.503.0 (5.3) 
 - tool-bossac-nordicnrf52 @ 1.10901.201022 (1.9.1) 
 - tool-openocd @ 3.1200.0 (12.0) 
 - tool-sreccat @ 1.164.0 (1.64) 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- SX126x-Arduino @ 2.0.30
|-- Adafruit Little File System Libraries @ 0.11.0
|-- Adafruit Internal File System on Bluefruit nRF52 @ 0.11.0
|-- Adafruit Bluefruit nRF52 Libraries @ 0.21.0

That’s weird.
I don’t have nRF Toolbox installed, but I can connect without problems with

nRF Connect

nRF Connect shows as well the correct characteristics

WisBlock Tool Box

Serial Bluetooth Terminal

No idea why the characteristic is not showing up on your device.

Quick test with nRF Toolbox, works as well.

So it is either your phone or something happened during compilation.

Can you try this UF2 file?
RAK4631-BLE-LORA_V1.0.0.uf2.zip (152.5 KB)

With your uf2 I get the same problem. The last service uid ends in EAFD again and no service ending in CA9E like yours. This board started out as a Meshtastic starter kit. Could the hardware somehow be different and not create the proper uid’s . I would think that would be in the software.

Try to flash this WisBlock-HW-Tester (it makes sure to erase every Meshtastic settings left on the device)
Then try again.
WB_HW_Test_V1.1.8.uf2.zip (186.4 KB)

The WisBlock Hardware Tester app does advertise on BLE as well with BLE UART.

Same unknown service with the HW Tester.

Last try, real factory reset of the device.
Flash the attached file, it is the bootloader and softdevice.
After that the device doesn’t have any application anymore. It will be in bootmode.
Then try the HW test again.
wiscore_rak4631_board_bootloader-0.4.3_s140_6.1.1.uf2.zip (24.8 KB)

Wow that did it ! You’re amazing !

Glad we got it back to work.

Just wondering why it happened in the first place?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.