Maker.io main logo

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.‎

app_1

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:‎

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.‎

down_2

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!)‎‎ ‎

button_3

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! :)‎

drive_4

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.‎

reset_5

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.‎

circuitpython_pairingAnimation

Scan & Connect

When your Adafruit device is in discovery mode, hold it very close to ‎your iPhone or iPad to pair. ‎

circuitpython_ezgif_com-gif-maker- Copy

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:‎‎

  1. Verify that the green On light is lit.‎‎

  2. Make sure your Adafruit device is running the correct firmware. ‎See the CircuitPython page in this guide.

  3. ‎‎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:‎‎

Download File

Copy Code







 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_6

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.‎

connect_7

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.‎

setting_8

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.‎

projects_9

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.‎

run_10

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_ezgif22_2

Circuit Playground Bluefruit with a small Reset button in the center of the board

reset_11

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. ‎

circuitpython_ezgif_com-gif-maker- Copy

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.‎

scan_12

If your Circuit Playground Bluefruit doesn't ‎appear:‎‎

  1. Check to see if your Circuit Playground Bluefruit is powered on. ‎Verify that the green On light is lit.

  2. Make sure your Circuit Playground Bluefruit is running the ‎correct firmware. See the CircuitPython page in this guide.

  3. Try resetting the Circuit Playground Bluefruit by pressing the ‎small Reset button near the center of the board.‎

制造商零件编号 5627
DIGI-KEY HACKBOX CLUE AND PYLEAP
Adafruit Industries LLC
制造商零件编号 5300
ESP32-S2 TFT FEATHER STEMMA QT
Adafruit Industries LLC
制造商零件编号 4333
CIRCUIT PLAYGROUND BLUEFRUIT BLE
Adafruit Industries LLC
制造商零件编号 4500
CLUE NRF52840 EXPRESS
Adafruit Industries LLC
制造商零件编号 5210
ADAFRUIT LED GLASSES FRONT PANEL
Adafruit Industries LLC
制造商零件编号 4398
CBL ASSY RECT 4P PL-GATOR 0.49'
Adafruit Industries LLC
制造商零件编号 592
CABLE A PLUG TO MCR B PLUG 3'
Adafruit Industries LLC
制造商零件编号 727
BATTERY HOLDER AAA 3 CELL LEADS
Adafruit Industries LLC
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum