You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two-encoder multimode not working due to missing lib files. How do I reset cirtcuitpy? #5
I've successfully set up a 6-key MiniKbd and I'm now working on the two-encoder version.
I am able to get this working with the main.py of the Two-Encoder Keyboard configuration, but when I upload the main.py of the Two Encoder Multimode configuration, input is no longer registering.
Actually, I'm now seeing that the input is triggered by print statements like print("enc-1-up") in the main.py. However, this has led into another error when I refresh the serial console:
Traceback (most recent call last):
File "main.py", line 4, in <module>
ImportError: no module named 'adafruit_hid.consumer_control'
I see that there are lib files available such as consumer_control_code. I took the step (which I now see wasn't the best idea) of trying to reset my trinket m0, thinking that it must need the newer version. This has led me down a bit of a rabbithole.
I've tried to reset the trinket with the Adafruit instructions here. However, I'm now unable to copy over the basic files.
I suspect that this may be due to my inability to delete the .trashes folder.
I'll keep troubleshooting this and update here when I solve it. However, if anyone knows of any easy way to solve this, I'd appreciate some pointers!
(As a sidenote, it may be useful to include something in the files or in the readme of the multimode software about adding the necessary extra lib files).
The default configuration of a Trinket M0 doesn't have all of the Python packages installed because of (as you've noticed) the very limited amount of storage space on the device. The consumer_control library is one of those.
Since there's such limited storage space on the device, try to remove any .mpy files that you don't need — for instance if you code no longer needs the mouse library or the neopixel library. And then empty your trash to completely remove the files.
Wow, that space really is limited! The adafruit troubleshooting link you provided is very helpful, however. Thanks!
I was able to successfully delete everything via the terminal commands and start again, adding from files from the working other MiniKbd, plus some from the 4.x circuitpy release. However, I was getting an error:
Traceback (most recent call last):
File "main.py", line 6, in <module>
ValueError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
I was able to solve this by really replacing all the lib files with files from the 4.x download, rather than just some of them.
After bringing in the two-encoder py files, it's working like a charm to control volume in one mode, and brackets/zx in the other mode.
Yeah, the space is super limited. I think my next project will use the Adafruit ItsyBitsy or Feather which have a extra 265k of storage, which is massive in comparison :)
You're learning some good lessons with this project! And I'm learning what I need to update in the docs. If you upgraded to CircuitPython 4 on your Trinket, then as you found you do need to update all of the mpy files for version 4. I keep that Adafruit_CircuitPython_Bundle folder handy on my computer and only copy over the mpy files that I need at the moment.
Glad to see that it worked after you made that switch! I'll leave this issue open until I update the docs with a recommendation (but it will be pretty much exactly what you've done)
Activity
thundernixon commentedon Dec 28, 2018
I have found that it's simple to delete hidden files if I open CIRCUITPY in VS Code.
However, I am now trying to add in the correct
.mpyfiles, but I get a "Not enough disk space" error:andyclymer commentedon Dec 29, 2018
First, you're on the right track.
The default configuration of a Trinket M0 doesn't have all of the Python packages installed because of (as you've noticed) the very limited amount of storage space on the device. The consumer_control library is one of those.
After updating to the latest version of Circuit Python, you'll want to also grab the latest release of the library (which it sounds like you've done) here:
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases
Since there's such limited storage space on the device, try to remove any .mpy files that you don't need — for instance if you code no longer needs the mouse library or the neopixel library. And then empty your trash to completely remove the files.
Adafruit also has some good advice here on keeping a drive space free with the Mac, try to see if any of this helps:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#running-out-of-file-space-on-non-express-boards-18-36
Give those a shot, and let me know if it helps!
thundernixon commentedon Dec 29, 2018
Wow, that space really is limited! The adafruit troubleshooting link you provided is very helpful, however. Thanks!
I was able to successfully delete everything via the terminal commands and start again, adding from files from the working other MiniKbd, plus some from the
4.xcircuitpy release. However, I was getting an error:I was able to solve this by really replacing all the lib files with files from the
4.xdownload, rather than just some of them.After bringing in the two-encoder py files, it's working like a charm to control volume in one mode, and brackets/zx in the other mode.
Thanks for the help!
andyclymer commentedon Dec 30, 2018
Yeah, the space is super limited. I think my next project will use the Adafruit ItsyBitsy or Feather which have a extra 265k of storage, which is massive in comparison :)
You're learning some good lessons with this project! And I'm learning what I need to update in the docs. If you upgraded to CircuitPython 4 on your Trinket, then as you found you do need to update all of the mpy files for version 4. I keep that
Adafruit_CircuitPython_Bundlefolder handy on my computer and only copy over the mpy files that I need at the moment.Glad to see that it worked after you made that switch! I'll leave this issue open until I update the docs with a recommendation (but it will be pretty much exactly what you've done)
thundernixon commentedon Feb 23, 2019
Ran into this again today, and https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#running-out-of-file-space-on-non-express-boards-18-36 really helped, particularly the steps shown on using the terminal to prevent metadata files and to copy over files without making new metadata files.