Hi,
I am having RAK11720. i need to develop a custom board which has the main controller as RAK11720. i like to use the Arduino IDE for custom firmware. i need to know that, is it possible to use the Bluetooth OTA Firmware update?
It is automatically enabled after restart for ~30 seconds.
If you keep BLE advertising alive, the device will be detected by the Ambiq application and you can start the upload.
But, we are not giving any guarantee for this application. In my experience, it is very slow, there is no documentation about it and it has a tendency to fail during the update.
But Ambiq did not release any documentation about the update protocol. RUI3 is using pre-compiled code from Ambiq for BLE-OTA DFU.
I have Uploaded the below Program to RAK11720.
But in the app i tried scan devices no any device is showing in it.
/***
*
In this example, the device will create a BLE Uart characteristic.
When BLE receive data in specific pattern (“EE” or “BB” in ascii for example),
the device will send message both in Serial and BLE(Serial6).
***/
void setup()
{ //api.system.restoreDefault();
//If you want to read and write data through BLE API operations, you need to set BLE Serial (Serail6) to Custom Mode
Serial6.begin(115200, RAK_CUSTOM_MODE); // RAK_CUSTOM_MODE, RAK_AT_MODE
Serial.begin(115200);
delay(2000);
Serial.println("RAKwireless BLE UART Example");
Serial.println("------------------------------------------------------");
uint8_t pairing_pin[] = "123456";
Serial.println("Setting pairing PIN to:");
Serial.println((char *) pairing_pin);
api.ble.uart.setPIN(pairing_pin, 6); //pairing_pin = 6-digit (digit 0..9 only)
// Set Permission to access BLE Uart is to require man-in-the-middle protection
// This will cause apps to perform pairing with static PIN we set above
// now support SET_ENC_WITH_MITM and SET_ENC_NO_MITM
api.ble.uart.setPermission(RAK_SET_ENC_WITH_MITM);
api.ble.uart.start(0);
}
void loop()
{
static uint16_t addr;
addr = 0;
while (api.ble.uart.available()) { // TRUE or FALSE
All I do in my examples to have both BLE UART and OTA service available is:
// If available, enable BLE advertising for 30 seconds and open the BLE UART channel
#if defined(_VARIANT_RAK3172_) || defined(_VARIANT_RAK3172_SIP_)
// No BLE
#else
Serial6.begin(115200, RAK_AT_MODE);
api.ble.advertise.start(30);
#endif
I am guessing your code is missing the api.ble.advertise.start(30);
Serial.println("RAKwireless RAK11720");
Serial.println("------------------------------------------------------");
Serial.printf("Version: %s\r\n", sw_version);
// Start BLE UART advertisement for 30 seconds
api.ble.settings.blemode(RAK_BLE_UART_MODE);
api.ble.advertise.start(30);
}
void loop()
{
/* Destroy this busy loop and use timer to do what you want instead,
* so that the system thread can auto enter low power mode by api.system.lpm.set(1); */
// api.system.scheduler.task.destroy();
}
Remove the api.ble.settings.blemode(RAK_BLE_UART_MODE);
I am not using this, I am only using Serial6.begin(115200, RAK_AT_MODE); and I have BLE UART and BLE OTA
My Bad i allowed the location permission but didn’t turn on the location service. Once i turned it on all bluetooth devices shown and i tried uploading the bin file.
But it got stuck at 100%.
in the serial monitor it shows “CRC verify failed”.