BLE UART Friend change '+++\n' AT switch character to ex: '$

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
LeTardif
 
Posts: 3
Joined: Wed Sep 29, 2021 10:11 am

BLE UART Friend change '+++\n' AT switch character to ex: '$

Post by LeTardif »

Hi,

I would like to know if it would be possible to change the character to switch back and forth in AT and UART mode from '+' to ex: '$'. I'm working on a project that i need to replace an old bluetooth 2 serial dongle to this BLE UART Friend, and the '+' character is really important in our protocol...

Weird coincidence cause i'm using this single character '+' as an ACK between my app and the device and the BLE UART friend is grabbing the character and does not transmit it to the device ( unless i write '++++' ) so i get a bunch of weird errors...

Thank you !

User avatar
mikeysklar
 
Posts: 14092
Joined: Mon Aug 01, 2016 8:10 pm

Re: BLE UART Friend change '+++\n' AT switch character to ex

Post by mikeysklar »

I believe the command ATSESC allows you to chance the default value of "+" (ascii 43) to another character.

Code: Select all

ATSESC,43
Screen Shot 2021-09-30 at 12.14.45 PM.png
Screen Shot 2021-09-30 at 12.14.45 PM.png (62 KiB) Viewed 324 times
https://www.multitech.com/documents/pub ... 00360i.pdf

User avatar
LeTardif
 
Posts: 3
Joined: Wed Sep 29, 2021 10:11 am

Re: BLE UART Friend change '+++\n' AT switch character to ex

Post by LeTardif »

Yep, that's exactly what i need !

But i don't think the command is directly available from the command mode on the UART unfortunately... ( Just tested.. )

I tried

AT+SESC=36
ATSESC,36

But it returns ERROR...

I really need the switch from CMD to UART to change baudrate in different situations, and i need the single char '+' to work for my acknowledge... :/

Is it possible to get this command implemented in future firmware updates ? AT+SESC=? It would be very handy... at least for my case..

Just to be exact i'm using this module :https://learn.adafruit.com/introducing- ... art-friend

User avatar
mikeysklar
 
Posts: 14092
Joined: Mon Aug 01, 2016 8:10 pm

Re: BLE UART Friend change '+++\n' AT switch character to ex

Post by mikeysklar »

Which version of the firmware are you running executing ATI should show your revision.
I see there is a note with the 0.77 release there is a faster escape code to trigger switching.
Implemented a '\+' escape code to immediately send '+' chars without trigger the +++ delay waiting for further similar input
https://learn.adafruit.com/introducing- ... -2374228-2


I know that you can disable the '+++' switches to prevent mode switching. Not really what you are looking for, but might be useful if options are limited.

'0' disables
'1' enables

https://learn.adafruit.com/adafruit-fea ... 2176558-15

Code: Select all

AT+MODESWITCHEN=ble,0

User avatar
LeTardif
 
Posts: 3
Joined: Wed Sep 29, 2021 10:11 am

Re: BLE UART Friend change '+++\n' AT switch character to ex

Post by LeTardif »

Code: Select all

ATI

BLEFRIEND32
nRF51822 0x0146
07D375A864CE02C0
0.8.1
0.8.1
Apr 10 2019
S110 8.0.0, 0.2
OK
I uploaded the latest firmware from the bluefruit app.

I tried the escape '\+' , it seems to work but sometimes its triggering the BLE UART Friend and he returns '?' ( like he doesn't know what to do with it )

Here are my logs from the app :

TX are the raw bytes i am sending from the app,
RX are the raw bytes received from the BluetoothGatt onCharacteristicChanged

Code: Select all

D/TX: \+ // Our protocol acknowledge
D/LOGS RECEIVED: PP
D/LOG INDEX: 30
D/TOTAL LOGS: 80
D/DEBUG: Characteristic write successful
D/RX: %0000000000000000000 // Normal log reception
D/RX: 00F0
D/WRITE_NORMAL: [B@a6a440f
D/TX: \+ // Our protocol acknowledge
D/LOGS RECEIVED: PP
D/LOG INDEX: 31
D/TOTAL LOGS: 80
D/DEBUG: Characteristic write successful
[b]
D/RX: ?   // This is not part of my software, probably the BLE UART Friend returning this.
[/b]
I disabled the mode switching local side as you shown ( AT+MODESWITCHEN=local,0 ) to be able to receive Acknowledges from the hardware without worrying about the module grabbing it

But application side, i really need the mode switching ( '+++\n', im switching baudrates for app mode and bootloader mode to update firmwares ) and the '+' ( weird coincidence that is the character that we are using for our acknowledge we are using back and forth )

Our hardware cannot be updated manually, it would be too much hassle to update manually thousands of devices in the field.. These dongles are used to make diagnostics and update hardware firmwares by bluetooth...

Would it be possible to implement a new AT command similar to AT+SESC=? to change the '+' to example '$' ?

Thank you so much for your responses !

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”