Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BladeRF Trace Collection #10

Closed
mavaki opened this issue Jul 9, 2024 · 3 comments
Closed

BladeRF Trace Collection #10

mavaki opened this issue Jul 9, 2024 · 3 comments

Comments

@mavaki
Copy link

mavaki commented Jul 9, 2024

Hi,

I've been able to replicate your project (detailed on your GitHub Pages site) up until The Simplest Experiment. I'm using a BladeRF and nRF52 DK alongside a Docker container. But I'm running into issues with Configure Trace Collection. Here the command I'm running and its output:

screaming@host:~/screaming_channels/experiments$ sc-experiment --radio=bladeRF --device=/dev/ttyACM0 collect config/example_collection_plot.json ../../traces/example_collection_data --plot
linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

Enter start channel (two decimal digits, 00 to 80):

0

TX modulated carrier

Entering tiny_aes_128 mode

Setting number of repetitions to 120

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp 
Opening nuand bladeRF with device identifier string: "*:instance=0"

FATAL: [bladeRF source] Failed to open bladeRF device *:instance=0

Trying to fill up 1 missing channel(s) with null source(s).
This is being done to prevent the application from crashing
due to gnuradio bug #528.

  [####################################]  100%Warning! empty data after drop start, replacing with zeros

Exiting tiny_aes_128 mode

I'm wondering if you have any idea what I can do to resolve this? I'm using Arch Linux, and I have noticed a few differences when running commands inside/outside of the Docker:

Host:

$ lsusb
Bus 004 Device 009: ID 2cf0:5250 Nuand LLC bladeRF 2.0 micro

$ bladeRF-cli -p
  Description:    Nuand bladeRF 2.0
  Backend:        libusb
  Serial:         5775df50f2bc406dbb211c2b441f25dd
  USB Bus:        4
  USB Address:    9

Docker:

$ lsusb
Bus 004 Device 009: ID 2cf0:5250

$ bladeRF-cli -p
  probe: No devices are available. If one is attached, ensure it
         is not in use by another program and that the current
         user has permission to access it.

Based on the Dockerfile, it appears that gr-bladerf was never included, but I receive an error when trying to install it in the Docker container because gnuradio is outdated. Maybe it's worth trying to update gnuradio and its components so that I can install gr-bladerf, but I'm not even sure if that's the root of the problem. I'd be curious to know if you were able to get the BladeRF working for trace collections.

Any advice would be greatly appreciated. Thanks!

@mavaki
Copy link
Author

mavaki commented Jul 24, 2024

I'm now able to access the BladeRF device, but I'm having issues when running sc-experiment. Here is the command I'm running and its output:

screaming@host:~/screaming_channels/experiments$ sc-experiment --radio=bladeRF --device=/dev/ttyACM0 collect config/example_collection_plot.json ../traces/example_collection_data --plot
linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

0 0 0 0 0 0 0 0 0 0 0

Setting number of repetitions to 120

Traceback (most recent call last):
  File "/usr/local/bin/sc-experiment", line 11, in <module>
    load_entry_point('ScreamingChannels', 'console_scripts', 'sc-experiment')()
  File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/screaming/screaming_channels/experiments/src/screamingchannels/reproduce.py", line 421, in collect
    _send_key(ser, keys[0])
  File "/home/screaming/screaming_channels/experiments/src/screamingchannels/reproduce.py", line 260, in _send_key
    _send_parameter(ser, 'k', key)
  File "/home/screaming/screaming_channels/experiments/src/screamingchannels/reproduce.py", line 247, in _send_parameter
    check = ''.join(chr(int(word)) for word in x.split(' '))
  File "/home/screaming/screaming_channels/experiments/src/screamingchannels/reproduce.py", line 247, in <genexpr>
    check = ''.join(chr(int(word)) for word in x.split(' '))

I will note that x.split(' ') results in ['Setting', 'number', 'of', 'repetitions', 'to', '120\r\n']. I would have thought that it was supposed to set the number of repetitions before actually recording on the radio.

@mavaki
Copy link
Author

mavaki commented Jul 31, 2024

I finally got things working by upgrading gr-osmosdr (from 0.1.4 to 0.1.5). Here is a link to the original issue: Nuand/bladeRF#756 (comment). Once the bladeRF was working, I had to change a couple of things in reproduce.py before I could actually get a collection.

@mavaki mavaki closed this as completed Jul 31, 2024
@giocamurati
Copy link
Collaborator

I finally got things working by upgrading gr-osmosdr (from 0.1.4 to 0.1.5). Here is a link to the original issue: Nuand/bladeRF#756 (comment). Once the bladeRF was working, I had to change a couple of things in reproduce.py before I could actually get a collection.

Hi @mavaki I am really happy that you are interested in screaming channels and that you can now use the BladeRF. Feel free to drop me an email or open an issue if you need any further help replicating our experiments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants