DIY NodeMCU WiFi Modem on a breadobard - finally it works!

359 views
Skip to first unread message

n.hae...@gmail.com

unread,
Feb 1, 2021, 2:58:50 AM2/1/21
to RC2014-Z80
So while I am now in possession of the original WiFi Module (thank you, @Anna) which works nice with a slightly modified version of the Zimodem firmware by Bo Zimmerman, I returned to my effort of building a WiFi Modem on a breadboard since I am totally incapable of soldering SMD devices of any size and I also wanted to save a slot on my "Backplane 8". The construct is fairly simple:

First, I built a simple voltage divider using two resistors so I get the additional 3V3 to feed a tiny bi-directional "sparkfun" level shifter (5V <-> 3V3) that I had lying around. Then I connected the RX / Tx Pins of my SIO/2 Port B to the 5V inputs of the level-shifter. On the 3V3 side, I connected the "shifted" 3V3 RX/TX signals to the NodeMCU RX/TX pins.

The NodeMCU unit has been flashed with the Zimodem firmware. I had to set

# define DEFAULT_FCT FCT_DISABLED
# define RS232_INVERTED 0

in the ESP8266 define section of zimodem.ino. With this setup and Port B of my SIO/2 module clocked at 9600 baud, I can now connect to BBSes (incuding my own, "Wintermute BBS") via WiFi.



n.hae...@gmail.com

unread,
Feb 1, 2021, 3:01:01 AM2/1/21
to RC2014-Z80
However since I am not using a "pure" ESP8266 like the WiFi module but an exprimental board (the NodeMCU), there is one (pobably weird) thing I did in order to get this far and that was to physically remove the CH340 usb cotroller chip from the NodeMCU board once the firmware had been flashed. Yes, you read it right: I physically removed the CH340 usb controller from the NodeMCU using pliers. The reason for this is that this usb controller is connected to the ESP8266 RX/TX, DTR amd /RTS pins. This is due to the fact that the board uses a micro-usb connector and the CH340 to make it easy and convenient for developers to connect the board to a PC/Mac/whatever and upload new code (firmware) to it.

n.hae...@gmail.com

unread,
Feb 1, 2021, 3:01:46 AM2/1/21
to RC2014-Z80

The downside of this is that there is a signal (high, low - I can't tell) present on the DTR and /RTS pins of the ESP8266 once it's powerd on, effectively blocking any incoming signal on the RX pin to actually reach the ESP8266 UART: no data will ever be received as the UART can only receive from one source.

I tried to find a way to disable that circiut (the usb controller) by software but I just didn't find any way to do so. Which led me to a try the proven stone-age method of physically sending the molester to oblivion. It took me weeks, to figure out why on earth neither a Wemos D1 mini nor a NodeMCU would receive any data on their "dedicated" RX pin. So while I feel a little like an electronics troglodyte, the thing actually works now! *grumph* :D

P.S.: in the meantime I also learned that there is a thing called "Witty Board" which is an ESP8266 with a seperate usb-controller HAT you can remove after uploading stuff. I understand that this adresses the issue I have encountered and solves it in a more civilized way.

Marco Maccaferri

unread,
Feb 1, 2021, 3:19:45 AM2/1/21
to rc201...@googlegroups.com
Il 01/02/21 09:01, n.hae...@gmail.com ha scritto:

> I tried to find a way to disable that circiut (the usb controller)
> by software but I just didn't find any way to do so. Which led me to

In the NodeMCU the default RX/TX pins can be redirected to pins D7/D8 by
calling the Serial.swap function (if I'm not wrong Zimodem uses the
Arduino libraries). This will exclude the USB-UART controller without
sacrificing it (you can still use it to reprogram the MCU).

The function effectively swaps the use of the two internal UARTs, the
only drawback (if I remember correctly) is that the second UART doesn't
have hardware flow controls so you are limited to RX and TX.

Hope this helps.

Best regards,
Marco

n.hae...@gmail.com

unread,
Feb 1, 2021, 3:29:15 AM2/1/21
to RC2014-Z80
Yes, I tried this by adding serial.swap() to the code and also in a simple test program I wrote. But swapping to D7/8 did not seem to resolve the issue. However, software serial worked on  pins D7/D8 but this is no option.

n.hae...@gmail.com

unread,
Feb 2, 2021, 8:02:13 AM2/2/21
to RC2014-Z80
ma...@maccasoft.com schrieb am Montag, 1. Februar 2021 um 09:19:45 UTC+1:
Well, ventually it did, indeed!  Thank you!!! :)

I just went over the Zimodem code again, adding a short delay(10) before calling the Serial.Swap method. This seems to do the trick, however it only works if the TX wire is not connected to D8 during power-on. Otherwise, there will be no output / input available at all (seems like the NodeMCU won't boot ). I wonder if I can fix this behaviour in code as well?!


Marco Maccaferri

unread,
Feb 2, 2021, 9:01:57 AM2/2/21
to rc201...@googlegroups.com
Il 02/02/21 14:02, n.hae...@gmail.com ha scritto:

> I just went over the Zimodem code again, adding a short delay(10)
> before calling the Serial.Swap method. This seems to do the trick,
> however it only works if the TX wire is not connected to D8 during
> power-on. Otherwise, there will be no output / input available at all
> (seems like the NodeMCU won't boot ). I wonder if I can fix this
> behaviour in code as well?!

Glad it worked, however I don't understand why you are having those
problems. I wired a NodeMCU to a breadboard myself sometime ago to
develop my own modem emulation and don't remember having problems at all
with the serial lines. From the picture you shared on Twitter it seems
the same kind of NodeMCU board (mine was purchased from a Chinese eBay
seller), however I don't use the same firmware, I adapted my own based
on another similar firmware https://github.com/maccasoft/WifiModem.

Now I have moved everything to a simple ESP-01 so I can't replicate the
setup.

Maybe it is the hardware flow control, have you tried to disable it ?
I never used it because the ESP-01 doesn't have the pins exposed.

Best regards,
Marco
Reply all
Reply to author
Forward
0 new messages