ECE4160/5160-MAE 4190/5190: Fast Robots course, offered at Cornell University in Spring 2023
This project is maintained by CEI-lab
Match the baud rate on your serial monitor with the value specified in the Arduino sketch.
When python throws an exception, it first displays the code traceback and then finally the Exception message. Read the exception message at the bottom and use the traceback to find the line of code that triggered the exception. More info on exceptions and exception handling can be found here.
There are many ways to do this, but as a programmer why not use some programming tools?
from uuid import uuid4
uuid4()
NOTE: There are some reserved UUIDs in the bluetooth specification and steer away from them. (Reserved UUID: https://www.novelbits.io/uuid-for-custom-services-and-characteristics/)
Click on the link in the error messages and download the installer. In the installation process, make sure to select “C++ Build tools”. The exact download link may change with the version of Windows. After installation, restart your computer and try installing the pip package again. If you are still face issues:
Some Windows 11 users are unable to connect to the Artemis board. Since Windows 11 is a fairly new OS (Released on Oct 5, 2021), it is likely to have compatibility issues with libraries/applications. Unfortunately, there is no known fix for this issue at the moment.
You can use the lab computers for BLE related tasks. If you prefer using your personal computer, you may have to either downgrade to Windows 10, setup a new partition with Windows 10 (alongside Windows 11) or use a Virtual Machine. We can help you with these if you want. For some users, they can get BLE to work in python scripts; however Jupyter notebooks are recommended for novice Python programmers.
Some macOS versions may not have the library pre-installed. In a CLI, activate the virtual enviroment and install the package using the following command:
python3 -m pip install pyobjc
TLDR: A documented bug (feature?) in macOS reports the incorrect macOS version number in some machines. In file base_ble.py, change Line 16 from
IS_ATLEAST_MAC_OS_12 = objc.macos_available(12,0)
to
IS_ATLEAST_MAC_OS_12 = True
Why is this important? Well, they also modified the Bluetooth API in macOS 12. The provided basecode checks for the macOS version number and handles the Bluetooth API accordingly. Unfortunately, it does not account for this bug in some machines, where a macOS 12 might report its version number as “10.16”.
Make sure you (carefully) remove the protective film on top of the sensor.