MicroPython on ESP32 with SPIRAM support

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by pythoncoder » Sat Mar 03, 2018 7:34 am

tuupola wrote:
Fri Mar 02, 2018 8:27 am
Mine actually does support both hard and soft iron bias correction...
My comment wasn't intended as criticism of your solution, merely suggesting that there is an established approach for someone needing sensor fusion with an MPU9150/MPU9250.

But I think there is a general question for @Loboris. Is it a good idea to build in to his firmware support for an ever growing selection of devices? I think it's a potential support and documentation nightmare (for him). I think each driver should be documented and supported by its creator. Users should choose and install the one they wish to use, as per the Pyboard. That approach has worked well for several years.

The magnetometer correction I referred to is a procedure where you invoke a calibration routine and slowly rotate the device around each orthogonal axis. You then stop the calibration phase and the routine calculates and applies the correction factors. Smartphone apps such as compasses and Google Sky have such options. We (myself and @turbinenreiter) have found the process to be absolutely necessary if you want remotely accurate heading data from sensor fusion.

In practice re-calibration is often necessary: I don't think storing static values is likely to be useful.

@OutoftheBOTS_ Re gyro calibration I think it depends on your usage. My understanding of the Madgwick fusion algorithm is that it filters out gyro bias. In practice (for sensor fusion) we found that the magnetometer is the only thing that requires calibration.

@on4aa Funnily enough yesterday I PM'd @Loboris suggesting the same thing: that he requests a subforum for this port. It would be a big improvement. As the volume of queries grows, a user with a problem would find it much simpler to locate a prior solution rather than navigating this colossal thread.
Peter Hinch
Index to my micropython libraries.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sat Mar 03, 2018 2:56 pm

:!:
Update:
  • Removed libquickmail, libcurl based email function implemented.
    There is no remaining GPL licensed code in the repository as of now.
  • Fixed GPIO initialization after deepsleep if ext0 or ext1 wake up source was used
    GPIOs used as ext0 or ext1 wake up sources are now functional as digital IO pins after deepsleep
  • some licensing information updated
  • Some unneeded sources removed
  • I2C module Wiki page added.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sat Mar 03, 2018 3:12 pm

on4aa wrote:
Fri Mar 02, 2018 12:06 am
... The only issue now is that upon awakening, these two buttons have lost their original callback interrupt function they once had before entering deepsleep...
This issue is fixed in the latest update.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Sat Mar 03, 2018 3:56 pm

@on4aa, @pythoncoder

I agree that this topic is too long and hard to locate the things that could be of interest for the users.
I'm not shure where the new subforum could be placed, as it belongs to the ESP32 boards and there are no subforums for individual boards. And I don't think the forum moderator(s) would like to open the new subforum for the specific MicroPython port.
I could open the new forum on my server, but I'm not shure if it would be a good idea, and if I have enough time to maintain it.

I can only suggest to all the users to open a new topic for some specific issues, questions or suggestions.
The topic name could be prefixed with some text, like [MPy-LoBo], to indicate that it is related to this MicroPython port.

@pythoncoder
I agree that it is not "a good idea to build in to his firmware support for an ever growing selection of devices".
I'll try to find the better/best way make the MicroPython modules/drivers which are tested on this port available to the users, and only include as frozen the modules/drivers which are essential and/or modified to work with this port.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by OutoftheBOTS_ » Sat Mar 03, 2018 8:43 pm

@loboris

Thanks for the complete I2C module and the docs :)

As for included frozen modules for peripheral devices maybe a menu for them can be added to your custom BUILD.sh and people can select the option they want.

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

Re: MicroPython on ESP32 with SPIRAM support

Post by pythoncoder » Sun Mar 04, 2018 7:45 am

The need for frozen bytecode is surely less on a device like the ESP32, especially one with SPIRAM! And it adds a layer of difficulty to newbies.

@loboris I can see the merit of your running some user contributed drivers to maximise your port's compatibility with upstream. But the effort of characterising and potentially supporting countless user-contributed drivers could spiral out of control and prevent you doing what you do best: improving and maintaining your port.

So I suggest you let users do it themselves as the need arises. If necessary they can raise an issue (or PR) with the author requesting (or contributing) changes to ensure compatibility with your port. Compatible drivers should be reported so others can use them; the question is, where should positive outcomes be reported? I suggest the MicroPython wiki which is rather under-used at the moment. Another option might be a topic here for drivers successfully tested on your port.
Peter Hinch
Index to my micropython libraries.

User avatar
on4aa
Posts: 70
Joined: Sat Nov 11, 2017 8:41 pm
Location: Europe
Contact:

Re: MicroPython on ESP32 with SPIRAM support

Post by on4aa » Sun Mar 04, 2018 12:12 pm

@loboris
loboris wrote:
Sat Mar 03, 2018 2:56 pm
  • [*There is no remaining GPL licensed code in the repository as of now.
  • Fixed GPIO initialization after deepsleep if ext0 or ext1 wake up source was used
    GPIOs used as ext0 or ext1 wake up sources are now functional as digital IO pins after deepsleep
  • I2C module Wiki page added.
That is all absolutely wonderful! I am very grateful. I will try this all out tonight and the coming days. Right now, I have to keep my little family happy with a number household chores ;)
rtc.wake_on_ext1(pins [,level])
If level is set to 0, all pins must be at low level to wake up.
If level is set to 1, any pin at high level will wake up.
The M5Stack buttons are all pulled up by design. Pressing them makes their lines go low.
The absolute icing on the cake would be to have a third mode: any pin at low level will wake up.
That would awake the M5Stack from deepsleep by pressing any button.
I am pretty sure someone will also find good use for a remaining fourth mode: all pins must be at high level to wake up.

PS: If you ever start your own forum, by all means, please, support Markdown. The BBCode over here drives me crazy… :?
Serge

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Mon Mar 05, 2018 10:32 am

:!:
I have started a new forum dedicated to this MicroPython port.
LoBo MicroPython for ESP32 forum
or with secure connection
LoBo MicroPython for ESP32 forum

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: MicroPython on ESP32 with SPIRAM support

Post by kevinkk525 » Mon Mar 05, 2018 4:01 pm

loboris wrote:
Mon Mar 05, 2018 10:32 am
:!:
I have started a new forum dedicated to this MicroPython port.
LoBo MicroPython for ESP32 forum
or with secure connection
LoBo MicroPython for ESP32 forum
thanks a lot for this, but please consider getting a certificate from lets encrypt. it's free and if you need help with it, I can help you. A self signed certificate is not a good choice (although still more secure than without encryption if you can trust the certificate).
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

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

Re: MicroPython on ESP32 with SPIRAM support

Post by loboris » Mon Mar 05, 2018 4:43 pm

kevinkk525 wrote:
Mon Mar 05, 2018 4:01 pm
thanks a lot for this, but please consider getting a certificate from lets encrypt.
Thanks for the suggestion. I've just updated the certificate.

Post Reply