Software serial?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
tusker
Posts: 4
Joined: Wed Jul 17, 2019 5:14 am

Re: Software serial?

Post by tusker » 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

katesimon123
Posts: 15
Joined: Mon Jun 14, 2021 12:49 am

Re: Software serial?

Post by katesimon123 » Sun Jun 20, 2021 9:03 am

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.

User avatar
hcet14
Posts: 34
Joined: Sat Dec 19, 2020 12:59 am

Re: Software serial?

Post by hcet14 » Sat Jun 26, 2021 5:50 pm

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
I'm a beginner with this stuff and no programmer at all.

MrJake222
Posts: 4
Joined: Sun Sep 12, 2021 12:05 pm

Re: Software serial?

Post by MrJake222 » Sun Sep 12, 2021 12:06 pm

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

MrJake222
Posts: 4
Joined: Sun Sep 12, 2021 12:05 pm

Re: Software serial?

Post by MrJake222 » Mon Sep 13, 2021 10:30 pm

Hey,

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

MrJake222
Posts: 4
Joined: Sun Sep 12, 2021 12:05 pm

Re: Software serial?

Post by MrJake222 » Mon Sep 13, 2021 10:44 pm

Pull Request.
Let's vote it up!

tuckata
Posts: 2
Joined: Sun Sep 19, 2021 1:17 pm

Re: Software serial?

Post by tuckata » Sun Sep 19, 2021 1:57 pm

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

tusker
Posts: 4
Joined: Wed Jul 17, 2019 5:14 am

Re: Software serial?

Post by tusker » Wed Sep 22, 2021 2:13 am

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!

Post Reply