PyLeap App
2023-09-12 | By Adafruit Industries
License: See Original Project Bluetooth / BLE Circuit Playground
Courtesy of Adafruit
Guide by Trevor Beaton
Overview
PyLeap is an iOS and iPadOS app that allows users to easily download code files and assets and transfer them to their Adafruit devices using Bluetooth Low Energy (BLE) or Wi-Fi.
With PyLeap, users can quickly and conveniently transfer code files and assets from our Adafruit Learn Systems to their Adafruit devices, allowing them to take their projects to the next level.
We are releasing an Android version, like many other apps. At this time, there is only an iOS app.
This app is designed from the ground up for Adafruit devices that use an nRF52840 for Bluetooth Low Energy (BLE) or an ESP32-S2 TFT feather for Wi-Fi. You can pick one up from the Adafruit Shop along with other accessories:
Adafruit ESP32-S2 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT
Adafruit LED Glasses Front Panel - 116 RGB LEDs with I2C Driver
Setting Up CircuitPython
Install CircuitPython
Currently, PyLeap requires Adafruit Boards to run Circuit Python on its board. If you haven't already, you'll need to download the latest version of CircuitPython from the link below.
Download CircuitPython for Circuit Playground Bluefruit from CircuitPython.org
Plug your Adafruit device into your computer using a good data-capable USB cable.
Many people use charge-only USB cables, which is very frustrating, I'm sure! So, make sure you have a USB cable suitable for data sync.
Double-click the small Reset button on the Adafruit device (indicated by the red arrow in the image.)
A LED will turn red, and then it will turn green. If they turn red and stay red, check the USB cable, try another USB port, etc. The tiny red LED next to the USB connector will pulse red - this is ok!
If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!
(If double-clicking doesn't do it, try a single click!)
You will see a new disk drive appear like "CPLAYBTBOOT."
Drag the .uf2 file to CPLAYBTBOOT.
The LEDs will turn red. Then, the CPLAYBTBOOT drive will disappear, and a new disk drive called CIRCUITPY will appear.
That's it. You're done! :)
Bluetooth Pairing
After uploading the correct firmware, disconnect your device from your computer and power it via LiPoly or AAA battery pack.
Pairing device to PyLeap
Once powered, press the small Reset button in the center of the board (Circuit Playground Bluefruit) or on the top right of the board (CLUE). When the blue light flashes, press the Reset button again.
Adafruit CLUE Reset Button (Highlighted on the upper right)
When done correctly, the LEDs flash yellow, followed by solid blue. Once this occurs, the board will continuously be in discovery mode.
Scan & Connect
When your Adafruit device is in discovery mode, hold it very close to your iPhone or iPad to pair.
Below the spinning Blinka, you'll notice a status indicator that will let you know your current pairing status.
Once you've found your device and received the Bluetooth Pairing Request message, press Pair to pair your board to your iPhone or iPad.
If your Circuit Playground Bluefruit doesn't appear:
Verify that the green On light is lit.
Make sure your Adafruit device is running the correct firmware. See the CircuitPython page in this guide.
Try resetting the Adafruit device by pressing the small Reset button near the center of the board.
WiFi Pairing
Setup WiFi Credentials
PyLeap depends on adding WiFi credentials to detect Adafruit devices over WiFi.
Create a file with the name settings.toml in the root directory of the CIRCUITPY drive.
Add the following below:
The file contains the keys CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD. Once these are defined, CircuitPython will automatically connect to the network and start the webserver used for the workflow.
The web server is on port 80 unless overridden by CIRCUITPY_WEB_API_PORT. It also enables MDNS.
Here is an example settings.toml:
Drag the settings.toml file to the CIRCUITPY drive.
After this step - Disconnect your device from your computer and power it via LiPoly or AAA battery pack.
Open the PyLeap app. Select WiFi and scan for Adafruit devices.
After seeing the spinning Blinka animation, you should see a screen with WiFi devices found. Once you've found your device in the peripheral device list, press the Connect button to continue.
If WiFi devices were not found, either rescan for WiFi devices or double check your WiFi credentials.
Troubleshooting
If you happen to witness this message "Disconnected: Peer removed pairing information " while pairing to a Bluetooth device, there is a way to remedy that.
Go to your Settings app, go to the Bluetooth setting, and delete your Adafruit device from the list.
Once you've removed the Circuit Playground Bluefruit device from your device list, for good measure, reset the PyLeap app as well.
Modules
Once connected, the app will display a list of projects for you to choose from.
Choose one of the projects in the list and go to its related page in this guide to learn more.
And more!
Press the "Run it" button to download and transfer complete projects to your device.
Pairing
Now that you're done uploading the correct firmware, disconnect your device from your computer and power it via LiPoly or AAA battery pack.
Pairing device to PyLeap
Once powered, press the small Reset button in the center of the board (Circuit Playground Bluefruit) or on the top right of the board (CLUE). When the blue light flashes, press the Reset button again.
Circuit Playground Bluefruit with a small Reset button in the center of the board
Adafruit CLUE Reset Button (Highlighted on the upper right)
When done correctly, the LEDs will flash yellow followed by solid blue. Once this occurs, the board will continuously be in discovery mode.
Scan & Connect
When your Circuit Playground Bluefruit or Adafruit CLUE is in discovery mode, hold it very closely to your iPhone or iPadOS to pair.
Below the spinning Blinka, you'll notice a status indicator that will let you know your current pairing status.
Once you've found your device and received the Bluetooth Pairing Request message, press Pair to pair your board to your iPhone or iPadOS.
If your Circuit Playground Bluefruit doesn't appear:
Check to see if your Circuit Playground Bluefruit is powered on. Verify that the green On light is lit.
Make sure your Circuit Playground Bluefruit is running the correct firmware. See the CircuitPython page in this guide.
Try resetting the Circuit Playground Bluefruit by pressing the small Reset button near the center of the board.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum