Page 6 of 6

Re: Software serial?

Posted: Wed Jun 16, 2021 3:45 pm
by tusker
Hi hcet14,

Apologies for not seeing your Issue raised on github!

I am interested in maintaining my fork, but have been busy with other projects.

Let me look into your issue and see whether I can work out what is happening, might have to find one of the MH-Z19 sensors somewhere to try it.

Cheers,

Damien

Re: Software serial?

Posted: Sun Jun 20, 2021 9:03 am
by katesimon123
But working on Serial is not that difficult either.

At the start, you have said it has two ports. It has just 1 Serial Port which has two pins, one is for sending and the second one is for receiving. You will find examples in the library and you just need to connect the wires with respective pins, if you are using software serial.

The second thing to check is the baud rate, both devices must be working on the same baud rate and that's it. You can make it work in a day.

Re: Software serial?

Posted: Sat Jun 26, 2021 5:50 pm
by hcet14
tusker wrote:
Wed Jun 16, 2021 3:45 pm
Hi hcet14,

Apologies for not seeing your Issue raised on github!

I am interested in maintaining my fork, but have been busy with other projects.

Let me look into your issue and see whether I can work out what is happening, might have to find one of the MH-Z19 sensors somewhere to try it.

Cheers,

Damien
For those, who are interested may find my answer here https://github.com/dmascord/micropython ... -869021957

Thanks again, Damien :D

Re: Software serial?

Posted: Sun Sep 12, 2021 12:06 pm
by MrJake222
So @tusker, why didn't you make a pull request to the main micropython repo?

EDIT
I've managed to create a proper repo with dmascord code but with upstream set to official repo. I've merged upstream over the master and it didn't show any merge conflicts. But I haven't tested it as I'm having problems with the toolchain (I'm going to fix this tomorrow).
Repo: https://github.com/MrJake222/micropython

Re: Software serial?

Posted: Mon Sep 13, 2021 10:30 pm
by MrJake222
Hey,

I've managed to get two SoftUARTs to work simultaneously. Here you can find examples. Also a precompiled release is present.

Re: Software serial?

Posted: Mon Sep 13, 2021 10:44 pm
by MrJake222
Pull Request.
Let's vote it up!

Re: Software serial?

Posted: Sun Sep 19, 2021 1:57 pm
by tuckata
Hey MicroPython Guys!

I can see you've succeeded with Software Serial on ESP32, however I would like to have Software UART ported to stm32. Searching Google and this forum I could not find a ready to use solution, so if you know of such please tell me. Otherwise I would try to do that, hopefully with your help.

I think a good starting point would be to add an STM32Cube Expansion, described in https://www.st.com/resource/en/applicat ... ronics.pdf "Application note AN4457 Implementing an emulated UART on STM32F4 microcontrollers", with associated code https://www.st.com/en/embedded-software ... 32156.html to the libraries and use ports/stm32 uart.c, machine_uart.c (and others, as DMA is also involved) as a base to modify for a software serial class in the MicroPyhton core.

I consider myself a newbie: MicroPython is new to me; my first obstacle is that I am modifying the source in a simple text editor and compiling on the command line and don't know how to debug. So, can you point me how to get out of the stone age: what IDE can I use, for instance Visual Studio Code? Can use the IDE also for debugging (I have ST-LINK v2 and BMP probes)?

Any help appreciated

tuckata

Re: Software serial?

Posted: Wed Sep 22, 2021 2:13 am
by tusker
MrJake222 wrote:
Sun Sep 12, 2021 12:06 pm
So @tusker, why didn't you make a pull request to the main micropython repo?
I felt the code was a bit messy... it was functional for me and worked quickly, but not really implemented in the way that I wanted.
Obviously the work you've done to create the Pull Request tidied up the code and made it much more re-usable, so thanks!