MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
loboris
Posts: 322
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Wed Nov 01, 2017 1:43 pm

:!: Update
  • Updated gsm module
  • gsm module documentation added
  • Updated network and socket modules, fixed static DNS bug
  • implement network.LAN() object for wired PHY objects (from main MicroPython port, not tested)
  • Building the firmware does not update files in 'firmware' directory, fixes 'git pull' problems
  • esp-idf updated to the latest commit (79f206be47c3f608615c1de8c491107e6c9194bb)
  • Other small bugfixes and improvements
Full gsm module documentation is now available.

Ketsa
Posts: 7
Joined: Sun Jan 15, 2017 2:50 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by Ketsa » Sun Nov 05, 2017 10:13 pm

I found the ESP32-WROVER module pretty cheap on electrodragon, but ...
Does anyone know where to get a breakout board for it ?

loboris
Posts: 322
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sun Nov 05, 2017 10:26 pm

Ketsa wrote:
Sun Nov 05, 2017 10:13 pm
I found the ESP32-WROVER module pretty cheap on electrodragon, but ...
Does anyone know where to get a breakout board for it ?
You may try this breakout board.
I think it comes with soldered passive components, transistors and LDO.

loboris
Posts: 322
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sun Nov 05, 2017 10:43 pm

:!: Update
  • Updated esp-idf to commit abacf8d2a0347a4bf95315cdb227e9b8b1c93794 (2017/11/03)
  • Updated MicroPython core from latest main MicroPython-ESP32 port commits
  • Updated adc module
    • reading ESP32 hall sensor added
    • reading calibrated or raw ADC value added
    • route Vref to gpio and set Vref method added for precise calibration
  • Updated mqtt module
    • on unsubscribe callback added
    • subscribe & unsubscribe methods now waits for the response and returns True/False
    • on subscribe & on unsubscribe callbacks now gets the tuple argument with id and topic name
  • Fixed bug: os.stat('/flash') and os.stat('/sd') returns Errno 22
  • Other small bugfixes and improvements
Documentation for ADC, Mqtt, Curl and Neopixel modules will be available in a day or two.

You can support this project by donating via PayPal

mnelsoneorm
Posts: 14
Joined: Wed Jul 20, 2016 4:53 am

Re: MicroPython on ESP32 with SPIRAM support

Post by mnelsoneorm » Mon Nov 06, 2017 10:29 pm

Ketsa wrote:
Sun Nov 05, 2017 10:13 pm
I found the ESP32-WROVER module pretty cheap on electrodragon, but ...
Does anyone know where to get a breakout board for it ?
You mean like this?: https://twitter.com/Xiaoj329/status/919954813751762944

Yeah, me too. Looks just like the one from analoglamb so I'm hoping there's one on the way.

User avatar
devnull
Posts: 454
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by devnull » Tue Nov 07, 2017 9:17 am

Small Build Feature Request - keep previous config.

I just updated, but each time I do this and try and build I am prompted to run config again.

Is it possible to re-use the previous config instead of having to redo it after each update :-)

Thanks

loboris
Posts: 322
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Tue Nov 07, 2017 10:43 am

devnull wrote:
Tue Nov 07, 2017 9:17 am
Small Build Feature Request - keep previous config.

I just updated, but each time I do this and try and build I am prompted to run config again.

Is it possible to re-use the previous config instead of having to redo it after each update :-)

Thanks
Your old configuration is deleted only when esp-idf is changed, in which case you must run ./BUILD.sh menuconfig first.

I will update BUILD.sh script so that your old sdkconfig is saved before deleted, and than restored on first ./BUILD.sh menuconfig run.
Thanks for the suggestion.

User avatar
devnull
Posts: 454
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by devnull » Tue Nov 07, 2017 11:42 pm

Is it possible to change it so that you don't even need to run build menuconfig after a update ?

The reasoning is if you don't want to change anything then there's no point running menuconfig after an update.

Then you would only ever run menuconfig if you want to change something instead of each time an uypdate is done ?

Not sure if I have explained that clearly ??

ClockToshi
Posts: 5
Joined: Thu Nov 16, 2017 9:25 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by ClockToshi » Thu Nov 16, 2017 9:37 pm

loboris, impressive and great work 8-)

wanted to ask a question, I got a normal esp32 without SPIRAM and i want to use your micropython repository as it has features I want to use (threading and telnet at least) but I have a problem.

after connecting to wifi/internet the code is like this:

[code]

import urequests

urequests.request('GET', 'https://raw.githubusercontent.com/Learn ... als-1.json').json()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "urequests.py", line 56, in request
OSError: [Errno 12] ENOMEM

[/code]

this code work on micropython-esp32 repository but not on micropython built from your repository.

I tried changing mono/dual core settings, stack, heap, wifi buffer, thread stack, thread support, enable/disable framebuffer, telnet. I tried menuconfig defaults, min/max, i tried the settings suggested in micropython-esp32 (16k and 96k)

i failed with always same error, maybe you know what i should use?
Last edited by ClockToshi on Fri Nov 17, 2017 12:53 am, edited 2 times in total.

loboris
Posts: 322
Joined: Fri Oct 02, 2015 6:19 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Nov 16, 2017 10:15 pm

@ClockToshi

SSL uses lot of memory, you have to lower the heap size to 64~72KB.
→ MicroPython → System settings → MicroPython heap size (KB)

Your example works with all settings default, only heap size set to 72KB:

Code: Select all

FreeRTOS running on BOTH CORES, MicroPython task started on App Core.

 Reset reason: Power on reset
    uPY stack: 19456 bytes
     uPY heap: 72000/5808/66192 bytes

MicroPython ESP32_LoBo_v2.0.8 - 2017-11-04 on ESP32 board with ESP32
Type "help()" for more information.

Starting WiFi ...
True
WiFi started
Synchronize time from NTP server ...
Time set
'Thu Nov 16 22:12:59 2017'

>>> import urequests
>>> urequests.request('GET', 'https://raw.githubusercontent.com/LearnWebCode/json-example/master/animals-1.json').json()
[{'foods': {'dislikes': ['ham', 'zucchini'], 'likes': ['tuna', 'catnip']}, 'name': 'Meowsy', 'species': 'cat'}, {'foods': {'dislikes': ['tuna'], 'likes': ['bones', 'carrots']}, 'name': 'Barky', 'species': 'dog'}, {'foods': {'dislikes': ['cookies'], 'likes': ['mice']}, 'name': 'Purrpaws', 'species': 'cat'}]
>>> 

Post Reply