RadiusNetworks / scanbeacon-gem

A Ruby gem for scanning beacons
MIT License
30 stars 9 forks source link

Can't scan for iBeacon #33

Closed hhseine closed 7 years ago

hhseine commented 7 years ago

I have a bunch of iBeacon in a room but when I run my script I don't see any one of them. I had a look at the gem and commented lines 76-78, now it works but I still get an exception sometimes.

cupakromer commented 7 years ago

Thanks for reporting this. We'd like to get to the bottom of what is happening but need some more information about the issue you are facing:

hhseine commented 7 years ago

Hey, I'am running Linaro (Debian 8.6) on a Dragonboard, I commented lines 76-78 in the file beacon_parser.rb. The ruby version is 2.1.5 and is the latest one I can use on this OS. About the exception, it comes from the file 'field.rb'. After commenting those lines it seems that the data is sometimes equal null, so without handling this I get this : " /var/lib/gems/2.1.0/gems/scan_beacon-0.7.11/lib/scan_beacon/beacon/field.rb:40:in value': undefined methodsize' for nil:NilClass (NoMethodError) "

cupakromer commented 7 years ago

I tested things with the latest release and iBeacon scanning works. One thing to note is that by default this library only scans for open source advertisement types. Currently this includes:

As iBeacon is a proprietary format it's not included in this lib as a default. You can still use this lib to scan for any beacon type. You'll just need to add a custom parser for whatever format you wish to scan. The parser string definition structure is based off of the Android Beacon Library format. A search online yields some helpful results.