Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Gemma MO Restoring to original
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Gemma MO Restoring to original

by kenfx00 on Thu Sep 10, 2020 10:46 am

Hi,

I managed to screw up my Gemma MO. I would like to get it back to how it came out of the box. I can flash circuit python, but then there is no room left for the extra library files (dotstar and neopixel mpy files). Before reinstalling circuit python, I got it to take a makecode project, but the dotstar was on continuously (green). I think my Mac must have done something, because when I connected it to my Linux computer, I found a hidden file that I think the Mac put there. I deleted it, but there still isn't room for the mpy files. Any ideas what to do?

I hope this is the best forum to post this.

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by dastels on Thu Sep 10, 2020 11:42 am

Yes, MacOS is renowned for doing that. Delete all unnecessary files, and empty trash if you used a file browser to delete them. If you used the rm command it will have permently removed them rather than moving them to a trash folder.

The last part of https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting talks about dealing with MacOS's shenanigans.

Dave

dastels
 
Posts: 3430
Joined: Tue Oct 20, 2015 3:22 pm

Re: Gemma MO Restoring to original

by kenfx00 on Thu Sep 10, 2020 4:07 pm

Thanks Dave. I think I will use the Linux computer from now on. If I can’t find all the bad files I will just follow the procedure in the troubleshooting section and reformat the Gemma.

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by kenfx00 on Sat Sep 12, 2020 2:06 pm

Now I have another problem. Where are the correct dotstar and neopixel mpy files for my Gemma, which now seems to be working again? I am using CircuitPython 5.3.1 but the 5.3.2 mpy files I have found so far are not comparable.

Thanks,
Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by danhalbert on Sat Sep 12, 2020 4:11 pm

kenfx00 wrote:Now I have another problem. Where are the correct dotstar and neopixel mpy files for my Gemma, which now seems to be working again? I am using CircuitPython 5.3.1 but the 5.3.2 mpy files I have found so far are not comparable.

Could you be more specific about what errors you are seeing? Thanks. Are you seeing errors about `adafruit_pypixel`? On non-Express boards, neopixel now needs adafruit_pypixel (because there's no room iin the firmware for _pypixel, the native module version of the same code).

danhalbert
 
Posts: 2118
Joined: Tue Aug 08, 2017 12:37 pm

Re: Gemma MO Restoring to original

by kenfx00 on Mon Sep 14, 2020 1:31 pm

Here is the version of CircutitPython:
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit Gemma M0 with samd21e18
>>>

With libs from:

kenf@Harriet:~/Gemma/Bundles/Community$ ls -l
total 396
drwxrwxr-x 4 kenf kenf 4096 Sep 12 13:17 circuitpython-community-bundle-5.x-mpy-20200817
-rw-r--r-- 1 kenf kenf 400350 Sep 12 13:15 circuitpython-community-bundle-5.x-mpy-20200817.zip
kenf@H

kenf@Harriet:/media/kenf/CIRCUITPY/lib$ ls -al
total 22
drwxr-xr-x 3 kenf kenf 512 Sep 11 17:27 .
drwxr-xr-x 4 kenf kenf 16384 Dec 31 1969 ..
-rw-r--r-- 1 kenf kenf 2473 Sep 12 13:48 adafruit_dotstar.mpy
drwxr-xr-x 2 kenf kenf 512 Sep 11 17:27 adafruit_hid
-rw-r--r-- 1 kenf kenf 1891 Sep 12 13:48 neopixel.mpy
kenf@Harriet:/media/kenf/CIRCUITPY/lib$



Here are the error messages:



code.py output:
Traceback (most recent call last):
File "code.py", line 1, in <module>
File "adafruit_dotstar.py", line 44, in <module>
ImportError: no module named 'adafruit_pypixelbuf'

code.py output:
Traceback (most recent call last):
File "code.py", line 2, in <module>
File "neopixel.py", line 44, in <module>
ImportError: no module named 'adafruit_pypixelbuf'

With libs from:

total 3548
drwxrwxr-x 4 kenf kenf 4096 Sep 11 19:54 adafruit-circuitpython-bundle-5.x-mpy-20200911
-rw-rw-r-- 1 kenf kenf 3188244 Sep 11 19:49 adafruit-circuitpython-bundle-5.x-mpy-20200911.zip
-rw-rw-r-- 1 kenf kenf 372224 Sep 11 15:45 adafruit-circuitpython-gemma_m0-en_US-5.3.1.uf2

enf@Harriet:/media/kenf/CIRCUITPY/lib$ ls -l
total 5
-rw-r--r-- 1 kenf kenf 2473 Sep 14 13:02 adafruit_dotstar.mpy
drwxr-xr-x 2 kenf kenf 512 Sep 11 17:27 adafruit_hid
-rw-r--r-- 1 kenf kenf 1891 Sep 14 13:02 neopixel.mpy
kenf@Harriet:/media/kenf/CIRCUITPY/lib$

enf@Harriet:/media/kenf/CIRCUITPY/lib$ ls -l
total 5
-rw-r--r-- 1 kenf kenf 2473 Sep 14 13:02 adafruit_dotstar.mpy
drwxr-xr-x 2 kenf kenf 512 Sep 11 17:27 adafruit_hid
-rw-r--r-- 1 kenf kenf 1891 Sep 14 13:02 neopixel.mpy
kenf@Harriet:/media/kenf/CIRCUITPY/lib$

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 1, in <module>
File "adafruit_dotstar.py", line 44, in <module>
ImportError: no module named 'adafruit_pypixelbuf'

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 2, in <module>
File "neopixel.py", line 44, in <module>
ImportError: no module named 'adafruit_pypixelbuf'


The program to test is simple:

# switch which include file is commented to test

# include adafruit_dotstar.mpy
include neopixel.mpy

while True:
pass

Ideas?

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by dastels on Mon Sep 14, 2020 2:05 pm

You need to copy adafruit_pypixelbuf to your CIRCUITPY/lib directory.

Dave

dastels
 
Posts: 3430
Joined: Tue Oct 20, 2015 3:22 pm

Re: Gemma MO Restoring to original

by kenfx00 on Mon Sep 14, 2020 2:19 pm

Where is adafruit_pixelbuf ? It doesn't seem to be in any of the files I have downloaded?

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by dastels on Mon Sep 14, 2020 3:18 pm

No, "adafruit_pypixelbuf.mpy". It's in the bundle.

Dave

dastels
 
Posts: 3430
Joined: Tue Oct 20, 2015 3:22 pm

Re: Gemma MO Restoring to original

by kenfx00 on Mon Sep 14, 2020 3:46 pm

dastels wrote:No, "adafruit_pypixelbuf.mpy". It's in the bundle.

Dave


Sorry to be a bother.

Found it. however now getting this error:

uto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 4, in <module>
ImportError: no module named 'neopixel.mpy'
(same error for adafruit_dotstar.mpy)

Here is where the files are:

kenf@Harriet:/media/kenf/CIRCUITPY$ ls -l
total 2
-rw-r--r-- 1 kenf kenf 78 Dec 31 1999 boot_out.txt
-rw-r--r-- 1 kenf kenf 121 Sep 14 15:32 code.py
drwxr-xr-x 3 kenf kenf 512 Sep 14 15:21 lib
kenf@Harriet:/media/kenf/CIRCUITPY$ ls -l lib
total 11
-rw-r--r-- 1 kenf kenf 2473 Sep 14 13:02 adafruit_dotstar.mpy
drwxr-xr-x 2 kenf kenf 512 Sep 11 17:27 adafruit_hid
-rw-r--r-- 1 kenf kenf 5584 Sep 14 15:21 adafruit_pypixelbuf.mpy
-rw-r--r-- 1 kenf kenf 1891 Sep 14 13:02 neopixel.mpy
kenf@Harriet:/media/kenf/CIRCUITPY$

Why isn't it finding the *.mpy files?

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by dastels on Mon Sep 14, 2020 3:56 pm

No problem. You don't need the ".mpy" in the import statements. I.e. just
Code: Select all | TOGGLE FULL SIZE
import neopixel
import adafruit_dotstar


That should fix those errors.

Dave

dastels
 
Posts: 3430
Joined: Tue Oct 20, 2015 3:22 pm

Re: Gemma MO Restoring to original

by kenfx00 on Mon Sep 14, 2020 4:37 pm

That seems to do it.Thanks, Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by kenfx00 on Mon Sep 14, 2020 4:43 pm

Dave,

Are there any other *.mpy files I should have on the device?

And, I'm going to get a Circuit Playground. Should I get the bluefruit version? And are there any disadvantages to that version? I don't like MakeCode so that's not a problem.

Ken

kenfx00
 
Posts: 8
Joined: Wed Jun 24, 2020 11:00 pm

Re: Gemma MO Restoring to original

by dastels on Mon Sep 14, 2020 4:51 pm

If there are, you'll get import errors like that.

Dave

dastels
 
Posts: 3430
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.