I cannot sniff/detect BLE packets generated by Bluetooth Low Energy Communication toolbox + SDR (ADALM-PLUTO and WARP v3)

19 ビュー (過去 30 日間)
Chu Danis
Chu Danis 2021 年 1 月 11 日
編集済み: Chu Danis 2021 年 1 月 11 日
I am designing a course on wireless communication for undergraduate students; and I want to take the Bluetooth Low Energy Communication (in communication toolbox) as an example. What I wanted to do is to generate an ADV_NON_CONN_IND (non connectable BLE advertising) packet and use a SDR to send the samples out to the air and then capture them use a device like a smartphone or TI CC2540 dongle (capable of BLE packet sniffing). My codes are as follows. The waveform can be demodulated successfully by the function 'helperBLEPhyBitRecover', but this packet cannot be detected by CC2540 or my smartphone.
commSupportPackageCheck('BLUETOOTH');
cfgLLAdv = bleLLAdvertisingChannelPDUConfig;
cfgLLAdv.PDUType = 'Advertising non connectable indication';
cfgLLAdv.AdvertisingData = '0123456789ABCDEF';
cfgLLAdv.AdvertiserAddress = '1234567890AB';
% Genrate PDU
messageBits = bleLLAdvertisingChannelPDU(cfgLLAdv);
% Generate IQ waveform
phyMode = 'LE1M'; % Select one mode from the set {'LE1M','LE2M','LE500K','LE125K'}
sps = 20; % Samples per symbol
channelIdx = 37; % Channel index value in the range [0,39]
accessAddLen = 32;% Length of access address
accessAddHex = '8E89BED6'; % Access address value in hexadecimal, '8E89BED6' for BLE
accessAddBin = de2bi(hex2dec(accessAddHex),accessAddLen)'; % Access address in binary
% Symbol rate based on |'Mode'|
symbolRate = 1e6;
if strcmp(phyMode,'LE2M')
symbolRate = 2e6;
end
% Generate BLE waveform
txWaveform_1 = bleWaveformGenerator(messageBits,...
'Mode', phyMode,...
'SamplesPerSymbol',sps,...
'ChannelIndex', 37,...
'AccessAddress', accessAddBin);
% Prepare resampling
txFrameLength = length(txWaveform_1);
txFrontEndSampleRate = symbolRate*sps;
% Matched to the RF circuit
% WARP is set to CHANNEL1 in WLAN
ts = 1/40e6; %Sampling frequency of WARP v3
delta_freq_1 = 2.402e9-2.412e9;
txWaveform_resample_1 = resample(txWaveform_1,40e6,txFrontEndSampleRate);
% Upconvert to digital IF
timeseq = 0:ts:(length(txWaveform_resample_1)-1)*ts;
IF_seq_1 = exp(1j*2*pi*delta_freq_1*timeseq);
IF_sig_1 = txWaveform_resample_1.*IF_seq_1.';
IF_sig_1 = IF_sig_1./max(abs(IF_sig_1));
% Output to WARP v3
wave_iq_1 = IF_sig_1;
I have verified that txWaveform_1 can be demodulated by the MATLAB inner BLE function 'helperBLEPhyBitRecover'.
I have checked the use of WARP, and can see the signal in the spectrum analyzer in the right place (center = 2402MHz).
However, after sending the signal to the air, I cannot capture the packet. I use the a desktop software SmartRF Packet Sniffer + CC2540 dongle to sniff the channel 37 (2402MHz) .

回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Bluetooth Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by