Open blue-eyes1544 opened 5 years ago
I am also having this same problem with a clean Raspbian install on a Pi 3 B+ and an Ubertooth One. Everything is running the latest versions of everything as far as I can tell. I get 4 seconds of data and then it errors out, as above.
OK, I seem to have gotten around this error by modifying the "louis.rb" file that is referenced in the 2nd error message above. On a Raspberry Pi running Raspbian Stretch, I did the following:
cd /var/lib/gems/2.3.0/gems/louis-2.1.0/lib/ sudo chmod 777 louis.rb
Then, I opened /var/lib/gems/2.3.0/gems/louis-2.1.0/lib/louis.rb with simple text editor, deleted .compact
from line 35 and from line 40, and saved the file. Then I changed the file permissions on louis.rb back to 644 (not that it matters much in a hack this sloppy).
After that, blue_hydra runs without generating errors that bring it to a halt. There are a few warnings about discarding chunks with no addresses in the log file. I do not know if that is related to my change.
From a little googling, compact()
in Ruby is supposed to return a copy of the array with all the nil
elements removed, so now that section of louis.rb is probably returning the array instead of a copy of the array? This is the first time I've actually seen ruby code, so I don't understand the potential implications of this and I don't know what kind of havoc making this change to louis.rb is likely to unleash.
This issue is not entirely with BlueHydra. BlueHydra utilizes Louis for looking up addresses and attributing them to a manufacturer. Louis was being developed under https://github.com/pwnieexpress/louis but seems to have gone quiet as of October 2017. One of the contributors @sstelfox seems to have continued the project at https://github.com/sstelfox/louis. As of release 2.0.8 of Louis, the project added Hash#compact
to lines 35 and 40 of lib/louis.rb. This serves to remove elements with a 'nil' value from the returned hash (I didn't check if this would negatively impact BlueHydra), but wasn't added to the Ruby language until Ruby 2.4.0. BlueHydra currently claims to require Ruby version 2.1. By default, when you gem install louis
, you get the latest version, updated quite recently, and seemingly requiring Ruby >2.4.0.
Possible fixes to this are to either do bundle install
as recommended and then change the version of Louis to 2.0.7 (I don't ruby often so I would do
gem uninstall louis gem install louis -v 2.0.7
but there is likely a better way) or to change the required language from Ruby 2.1 to Ruby 2.4.0. Also I guess it may be possible to define the gemfile to grab the appropriate version, but then BlueHydra will stop receiving updates of Louis...
As for the Raspberry Pi (which is why I also found this bug), the default repository for when you issue apt install ruby-dev
is installing Ruby 2.3.3 (at least when I tried this recently), which should work fine for BlueHydra as stated, but doesn't support the latest Louis. I'll be submitting an issue to the new Louis repository as well to up-rev the required language.
After opening an issue to update the required Ruby version in Louis, @sstelfox implemented a backwards compatible fix, release 2.1.4, that should fix this particular issue.
I get the following error when running Blue Hydra. Blue Hydra will only run for a few seconds and then quit.