Page 1 of 1

ReBuild Custom Firmware with Micropython 1.12

Posted: Sun Jan 03, 2021 7:47 am
by proteus
Hi everyone,

I am not very experienced and maybe the question I submit to you is trivial but I can't solve it.

At the beginning of 2020 I made some projects by building the custom firmware starting from version 1.12,
unfortunately they are gone lost and therefore I have to re-build them but the current repository is made up of
version 1.13 which I tried but I have some problems with asyncio and StreamReader that sooner or later I'll
have to deal with.

My question is where can I find or how can I do to rebuild a custom firmware starting from a basic version
such as 1.12.

To build the custom firmware I use Linux / Ubuntu

Thank you in advance for your help

Re: ReBuild Custom Firmware with Micropython 1.12

Posted: Sun Jan 03, 2021 10:52 am
by pythoncoder
You can checkout a specific version tag with (e.g.)

Code: Select all

git checkout v1.12
However my advice is not to do this. The latest version has a much improved version of uasyncio. It is highly compatible with the old version and changes to your code should be very minor. If you haven't seen it already this tutorial may help.

Re: ReBuild Custom Firmware with Micropython 1.12

Posted: Sun Jan 03, 2021 2:32 pm
by proteus
FW V.1.12 - Thank you very much I will try it.
I realize but at the moment I have to make some small changes and I don't want to take a long time.


FW V.1.13 - The same project, without modifying anything, works perfectly with FW 1.12 while with FW 1.13 it doesn't work, it is certainly my inexperience that leads me to not use the language correctly
I'm not sure if the problem is asyncio or StreamReader

Briefly, in the project I have active the "asyncio.start_server" on a specific port, when a client requests the connection the linked event
is performed, within this routine I checkthe "reader" and "writer" elements, I found that the objects provide me with information
different:

v 1.12 => <StreamReader <socket state = 3 timeout = 0 incoming = 0 off = 0> <socket state = 3 timeout = 0 incoming = 0 off = 0 >> - <StreamWriter <socket state = 3 timeout = 0 incoming = 0 off = 0 >>

v 1.13 => <Stream object at 3fff24a0> - <Stream object at 3fff24a0>


How do I get "status" and "incoming" information with v1.13?
I have several projects that I use and I don't want to change them too much.


Thank you in advance for your help

Re: ReBuild Custom Firmware with Micropython 1.12

Posted: Tue Jan 05, 2021 8:10 am
by pythoncoder
I'm not sure I entirely follow what you're doing, so apologies in advance if I'm misunderstanding.

I suspect that you're using undocumented features of uasyncio V2, features which are incompatible with CPython. I suggest you look at the CPython docs and ensure your code is compliant. I don't know of a legitimate way to query a StreamReader in the way you appear to be doing.

One approach might be to write your own start server code and query the underlying socket.

Re: ReBuild Custom Firmware with Micropython 1.12

Posted: Sat Jan 09, 2021 6:52 am
by proteus
Thank you for the answers and advice.