Hi. I am using QN9080-DK to send data to PC as Notification and do a plot with Matlab.
I want to set the BLE physical layer to 2M physical layer because high data transmission speed is required.
I am testing using the Wireless_Uart example and changed the gBleUseHSClock2MbpsPhy_c macro from 0 to 1 to set the 2M physical layer.
However, even though I changed the gBleUseHSClock2MbpsPhy_c macro to 1, the data transfer rate was the same. I checked the code to find out why the speed didn't change.
It seems to me that when the gBleUseHSClock2MbpsPhy_c macro is activated, Gap_LeSetPhy is called from the ble_conn_manager.c file and the gLeSetPhy function is called and set gLePhy2MFlag_c.
The strange thing is that if you look at the function as shown below, not only gLePhy2MFlag_c is set, but gLePhy1MFlag_c seems to be used as well.
(void)Gap_LeSetPhy(TRUE, 0, 0, gLePhy1MFlag_c | gLePhy2MFlag_c, gLePhy1MFlag_c | gLePhy2MFlag_c, 0);
Since gLePhy1MFlag_c does not seem to increase the speed, I deleted gLePhy1MFlag_c to not use 1M phy and changed the function as shown below.
(void)Gap_LeSetPhy(TRUE, 0, 0, gLePhy2MFlag_c, gLePhy2MFlag_c, 0);
However, this time QN9080-DK and PC did not have BLE connection.
What am I doing wrong here?
I wonder what exactly is the method for setting 2M physical and how to do it.
Solved! Go to Solution.
In theory, MTU=244, 1M phy max speed is about 63kB/s, 2M PHY is about 120kB/s. This is the max speed.
Hello,
I try similar things to communicate with QN9080 and PC (send Byte data from QN9080 to PC and plot in MATLAB). I now use QPP private_profile (not special reason, it is okay if i succeed data transmission through UART).
I'm now using Connectivity QTool (PC) or loT toolbox (phone) for communication. However, both are hard to use (limited data transmission Bytes length, hard to extract data through my PC, etc...). Is there any other way in PC to communicate with QN9080 through QPP or UART(other BLE browser)?
In that case, how can transfer my bytes data from qn9080 to PC? Please help,
Thanks,
Hi,
Please refer this link. You can also use the example 'private profile client' and 'private client server' to test the speed.
Hi
Thank you for your reply.
I tested speed using private profile client/server examples with two QN9080-DK.
First, I tested without changing the code for 1M phy.
Second, I tested by changing the gBleUseHSClock2MbpsPhy_c value in the app_preinclude.h file to 1 for 2M phy.
However, in both cases the speed was the same, around 0.6Mbps.
I don't understand why the speed remains the same despite the change from 1Mbps to 2Mbps.
Is there any other setting other than changing gBleUseHSClock2MbpsPhy_c value to 1 to set 2M phy?
Please check attached images.
Best regards.
Oh.
Hi,
For 2M mode, please setting the parameters:
In qppc:
if ((mSupportedFeatures & ((uint32_t)gLe2MbPhy_c | (uint32_t)gLeCodedPhy_c)) != 0U)
{
(void)Gap_LeSetPhy(FALSE, 0, 0, gLePhy2MFlag_c, gLePhy2MFlag_c, 0);
//(void)Gap_LeSetPhy(FALSE, peerDeviceId, 0, gConnPhyUpdateReqTxPhySettings_c, gConnPhyUpdateReqRxPhySettings_c, gConnPhyUpdateReqPhyOptions_c);
}
Please use the IOT toolbox to test. This is more easier and precise. When you use iot toolbox, don't forget to set PHY.
Hi
Thank you for your reply.
As you mentioned, I tested single QN9080-DK with NXP Iot toolbox app in an android phone.
First, when using the Private_profile_client example, Bluetooth connection was not established with the phone. This is probably because the phone is set as the client and cannot be changed. So, I set QN9080-DK as the server for Bluetooth connection using Private_profile_server example.
Second, the data rate was measured without changing the code of the Private_profile_server example at all. In this case, 1M Phy was expected to be used, so I set only LE 1M in QPP of the NXP Iot toolbox and set the Request MTU to 247.
At 1M Phy, the measurement result was 47370 Bps.
Third, I changed the code you pointed out in the Private_profile_server example. However, there were some differences in server example from the client example, and the codes I changed are as follows.
In qpps:
1. #define gBleUseHSClock2MbpsPhy_c 1
2. #define gGapConnEventLengthMin_d = 0xFFFF,
3. #define mQppsTxInterval_c (0)
4. #define gConnPhyUpdateReqTxPhySettings_c (gLePhy2MFlag_c)
5. #define gConnPhyUpdateReqRxPhySettings_c (gLePhy2MFlag_c)
6. #if 1//gConnInitiatePhyUpdateRequest_c
if ((mSupportedFeatures & ((uint32_t)gLe2MbPhy_c |(uint32_t)gLeCodedPhy_c)) != 0U)
{(void)Gap_LeSetPhy(FALSE, 0, 0, gLePhy2MFlag_c, gLePhy2MFlag_c, 0);
//(void)Gap_LeSetPhy(FALSE, peerDeviceId, 0, gConnPhyUpdateReqTxPhySettings_c, gConnPhyUpdateReqRxPhySettings_c, gConnPhyUpdateReqPhyOptions_c);
}
In this case, 2M Phy was expected to be used, so I set only LE 2M in QPP of the NXP Iot toolbox and set the Request MTU to 247.
At 2M Phy, the measurement result was 54737 Bps.
Contrary to expectations, switching to 2M Phy did not double the speed.
Is it correct that 2M phy is set normally?
How can I get the speed higher than 1M bps?
Hi
Thank you for your kind reply.
I tested the attached file and measured an improved data rate of about 104432 Bps.
Is this the maximum data rate that can be implemented with 2M Phy?
Or is there any way to make it higher?
I'm trying to speed it up to over 1M bps.
In theory, MTU=244, 1M phy max speed is about 63kB/s, 2M PHY is about 120kB/s. This is the max speed.
Thank you very much for your kind reply.
Your reply has been very helpful in developing the device.
Thank you.
Best regards.
Oh.