How can I use and adaloger MO with CircuitPython

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
pierrot10
 
Posts: 349
Joined: Tue Nov 17, 2015 4:34 pm

How can I use and adaloger MO with CircuitPython

Post by pierrot10 »

Hello

Until now, I am used to code adafruit adaloger with C++.
I also can program my board as the following example Adafruit Feather M0 Adalogger

Now I would like to rewrite my code with CircuitPython and I would like to "convert" my board to make it usable with CircuitPython. Of course, when I connect my Adaloger MO board to my USB of my mac, I can not see CIRCUITPY

My guess it the download the bin file from that page https://circuitpython.org/board/feather_m0_adalogger/ and save it to my SD card. Then I would follow this procedure https://learn.adafruit.com/programming- ... o/overview and then, at the firmware section (https://learn.adafruit.com/programming- ... re-2804744) I will upload the downloaded bin file (CircuitPython 8.0.4 for adaloger MO)

That's make sense?

Other additional question. In that page https://circuitpython.org/board/feather_m0_adalogger/ , what's the differece between a french or english (or other language) release. I am used to choose english

Thanks a lot

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

Re: How can I use and adaloger MO with CircuitPython

Post by jerryn »

There are instructions for flashing CircuitPython to "non-UF2" M0 boards, like them M0 Adalogger.
See: https://learn.adafruit.com/welcome-to-c ... stallation
You can use the .bin file you referred to and flash it with the "bossac" tool.

CircuitPython will run on the Adalogger, BUT the M0 adalogger is severely constrained both in RAM and Flash space.
The python modules available for the M0 boards are a subset of what is available for the more capable boards.
How you will make out will depend on what you are trying to accomplish with the board.

Good luck!
Note: I do not represent Adafruit. I'm just trying to help.

edited to add: The language builds provide translations for all (or most) of the messages that are printed to the REPL.

User avatar
pierrot10
 
Posts: 349
Joined: Tue Nov 17, 2015 4:34 pm

Re: How can I use and adaloger MO with CircuitPython

Post by pierrot10 »

Dear Jerryn

Thanks a lot for your reply. I will look at it deeply

User avatar
pierrot10
 
Posts: 349
Joined: Tue Nov 17, 2015 4:34 pm

Re: How can I use and adaloger MO with CircuitPython

Post by pierrot10 »

Dear Jerryn,

I would like to come back that post

I could Flash my board in order to have CircuitPython following this procedure https://learn.adafruit.com/welcome-to-c ... sa-2978786. I could do some teste and now I woadafruit_displayio_ssd1306.mpyuld like to go farer by adding the OLED and DS3231 libraries.

I pasted into the lib folder of my CIRCUITPY drive, the adafruit_displayio_ssd1306.mpy, but an error is displayed:
Not enough disk space to copy “adafruit_displayio_ssd1306.mpy”
I also checked the CIRCUITPY drive space: Capcity: 49Kb, free space: 7Kb. It remind me your
CircuitPython will run on the Adalogger, BUT the M0 adalogger is severely constrained both in RAM and Flash space.
but the doc say, the chip has a whopping 256K of FLASH and 32K of RAM. I am very supprised because I miss a lot of room.

I also checke the side of adafruit-circuitpython-feather_m0_adalogger-en_US-8.0.4.bin which is 186Kb.
I supposed that size is deducted of the 256K? Is it correct???

It's big problem, because I need the RTC DS3231; OLED; BME280, LoRaWAN, SD libraries (and more)

Is there a way to win space?
If not, what can we do with CircuitPython on Feather MO if we only can have the libraries (as I have for now)
  • adafruit_sdcard.mpy
  • adafruit_bus_device
Cheers

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: How can I use and adaloger MO with CircuitPython

Post by neradoc »

Yep, Circuitpython is a python interpreter, it takes a lot of space both in flash and RAM, on an M0 chip without external flash you have access to ~48kB of drive. The RAM limit makes it also really hard to use with a display, since that naturally requires a lot of memory.

I tend to consider M0 boards to be ok for doing one thing at a time, like read a sensor and log it to an SD card, be a small macro keyboard, maybe even use some type or character display (where you only need to send the text via UART or I2C, no image buffering). However, some libraries just don't fit in memory at all, unless you trim them down to the minimum needed.

With an adalogger you could try having just the SD card library and store the rest on an SD card, but that's not gonna help the RAM aspect of things. Plus I think that loading files from the sdcard will even require more RAM.

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

Re: How can I use and adaloger MO with CircuitPython

Post by jerryn »

It's big problem, because I need the RTC DS3231; OLED; BME280, LoRaWAN, SD libraries (and more)
This will not be possible with the M0 adalogger.
Just the OLED display driver will probably push you over the edge.
In addition, more bad news. There is no support for LoRaWAN in CircuitPython at this time. There used to be "TinyLoRA" but it does not work with The Things Network V3.

I don't think your project is well suited for the M0 Adalogger with CircuitPython. You may have much better luck with Arduino.


edited to add -- I have never tried the displayio ssd1306 library on an M0 -- there is a "frame buffer" version that used to work OK on the M0 boards, but then there is not much RAM for anything else.

User avatar
pierrot10
 
Posts: 349
Joined: Tue Nov 17, 2015 4:34 pm

Re: How can I use and adaloger MO with CircuitPython

Post by pierrot10 »

Hello Jerryn and neradoc,

Yes, it's a very bad new. I previously used TinyLora with a Rasberry and with TTN V2. I have not tryied with V3 yet.
But, it's a bit surprising that the TinyLora has not been updated for TTN V3 yet!!
The second option is to use a GSM module, I saw the FONA library https://docs.circuitpython.org/projects/fona/en/latest/ and MiniMQTT with the itsybitsy board https://circuitpython.org/board/itsybitsy_m4_express/

The itsybitsy board has 512K of Flash. I may be able to use all of my libraries needs on it?
In order to foresee the size, can I simply add the size of all the needed libraries?
24lc32 => 3k
bme280 => 12k
oled => 972
ds18b20 => 2k
ds3231 => 1k
fona => 24k
pcf8574 => 8k

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

Re: How can I use and adaloger MO with CircuitPython

Post by jerryn »

The ItsyBitsy M4 Express https://www.adafruit.com/product/3800
has 2MBytes of SPI flash for the CIRCUITPYTHON code.
it has plenty of space.

i have not had any experience with the FONA library so I cannot comment on it.

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

Return to “Adafruit CircuitPython”