Argon BLE UART Question

I’m not sure if I’m even thinking about this right. I have a Photon with old-style bluetooth HC-06 attached to TX/RX that I use successfully with Serial1.read and .printf. Works great. For packaging reasons I’m trying to replace with Argon BLE UART. The tutorial examples don’t work for me. The error messages on the various Android (Pixel 5a) apps are “Discovering services…error connecting…” of that nature. Some of the apps appear to connect then disconnect right away. I’m using the basic BLE UART example plus the BleSerialPeripheralRK library that packages basic operations into class. I use OS 5.1.0 Argon but same thing has happened with other versions. Below is the ino. The same thing happens using iPhone with nRF Toolbox app so I think I’ve ruled out Android issue. After hours I’m wondering if I need a reality reset from somebody. Am I even framing my work properly?

/*

  • Project ble_soc1a_test
  • Description:
  • Author:
  • Date:
    */
    #include “BleSerialPeripheralRK.h”

SerialLogHandler logHandler;

SYSTEM_THREAD(ENABLED);

// First parameter is the transmit buffer size, second parameter is the receive buffer size
BleSerialPeripheralStatic<256, 256> bleSerial;
const unsigned long TRANSMIT_PERIOD_MS = 2000;
unsigned long lastTransmit = 0;
int counter = 0;

void setup() {
Serial.begin();

// This must be called from setup()!
bleSerial.setup();
bleSerial.advertise();

}

void loop() {
// This must be called from loop() on every call to loop.
bleSerial.loop();

// Print out anything we receive
if(bleSerial.available()) {
	String s = bleSerial.readString();
	Log.info("received: %s", s.c_str());
}

if (millis() - lastTransmit >= TRANSMIT_PERIOD_MS) {
	lastTransmit = millis();
	// Every two seconds, send something to the other side
	bleSerial.printlnf("testing %d", ++counter);
	Log.info("counter=%d", counter);
}

}

It’s hard to say for sure. I just tested the example 1 from the BleSerialPeripheralRK library, which looks like your code above. I ran it on an Argon with Device OS 4.0.1.

I tested on an Samsung Galaxy A10 using the Adafruit Bluefruit Connect app and it was able to connect successfully and get the “Testing” message displayed in the UART view.

nRFToolbox for Bluetooth LE also could display the UART data. Be sure to turn off the Name filter since the device will probably not have a name.

Since BLE UART modes are not entirely standardized, those are the only two apps that I know will work.

Eventually tried an old phone I have worked with a 2015 Motorola Android and Bluefruit!!! WTF? Android phone issue for sure.

I rebuilt and reflashed app and OS to 4.0.1. Running nRF I can verify the 3 gatt characteristics set. Then 28 seconds later it auto-disconnects with status 0. I never see an option to start a UART session. Is it waiting for me to initiate something then times out? Running Bluefruit it sits "Discovering services… for about 30 seconds (same 28 sec?) then ‘error connecting’ and then doesn’t display any mode options. Does Android have security features I have to set? I don’t know. These types of problems are frustrating. I have a super-old Motorola Android I just tried with Bluefruit and it works!! Some kind of Android security feature I’m running into. Thanks!

1 Like

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