adafruit / PyLeap-Android

PyLeap for Android
3 stars 0 forks source link

Circuit Playground Bluefruit & PyLeap are not working #7

Open ricknun opened 3 days ago

ricknun commented 3 days ago

See https://forums.adafruit.com/viewtopic.php?p=1032396 for details, copied here after learning where to file related issues. Feel free to break this into multiple GitHub issues if that is appropriate.

I think PyLeap downloads programs to CPB with incompatible library files. I am using Circuit Playground Bluefruit (CPB) with CircuitPython v9.1.4, and Adafruit Android app PyLeap v1.0.2 b5. I had success pairing PyLeap with CPB, choosing PyLeap program "NeoPixel Rainbows", and seeing "NeoPixel Rainbows successfully transferred" in PyLeap. CPB was inactive with only its green power LED on. A quick press/release of the Reset button shows red, blink-yellow, blink-blue, blink-red 2 times every 5 seconds ("code ended due to an exception"). Connecting USB and using the Mu editor, I see:

File "code.py", line 8, in ValueError: incompatible .mpy file

Line 8 of code.py is "import neopixel". Replacing CIRCUITPY\lib\neopixel.mpy with the most recent version fixes the problem and CPB shows a nice rainbow pattern. I found on my phone that "Android\data\com.adafruit.pyleap\files\NeoPixel Rainbowscircuitplayground_bluefruit, clue_nrf52840_express\PyLeap\PyLeap_NeoPixel_demo" contains both CircuitPython v8 and v9 files. I checked and the CPy v8 neopixel.mpy is being used instead of the correct CPy v9 neopixel.mpy.

Another problem with Adafruit Android app PyLeap v1.0.2 b5: After connecting to Circuit Playground Bluefruit, 9 compatible programs are listed (NeoPixel Rainbows ... MP3 Playback". All 9 will "Download" except "Touch NeoPixel Rainbow" that hangs forever displaying "Downloading... 0%".

Another lesser issue with Adafruit Android app PyLeap v1.0.2 b5: Included programs "WAV Playback" and "MP3 Playback" leave their .wav and .mp3 files in the CIRCUITPY root directory when a replacement program is downloaded. I would expect them to be removed then.

ricknun commented 2 days ago

The issue title may be misleading. I would guess this is a problem with any board using CircuitPython v9, not just the Circuit Playground Bluefruit where I found it. Also, I included this problem in a Google Play user review for PyLeap October 3 (16 days ago) but it never appeared on that page. If you know why it wasn't posted there I would appreciate it being explained here.