Can circuitpython do 7 segment displany on M0 WINC?

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
zencuke2
 
Posts: 237
Joined: Sun Feb 15, 2015 2:40 pm

Can circuitpython do 7 segment displany on M0 WINC?

Post by zencuke2 »

Trying to make a simple wifi ntp clock.
I can't follow this tutorial. I can't even get started. The tutorial implies it should work. The hardware is mentioned in the intro. However when I attempt to copy the libraries to /Volume/CIRCUITPY there is not enough space. Has the disk shrunk since the tutorial was written? Or am I doing something wrong? Is this expected to work?

I'm copying files using bash/cp so I shouldn't have problems with strange macintosh files. 'ls -la' shows only the expected files.

Can I prune the libraries? I guess I don't need spi support. Anything else?

I would need to save a bunch of space because I need room to download the ntp library as well. I had this mostly working in microPython. I guess it is smaller. Should I switch back? I just ordered 3 M0 feather Express boards and was hoping to standardize firmware. Besides I would have to add a wifi featherwing. The two board solution looks cute and is all soldered up ready for final software. On the other hand I'm guessing the Arduino IDE would have the smallest memory footprint.

-zencuke

-------------------------------------------------------------------------------------
These are the libraries that the tutorial says to install.

bash-3.2$ ls -l adafruit_*
adafruit_bus_device:
total 24
-rw-rw-r--@ 1 smorris staff 1 Apr 10 23:55 __init__.py
-rw-r--r--@ 1 smorris staff 997 Apr 10 23:55 i2c_device.mpy
-rw-r--r--@ 1 smorris staff 1026 Apr 10 23:55 spi_device.mpy

adafruit_ht16k33:
total 24
-rw-rw-r--@ 1 smorris staff 0 Apr 11 18:00 __init__.py
-rw-r--r--@ 1 smorris staff 1840 Apr 11 18:00 ht16k33.mpy
-rw-r--r--@ 1 smorris staff 1400 Apr 11 18:00 matrix.mpy
-rw-r--r--@ 1 smorris staff 2665 Apr 11 18:00 segments.mpy

adafruit_register:
total 40
-rw-rw-r--@ 1 smorris staff 0 Apr 11 22:00 __init__.py
-rw-r--r--@ 1 smorris staff 2432 Apr 11 22:01 i2c_bcd_alarm.mpy
-rw-r--r--@ 1 smorris staff 1755 Apr 11 22:01 i2c_bcd_datetime.mpy
-rw-r--r--@ 1 smorris staff 1131 Apr 11 22:01 i2c_bit.mpy
-rw-r--r--@ 1 smorris staff 1314 Apr 11 22:01 i2c_bits.mpy
-rw-r--r--@ 1 smorris staff 1816 Apr 11 22:01 i2c_struct.mpy
bash-3.2$

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by tannewt »

Hi zencuke2,

I believe the libraries have grown a bit bigger since the tutorial was written. You should be able to prune some of the libraries. SPI and the BCD registers look unnecessary.

What board did you have this working with MicroPython? It doesn't run on the M0.

You mention NTP but the Feather M0 Express doesn't have wifi. What are you planning on using for the network connection? Why not use a Feather Huzzah instead? CircuitPython currently doesn't support the WINC wifi and likely never will. It would be better for us to support ESP8266 and ESP32 instead.

Thanks and sorry the tutorial doesn't just work,
Scott

User avatar
zencuke2
 
Posts: 237
Joined: Sun Feb 15, 2015 2:40 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by zencuke2 »

Scott,

Thanks. Not good news but now I can stop wasting time barking up the wrong tree.

I had the 7 segment working in python with a simple counter but it must have been before I soldered things down because the M0 Winc is what is there now. It was a month or two ago but I still have the code and it is definitely Python. I guess that proves it was the Huzzah. The only reason I chose the Winc MO board for the clock app is because I've had it for months and never touched it. I usually use Huzzahs. I figured it was time to get some experience with both the MO and the Winc. All the Adafruit documentation I found said it should work. I obviously missed two things, the 'backpack graphics' don't work because of flash space and and the winc wifi isn't supported at all and it will probably never be. There is nothing wrong with that, you guys can't support everything, but it would have been nice to know this in advance. I guess I'll switch the clock app to Arduino mode. Or dig out the solder sucker.

The thing I like best about the Feathers is getting two functions on one board. Is that still true if you want to code in Python? You can get wifi with the huzzah but anything else? It is like microPython is almost an "extra board" in its own right because of its memory requirements. Your statement about the Winc never being supported in microPython is a bit surprising. I would have thought the Winc was a perfect match because it has its own processor doing the wifi stack meaning the wifi stack doesn't have to be implemented in microPython. I now regret ordering the MO express boards. Is there any python wifi solution for them? I was going to order winc featherwings for them but if python MO will never do wifi it is a waste for me. I should have gone for the huzzah32 I guess although like everything else I want huzzah32 is out of stock. I ordered the MO Express as soon as I got the notification because I was afraid they would disappear again. I ordered 3 for the same reason. I suppose I'll use them eventually although I don't build much that doesn't do wifi. Gah! I suppose the 3 Lora Featherwings I got last week aren't supported in Python either. I forgot about them. That's $120 worth of Feather boards (not including shipping and accessories) that won't do what I bought them for.

Most of the micropython tutorials merrily mention the M0. Here is the note from this tutorial: "This guide focuses on the ESP8266 and Feather M0/SAMD21-based boards, but any MicroPython board that supports I2C should work." The reference to the Feather MO should probably be removed if it doesn't work. I usually use an oled to help debug. I suppose that is out as well for the M0 family since it uses the same library, unless pruning the library works. Those at least I can use with the Huzzah.

From my post; "Besides I would have to add a wifi featherwing." I guess you missed that. At least now I know that would be pointless if I want it for Python. Lesson for the day: microPython+feather MO+wifi === "is not supported". Sigh! Or rather: "microPython+feather MO+anything complex === "is not supported".

-steve

User avatar
jerryn
 
Posts: 1868
Joined: Sat Sep 14, 2013 9:05 am

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by jerryn »

If it makes you feel better, You can definitely use the 7segment and OLED display with an M0-Express - still no wifi :-(

User avatar
zencuke2
 
Posts: 237
Joined: Sun Feb 15, 2015 2:40 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by zencuke2 »

Not much unfortunately. ;-) The 7 segment is intended for a network (ntp) clock.

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by tannewt »

Sorry I missed this! My email notifications didn't come.

I'm sorry you are frustrated with the lacking support with CircuitPython. Its all very new and still in beta. I think the guide is correct since the OLED does work with M0 board. However, as you point out, that doesn't mean the Wifi on the WINC M0 board works. Going forward I'd suggest checking here for compatibility information.

There are many chips that we could focus our support on. We hope to cover most of the FeatherWings but the radios are much more complex. Since there are so many, we cannot support them all. (I'm only one person.) I'm prioritizing based on popularity of boards primarily with a focus on upcoming tech. Heres a rough guide on my work items:
  • Add microphone support for the CircuitPlayground Express.
  • Polish for 1.0 and stabilize *io APIs.
  • Rebase to Micropython 1.9.0
  • Pull in ESP32 and NRF52 support (future chip has builtin USB) into master.
  • Refactor main so more is shared across ports and maintaining ports is easier.

User avatar
zencuke2
 
Posts: 237
Joined: Sun Feb 15, 2015 2:40 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by zencuke2 »

Cool. Will the Micropython 1.9.0 VFS architecture allow (with a little boot code to make the switch) using an external SD card as a disk on current M0 feathers to allow them to load bigger python libraries? If so would this make them (MO plus SD card) equivalent to the express? Does the M0 Adalogger become functionally equivalent to the MO express python wise? That feature could allow people to use microPython on more MO based feather boards without waiting for a MO express equivalent design to show up.

Come to think of it I'm looking at the Descriptions of the MO Adalogger and the MO Express side by side and the only obvious differences are the NeoPixel and that the SD card is removable and doesn't use SPI. Am I missing something or should they be able to run similar code. The only problem I can think of is there might not be enough room on the original internal flash disk to hold the filesystem code needed to mount the external flash. Most of the filesystem code should be sharable in the bootimage. I'm assuming the filesystem code is sharable and uses an external interface to access physical media. I guess I should look at the VFS documentation in 1.9.0. If I could ever find the vfs documentation for 1.9. So far I only see VFS mentioned in the change log. The stmhal port has the following comment:
'- add ability to have filesystem stored on external SPI flash' so it must be possible.

Just thinking out loud.

User avatar
zencuke2
 
Posts: 237
Joined: Sun Feb 15, 2015 2:40 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by zencuke2 »

unmount was also added to 1.9.
zencuke2 wrote:Cool. Will the Micropython 1.9.0 VFS architecture allow (with a little boot code to make the switch) using an external SD card as a disk on current M0 feathers to allow them to load bigger python libraries? If so would this make them (MO plus SD card) equivalent to the express? Does the M0 Adalogger become functionally equivalent to the MO express python wise? That feature could allow people to use microPython on more MO based feather boards without waiting for a MO express equivalent design to show up.

Come to think of it I'm looking at the Descriptions of the MO Adalogger and the MO Express side by side and the only obvious differences are the NeoPixel and that the SD card is removable and doesn't use SPI. Am I missing something or should they be able to run similar code. The only problem I can think of is there might not be enough room on the original internal flash disk to hold the filesystem code needed to mount the external flash. Most of the filesystem code should be sharable in the bootimage. I'm assuming the filesystem code is sharable and uses an external interface to access physical media. I guess I should look at the VFS documentation in 1.9.0. If I could ever find the vfs documentation for 1.9. So far I only see VFS mentioned in the change log. The stmhal port has the following comment:
'- add ability to have filesystem stored on external SPI flash' so it must be possible.

Just thinking out loud.

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Can circuitpython do 7 segment displany on M0 WINC?

Post by tannewt »

zencuke2 wrote:Cool. Will the Micropython 1.9.0 VFS architecture allow (with a little boot code to make the switch) using an external SD card as a disk on current M0 feathers to allow them to load bigger python libraries? If so would this make them (MO plus SD card) equivalent to the express? Does the M0 Adalogger become functionally equivalent to the MO express python wise? That feature could allow people to use microPython on more MO based feather boards without waiting for a MO express equivalent design to show up.
Yup! SD card support is on my radar for after 1.0 when we merge in all of the 1.9.0 changes. I probably wouldn't actually switch mounts, I'd just have both mounted at once. Two caveats would would be that:
  • It won't impact the built-in functionality (like missing pulseio) because we'll still have the 64k root FS.
  • RAM will still limit the size of code you can have loaded at once.
zencuke2 wrote: Come to think of it I'm looking at the Descriptions of the MO Adalogger and the MO Express side by side and the only obvious differences are the NeoPixel and that the SD card is removable and doesn't use SPI. Am I missing something or should they be able to run similar code. The only problem I can think of is there might not be enough room on the original internal flash disk to hold the filesystem code needed to mount the external flash. Most of the filesystem code should be sharable in the bootimage. I'm assuming the filesystem code is sharable and uses an external interface to access physical media. I guess I should look at the VFS documentation in 1.9.0. If I could ever find the vfs documentation for 1.9. So far I only see VFS mentioned in the change log. The stmhal port has the following comment:
'- add ability to have filesystem stored on external SPI flash' so it must be possible.

Just thinking out loud.
I think they will be similar but not identical. The CircuitPython image will still need to be a bit smaller to have the 64k file system in case the SD card isn't present. There will also be a bit of RAM overhead to loading the code to interface with the SD card over SPI. A while back I started working on this and ported the MicroPython SD card code to CircuitPython's hardware APIs. That code is here.

I also want to introduce a different way of managing the mounts from MicroPython because they add additional functions onto os which aren't on CPython's os. My existing working doing that is here.

These two repos are what I need to finish after we integrate 1.9.0's changes into CircuitPython.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”