drtyhlpr/ble_dump

Segfault: 'top_block_sptr' object has no attribute 'message_queue'

cloatre opened this issue · 2 comments

Hello,

Wich version of GnuRadio is required?
I have a segfault and try to find what is going wrong:


$ python ble_dump.py -o /tmp/dump1.pcap
linux; GNU C++ version 4.9.2; Boost_105500; UHD_003.010.000.git-0-ef57ffcb

gr-osmosdr v0.1.4-72-g164a09fc (0.1.5git) gnuradio v3.7.10-1-ge55666b7
built-in source types: file osmosdr fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy redpitaya
Number of USB devices: 11
USB device 1d50:6089: 000000000000000014d463dc2f4375e1 skip
USB device 1d50:6089: 000000000000000014d463dc2f3b23e1 match
Using HackRF One with firmware 2015.07.2

ble-dump: SDR Bluetooth LE packet dumper

Capture settings:
Base Frequency : 2402000000 Hz
Sample rate : 4000000 Hz
Squelch threshold : -70 dB

Low-pass filter:
Cutoff frequency : 850000 Hz
Transition width : 300000 Hz

GMSK demodulation:
Samples per Symbol : 4.0000
Gain Mu : 0.7000
Mu : 0.5
Omega Limit : 0.0350

Bluetooth LE:
Scanning Channels : 37, 38, 39
Scanning Window : 10.24s
Disable CRC check : False
Disable De-Whitening : False

PCAP output file : /tmp/dump1.pcap

Capturing on BLE channel [ 37 ] @ 2402 MHz
Traceback (most recent call last):
File "ble_dump.py", line 147, in
gr_buffer += gr_block.message_queue.delete_head().to_string()
File "/root/gnuRadioPybomb/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 92, in getattr
return getattr(self._impl, name)
AttributeError: 'top_block_sptr' object has no attribute 'message_queue'
Segmentation fault


Ok, I forgot to make your "sed" command:

sed -i -e "s/message_sink_msgq_out,/message_queue,/" -e "s/message_sink_msgq_out = virtual_sink_msgq_in/self.message_queue = message_queue/" ./grc/gr_ble.py

[EDIT]
Yeah, it seems to work: when I open in wireshark I see the ID of my devices:

  • F4:B8:5E:E7:AD:FA (my Revogi bulb)
  • 00:00:46:76:62:01 (my veraPlus box)

screenshot from 2016-08-31 09 36 35

I see in wireshark only paquet from channel 38 and I have send switch ON/OFF command, where can I see/retrieve that?
(at the end, I would like to send BLE paquet to switch ON/OFF my device)

Thanks,

hi cloatre I am currently walking through gnuradio hell - I have problems to get modules working with the latest version. and or problems with uhd/usrp stuff. I have a c++ version of the module almost up and running... well I need to have it running soon.

I had some problems receiving all ble packets with the python script and havent used it since a couple of months. the c++ version, hopefully released the next months will include SB,ESB,BLE and GAZELL. The channel hopping is still a pain in the ...

if I am right . then your ON-OFF command is a DATA packet - DATA packets - or "following a ble data connection" is not yet included. In general "the magic happens" with the scan_req/scan_rsp packets - these packets are needed because they include the value that is used for CRC calc. so in simple words - a sniffer has to read information in this packets - then switch the channel - and use the CRC initial value from the information scan_resp. check the ble standard documentation - DATA packets , DATA packets CRC. I am sorry that this feature is not completed yet in the script (I had issued receiving scan_rsp packets, only received a very low %)