MicroPython on ESP32 with SPIRAM support
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: MicroPython on ESP32 with SPIRAM support
according to the docs it is machine.DHT (or machine.dht?). Try it, my ESP is not next to me atm.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: MicroPython on ESP32 with SPIRAM support
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)
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)
Re: MicroPython on ESP32 with SPIRAM support
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).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: MicroPython on ESP32 with SPIRAM support
@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.
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
Index to my micropython libraries.
Index to my micropython libraries.
Re: MicroPython on ESP32 with SPIRAM support-UART event queue full
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.
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: MicroPython on ESP32 with SPIRAM support-UART event queue full
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
Index to my micropython libraries.
Index to my micropython libraries.
Re: MicroPython on ESP32 with SPIRAM support
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.
Re: MicroPython on ESP32 with SPIRAM support
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!
Not to take anything away from the Loboris port; Boris is doing great work exposing a bunch of useful features of the ESP32!
Re: MicroPython on ESP32 with SPIRAM support
@loboris thanks for making this available.
I haven't been able to get the available memory (gc.mem_free()) above about 70k. I've tried building per the first post here, and using a few of the different pre-built images.
I have a generic ESP32 w/4mb, and a SparkFun ESP32 with 16mb, and they both do the samething - is there something I need to enable that isn't on by default in the menuconfig, or change the partitions somehow?
Many thanks!
I haven't been able to get the available memory (gc.mem_free()) above about 70k. I've tried building per the first post here, and using a few of the different pre-built images.
I have a generic ESP32 w/4mb, and a SparkFun ESP32 with 16mb, and they both do the samething - is there something I need to enable that isn't on by default in the menuconfig, or change the partitions somehow?
Many thanks!
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: MicroPython on ESP32 with SPIRAM support
of RAM or flash ?ESP32 w/4mb, and a SparkFun ESP32 with 16mb
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).