Lost in the lib and doc

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Lost in the lib and doc

Post by JumpZero » Fri Oct 16, 2020 11:14 am

Hello,

I wonder how Micropython-lib is accurate/up-to-date/organised related to the documentation
For instance:
I flashed the latest stable v1.13 on a ESP8266. From REPL I can do

Code: Select all

import umqtt.simple
(or umqtt.robust) and use it as expected. However if I want to read the code of that module to understand in depth how it works, it is in the github Micropython-lib but the code hasn’t changed in 3 years! As almost all others modules!..
In the documentation nothing about this module. Well, maybe the code is still the same. But what if it has changed?

Another instance: v1.13 comes with a new uasyncio module (as per announcement) but in the github Micropython-lib it hasn’t changed in 3 years.

So I’m lost, I would appreciate any clarification
Thanks in advance to you guys Micropython experts!
--
Jmp0

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

Re: Lost in the lib and doc

Post by pythoncoder » Fri Oct 16, 2020 1:27 pm

In general the code here micropython-lib is current and correct. Like much of the library the mqtt libraries have not been updated for a while but they are current.

You have hit a rare exception. The uasyncio in micropython-lib is version 2.0. This is obsolete and has recently been replaced by V3. This is now built in to MicroPython: the source is here.

Built-in modules don't appear in micropython-lib as their source is in the MicroPython source tree. Arguably uasyncio should be removed from micropython-lib, or marked as deprecated.
Peter Hinch
Index to my micropython libraries.

JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Re: Lost in the lib and doc

Post by JumpZero » Fri Oct 16, 2020 2:19 pm

Thanks for clarification @pythoncoder

Ok it makes sens the built-in modules aren't in the Micropython-lib but they are well documented in the doc so it's fine. And the modules in the lib are current.
And unfortunately I've hit uasyncio... :lol:

So I now feel on a stable base! Thanks again

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

Re: Lost in the lib and doc

Post by pythoncoder » Fri Oct 16, 2020 6:07 pm

If you are using uasyncio there is this tutorial which expands on the official docs.
Peter Hinch
Index to my micropython libraries.

JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Re: Lost in the lib and doc

Post by JumpZero » Sat Oct 17, 2020 4:22 pm

Hi Peter,

I actually already found your tutorial and also this one.
I have tested some exemples. I must say that I'm impressed by:
1 - The possibility to run simultaneous tasks, the computing power of so cheap hardware (almost computer no more microcontroller!)
2 - The quality and of your doc

Again thanks for sharing
--
Jmp0

Post Reply