hexway / apple_bleee

Apple BLE research
GNU General Public License v3.0
2.09k stars 302 forks source link

ble_read_state.py Exception when calling handler with a BLE advertising event: KeyError('0228') #28

Open hubert3 opened 4 years ago

hubert3 commented 4 years ago

Exception in ./utils/bluetooth_utils.py running ble_read_state.py

Exception is printed all over the ble_read_state screen making it hard to read

Maybe due to new hardware IDs not included in the code (AirPods Pro?)

fuad00 commented 3 years ago

Exception is printed all over the ble_read_state screen making it hard to read

Hi! Check out my fork: apple_bleee-exception-fix

revolver-ocelot-saa commented 3 years ago

I gave an answer in #30 that is hack that should make the sceen easier to read (but doesn't fix the issue).

This is a hack for sure, but you can go to utils/bluetooth_utils.py and just change the line

            if handler is not None:
                try:
                    handler(mac_addr_str, adv_type, data, rssi)
                except Exception as e:
                    print('Exception when calling handler with a BLE advertising event: %r' % (e,))

to

            if handler is not None:
                try:
                    handler(mac_addr_str, adv_type, data, rssi)
                except Exception as e:
                    #print('Exception when calling handler with a BLE advertising event: %r' % (e,))
                    pass
ChopsKingsland commented 1 year ago

from what I can work out it's because there are new(er) Apple devices and software out since the repo was last updated... I came to this discovery after I noticed that it wasn't detecting device state