• AVR Freaks

Helpful ReplyHot!RN4871 trying to send more than 20 bytes of data in a GATT characteristic

Author
Krawlow
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/12 03:54:51
  • Location: 0
  • Status: offline
2019/02/13 04:53:45 (permalink)
0

RN4871 trying to send more than 20 bytes of data in a GATT characteristic

Hello,
 
I would like to take advantage of DLE (data length extension) to send more data through GATT. Firstly some background information: I accidentaly "bricked" my device into deleting its own MAC Address, after reboot its MAC Adress is 000000000000. It is also unable to advertise its device name.
 
After a latest firmware flashing, I run the following commands:
hardware reset
$$$
SF,1
$$$
SS,00
PZ
PS,11001100110011001100110011001100
PC,11001100110011001100110011001101,1A,32
SN,Roll
R,1
$$$
&,DFDF12233445
SHW,0072,2074686973206d657373616765206973203530206279746573206c6f6e672121212121212121212121212121212121212121
 
See the response of each command in "Screenshot_1.png".
 
On my phone I am using the application "LightBlue Explorer" (but I have used many others with no succesful results) to subscribe to the defined characteristic and there I receive the following 20 bytes:
20 74 68 69 73 20 6D 65 73 73 61 67 65 20 69 73 20 35 30 20
Which coincide with the first 20 bytes of my 50 bytes characteristic value.
 
Which is the way to transfer more than 20 bytes through a GATT Characterisic? Is there any?
 
I have also tested that you must define a characteristic with its data size, but you then can write onto it more bytes than defined. (command answers OK) How is the data size information used? When writting more bytes than the size defined, which data is actually sent?
 
Thank you,
Aleix.
 

Attached Image(s)

#1
wcliew
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/11 17:58:38
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/13 18:07:52 (permalink) ☄ Helpfulby Krawlow 2019/02/14 01:02:47
0
Hi,
 
You can use S:,0000,<mac> to set the MAC address, the QR code on the shield metal of the module contains its MAC.
 
the default characteristics can send data over 20 bytes.
#2
Krawlow
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/12 03:54:51
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/14 01:49:47 (permalink)
0
wcliew
Hi,
 
You can use S:,0000,<mac> to set the MAC address, the QR code on the shield metal of the module contains its MAC.


Thanks! I didn't know about that command. By the way, I am unable to read the QR code with my phone camera (Sony Xperia XZ), can I get some clues on how to read it? Thanks
 
wcliew
 
the default characteristics can send data over 20 bytes.


 Is that the only way to send more than 20 bytes? And what Handler do you use to write those characteristics? Also, the default characteristics cannot be read by the client, and I need that, so even if they can be used to send more than 20 bytes, I would need private characteristics.
#3
S13
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/02/18 08:58:13
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/19 17:44:55 (permalink)
0
Im running in to exactly the same problem!
 
Have you figured it out? Or is the only way to partition the data over several private characteristics?
 
The other direction works ok btw. I can transfer 56 bytes from LightBlue Explorer with a single write to my RN4871 without any problem. 
#4
S13
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/02/18 08:58:13
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/20 01:36:41 (permalink)
0
Krawlow
I have also tested that you must define a characteristic with its data size, but you then can write onto it more bytes than defined. (command answers OK) How is the data size information used? When writting more bytes than the size defined, which data is actually sent?

 
Ive seen this as well... And it goes both ways. When writing data from LightBlue Explorer you can also write more data than the size of the characteristic. It seems that the data beyond the size of the char is ignored, so only the first data is actually used.  
#5
Krawlow
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/12 03:54:51
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/22 01:26:23 (permalink)
0
S13
 
Ive seen this as well... And it goes both ways. When writing data from LightBlue Explorer you can also write more data than the size of the characteristic. It seems that the data beyond the size of the char is ignored, so only the first data is actually used.  


Then, how is this module supposed to make use of DLE? Because it is enabled by default in the latest firmware and they claim that it is not able to send up to 251 just up to 151 If I remember correctly. How did they do it to know that? I have even taken a look to the bluetooth frames and they show a MTU of more than 151 but only use 20 bytes of load.
#6
AndreyPS
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/02/27 22:52:11
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/02/28 23:33:42 (permalink)
0
I can't send more than 20 bytes in RN4871U module. 


CMD> V 
RN4870 V1.30 3/18/2018 (c)Microchip Technology Inc 

CMD> D 
Connected=no 
Authen=2 
Features=0000 
Services=00 


One characteristic Read + Notify, 64 bytes: 

CMD> PZ 
AOK 
CMD> PS,378B4074C2B845FF894C418739E60000 
AOK 
CMD> PC,3890BE9F3A5E459DB799102365770001,12,40 
AOK 
CMD> R,1 


After reset: 

CMD> SHW,0072,000102030405060708090A0B0C0D0E0F1011121314151617 
AOK 
CMD> SHR,0072 
000102030405060708090A0B0C0D0E0F10111213 

I can read 20 bytes only. 
Android App with Bluetooth 4.2 receives 20 bytes only too. 


For Write characteristic App writes 64 bytes and module receives all 64 bytes - it's Ok.
#7
Krawlow
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/12 03:54:51
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/05 01:37:57 (permalink)
0
AndreyPS

For Write characteristic App writes 64 bytes and module receives all 64 bytes - it's Ok.


 
Hello AndreyPS,
 
I do not understand you, what do you mean in that phrase?
#8
AndreyPS
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/02/27 22:52:11
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/05 01:59:12 (permalink)
0
Krawlow
AndreyPS

For Write characteristic App writes 64 bytes and module receives all 64 bytes - it's Ok.


 
Hello AndreyPS,
 
I do not understand you, what do you mean in that phrase?


I can send more than 20 bytes from Android App to module.
 
I can`t send more than 20 bytes from module to Android App.
20 bytes only maximum.
#9
wcliew
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/11 17:58:38
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/20 20:07:15 (permalink)
0
Hi All,
 
Update FW to Ver1.28 or Ver1.30 should be able to send data over 20bytes. I used Android App named "Serial Bluetooth Terminal".
 
 
#10
wcliew
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/11 17:58:38
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/20 20:08:52 (permalink)
0
Krawlow
wcliew
Hi,
 
You can use S:,0000,<mac> to set the MAC address, the QR code on the shield metal of the module contains its MAC.


Thanks! I didn't know about that command. By the way, I am unable to read the QR code with my phone camera (Sony Xperia XZ), can I get some clues on how to read it? Thanks
 
wcliew
 
the default characteristics can send data over 20 bytes.


Is that the only way to send more than 20 bytes? And what Handler do you use to write those characteristics? Also, the default characteristics cannot be read by the client, and I need that, so even if they can be used to send more than 20 bytes, I would need private characteristics.




Hi, use the webcam to shot at the QR and use the QR reader App on mobile phone to scan it...Kind of stupid, but the QR is really too small to be resolved by the mobile camera.
#11
AndreyPS
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/02/27 22:52:11
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/24 23:22:27 (permalink)
0
I can't send more than 20 bytes in RN4871U module.
 
CMD> V
RN4870 V1.30 3/18/2018 (c)Microchip Technology Inc

 
Microchip company has already half a year firmware version 1.30.2 beta, which fixes this problem:
CMD> V 
RN4870 V1.30.2 b1 6/8/2018 (c)Microchip Technology Inc
#12
Krawlow
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/02/12 03:54:51
  • Location: 0
  • Status: offline
Re: RN4871 trying to send more than 20 bytes of data in a GATT characteristic 2019/03/25 01:10:25 (permalink)
0
AndreyPS
 
Microchip company has already half a year firmware version 1.30.2 beta, which fixes this problem:
CMD> V 
RN4870 V1.30.2 b1 6/8/2018 (c)Microchip Technology Inc




Yes, I got it sent by the support, here's a link to download it: https://mega.nz/#!aRojGSy...fCy8mIKXm2rdFsY2SietPI
#13
Jump to:
© 2019 APG vNext Commercial Version 4.5