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

NameError: name 'xrange' is not defined #59

Open
meluvalli opened this issue May 1, 2020 · 1 comment
Open

NameError: name 'xrange' is not defined #59

meluvalli opened this issue May 1, 2020 · 1 comment

Comments

@meluvalli
Copy link

when Starting scan for BLE advertisements, it starts the scan, but then errors:

C:\Users\Aaron>bled112_scanner.py -p COM3
================================================================
BLED112 Scanner for Python v2013-04-07
================================================================
Serial port:    COM3
Baud rate:      115200
Scan interval:  200 (250.00 ms)
Scan window:    200 (250.00 ms)
Scan type:      Passive
UUID filters:
None
MAC filter(s):
None
RSSI filter:
None
Display fields: -
Time
                - RSSI
                - Packet type
                - Sender MAC
                - Address type
                - Bond status
                - Payload data
Friendly mode:  Disabled
----------------------------------------------------------------
Starting scan for BLE advertisements...
1588298753.701 -52 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.703 -45 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.718 -87 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.768 -95 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.861 -83 2 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.866 -83 0 XXXXXXXXXXXX 0 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.968 -54 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.975 -47 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298753.997 -74 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.093 -89 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.232 -83 2 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.236 -83 0 XXXXXXXXXXXX 0 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.242 -50 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.248 -44 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.264 -74 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.512 -50 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.519 -44 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.526 -78 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.589 -84 2 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.605 -84 0 XXXXXXXXXXXX 0 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.791 -52 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.797 -45 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1588298754.802 -87 0 XXXXXXXXXXXX 1 255 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Traceback (most recent call last):
  File "C:\bled112_scanner.py", line 455, in 
    main()
  File "C:\bled112_scanner.py", line 319, in main
    while (ser.inWaiting()): bgapi_parse(ord(ser.read()));
  File "C:\bled112_scanner.py", line 388, in bgapi_parse
    for i in xrange((len(this_field) - 1) / 2):
NameError: name 'xrange' is not defined
@meluvalli
Copy link
Author

Great news! I figured out for me what causes it!

I have a "Tile" and if it's in range, it crashes like above! If I keep my tile away from the home, no more crashing!

Oh well! Not like I can do what I wanted to anyways. Wanted to use this for proximity sensing when I arrive/leave home. However, MAC address's are random (normal for BLE) so to the best of my knowledge, no way of doing this :(

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

1 participant