MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

Re: rshell and sd card

Post by slzatz » Tue Jan 16, 2018 4:01 pm

Updated to MicroPython ESP32_LoBo_v3.1.5 - 2017-01-16 and with mounting the sd card in boot.py, rshell properly detects the card and all operations work fine after either a soft reboot or a hard reboot. Thank you.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: MicroPython on ESP32 with SPIRAM support

Post by OutoftheBOTS_ » Thu Jan 18, 2018 9:51 am

@laboris

I finially found some time to play with your updated PWM lib. First of all I was able to create a clocking PWM at 20mhz at 50% duty as needed. The down side seems to mean it bogs down the ESP32 chip, The repl over telnet wouldn't update properly when I was creating 20mhz wave but if I slowed down the PWM wave to 2 Mhz then telnet would update properly again.

I assume these high freq PWM just use to much of the CPU??

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Jan 18, 2018 10:23 am

OutoftheBOTS_ wrote:
Thu Jan 18, 2018 9:51 am
...The down side seems to mean it bogs down the ESP32 chip, The repl over telnet wouldn't update properly when I was creating 20mhz wave but if I slowed down the PWM wave to 2 Mhz then telnet would update properly again.
I assume these high freq PWM just use to much of the CPU??
The PWM does not use any CPU resources, it is handled completely by ESP32 hardware peripheral.

The PWM frequency can't in any way impact the REPL (over serial or Telnet) performance.
Something else must be causing your issue.
I've tried to run 20 MHz PWM and I did not have any issue with Telnet.

By the way, at 20MHz PWM, the duty resolution is 4 bits, so you can have 25%, 50% and 75% duty cycles.
At 40 MHz only the duty cycle of 50% is available.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: MicroPython on ESP32 with SPIRAM support

Post by OutoftheBOTS_ » Thu Jan 18, 2018 11:39 am

@laboris

Thanks. I will play with it more. My windows PC seems to be doing lots of low perforce problems since the updates for the spretre and meltdown patches so many it is at my PC end not the ESP32.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Jan 18, 2018 1:06 pm

Documentation update:

Full documentation for machine.Timer is now available on Wiki.

Some other documentation updated.

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by HermannSW » Thu Jan 18, 2018 7:33 pm

@loboris

I used the prebuilt version with running telnet server you provided here
viewtopic.php?f=18&t=3997#p23075

for really debugging ESP32 header pins lately:
https://www.esp32.com/viewtopic.php?f=2 ... 087#p18647

Then I connected the ESP32+Oled module to motor driver on robot and learned how to debug on a higher level, not single pins but motor functionality. This is just done by adding some functions like forward(), left() to boot.py and making use of pwma.duty(1023) for controlling speed of steering omni wheel robot:
https://www.esp32.com/viewtopic.php?f=2 ... 087#p19087

All perfect -- today I started to look for BLE support in ESP32 MicroPython in order to connect a BLE gamepad to ESP32. I did not find BLE or bluetooth mentioned on your Wiki:
https://github.com/loboris/MicroPython_ ... _LoBo/wiki

But I found dmazella's "uble"/"Lightweight Bluetooth Low Energy driver written in pure python for micropython":
https://github.com/dmazzella/uble

A lot of stuff, can that be used inside your MicroPython?
If so, what are the steps needed to get "uble" working in your MicroPython?

Image
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Jan 18, 2018 7:42 pm

HermannSW wrote:
Thu Jan 18, 2018 7:33 pm
... today I started to look for BLE support in ESP32 MicroPython in order to connect a BLE gamepad to ESP32. I did not find BLE or bluetooth mentioned on your Wiki ...
I've just started working on BT implementation ...
Frst, there will be Classic BT, SPP profile (as I need it the most), probably will finished by the end of the month.
After that, I'll work on implementing the BLE stuff...

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by HermannSW » Thu Jan 18, 2018 9:29 pm

Good to hear -- but in the mean time, since "uble" is implemented in pure Python, can "uble" make BLE connection of gamepad possible in your MicroPython as it is today?
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Thu Jan 18, 2018 10:06 pm

HermannSW wrote:
Thu Jan 18, 2018 9:29 pm
Good to hear -- but in the mean time, since "uble" is implemented in pure Python, can "uble" make BLE connection of gamepad possible in your MicroPython as it is today?
As far as I can see this driver is written for specific BT hardware, STMicroelectronics SPBTLE-RF, so I don't think it can be adapted for ESP32.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: MicroPython on ESP32 with SPIRAM support

Post by OutoftheBOTS_ » Fri Jan 19, 2018 8:31 am

@laboris

Question on your timer. Are they the same timers used for PWM i.e if I am already using timer 0 to timer 2 for PWM generation and I want to make a call back timer I must use timer 3 ???

I am using timer 0 for 20mhz clock signal for the counter chip, I am using timer 1 and timer 2 for PWM speed control of 2 motors and I want to use a call back timer so that every 200ms it will read the encoder counter chip and adjust the motor speed PWM if the motor is at incorrect speed

edit. I have just realised that both the motor PWM will have same freq but different duty so I can use same timer for both motor speed PWM
Last edited by OutoftheBOTS_ on Fri Jan 19, 2018 8:52 am, edited 1 time in total.

Post Reply