MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
kevinkk525
Posts: 437
Joined: Sat Feb 03, 2018 7:02 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by kevinkk525 » Wed Mar 28, 2018 9:15 pm

according to the docs it is machine.DHT (or machine.dht?). Try it, my ESP is not next to me atm.

demoontz
Posts: 18
Joined: Wed Feb 15, 2017 12:39 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by demoontz » Thu Mar 29, 2018 6:45 am

i found this one:
https://loboris.eu/forum/Thread-Documen ... hlight=dht

>>> import machine
>>> machine.DHT(machine.Pin(4), machine.DHT.DHT2X).read()
(True, 26.0, 44.0)
>>>

tnx =0)

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Mar 29, 2018 8:00 am

formica wrote:
Tue Mar 27, 2018 2:22 pm
@loboris, can you confirm that your micropython version works properly with pycom W01 oem module?
Did you try also the to use the extended RAM, external antenna, usb uploading using 'ampy' and the uasyncio library?

Regards
RM
I don't have Pycom W01 OEM module, so I can't test it, but W01 module is similar to ESP32-WROVER, except for the different pinout, there are no reasons why it shouldn't work.

Everything should work on W01 the same as on any other ESP32 module.
There are some reported issues with uasyncio, but I don't support it directly (I recommend using threads for similar functionality).

User avatar
pythoncoder
Posts: 3540
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by pythoncoder » Fri Mar 30, 2018 4:59 am

@loboris I'm almost certain that uasyncio compatibility will appear when you rebase your fork to the current upstream.

I disagree with your view that the _thread module is a replacement for uasyncio: they are really quite different and depending on the application there can be overwhelming reasons for using one or the other.

Reasons for choosing uasyncio are offered here (section 7.5) and here threads are bad.
Peter Hinch

zhao
Posts: 5
Joined: Mon Mar 19, 2018 2:15 pm

Re: MicroPython on ESP32 with SPIRAM support-UART event queue full

Post by zhao » Fri Mar 30, 2018 10:52 am

I am using the M5STACK with 4MB psRAM. The firmware is the lastest version of MicroPython_LoBo_esp32_psram_all.
The uart was defined as uart = UART(1, baudrate=19200, bits=8, rx=21, tx=22, timeout=10).
When I received some data from the RX of the uart, the error of uart: UART event queue full emerged.
>>> se.uart
UART(1, baudrate=1536614, bits=8, parity=None, stop=1, tx=22, rx=21, rts=-1, cts=-1, timeout=10, buf_size=512, lineend=b'\r\n')
Event task minimum free stack: 0

the last line is " Event task minimum free stack: 0".

Besides, this problem is random and sometimes the uart can receive data correctly.

The device connected to the board is powered on 5V.

User avatar
pythoncoder
Posts: 3540
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MicroPython on ESP32 with SPIRAM support-UART event queue full

Post by pythoncoder » Fri Mar 30, 2018 3:45 pm

zhao wrote:
Fri Mar 30, 2018 10:52 am
...The device connected to the board is powered on 5V.
This has been answered above. You need a logic level converter. The ESP32 is not 5V tolerant and expresses its dislike with that precise error message.
Peter Hinch

wr300000
Posts: 21
Joined: Sun Jan 14, 2018 3:54 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by wr300000 » Tue Dec 04, 2018 7:04 am

loboris wrote:
Mon Feb 19, 2018 11:04 am
@pythoncoder

I've made some changes recently which may address some of your questions, they will be committed soon.

sys.platform now returns 'esp32_LoBo'

utime.ticks_xx() functions are updated in a way that they are insensitive to the acctual time from RTC.
utime.ticks_xx() returned values are now correct after the time update via rtc.ntp_sync().

You can use i2c = I2C(-1, scl=scl_pin, sda=sda_pin) , the hw I2C 0 will be selected.
BTW, slave mode is now enabled, the mode argument (defaults to MASTER) can be entered to select the slave mode:
i2c = I2C(mode=I2C_SLAVE, scl=scl_pin, sda=sda_pin).

The default value for update_period in rtc.ntp_sync() is 0, which means the time will be updated only once.

It is true that the hall sesor is not very sensitive, I can't do anything about that. It may be more sensitive on boards without the shield.
The sensitivity may also improve if there will be some changes in esp-idf.

Not related to your questions, new function is added, machine.internal_temp() which returns the temperature measured by internal ESP32 temperature sensor.
Last edited by wr300000 on Tue Dec 04, 2018 2:12 pm, edited 1 time in total.

User avatar
mattyt
Posts: 240
Joined: Mon Jan 23, 2017 6:39 am

Re: MicroPython on ESP32 with SPIRAM support

Post by mattyt » Tue Dec 04, 2018 7:39 am

May be worth mentioning that mainline MicroPython has supported SPIRAM/PSRAM since 1.9.4. And the esp32.raw_temperature method is available... :)

Not to take anything away from the Loboris port; Boris is doing great work exposing a bunch of useful features of the ESP32!

Post Reply