Replies: 3 comments 1 reply
-
The wire length for UART is not critical, and UART and WiFi should not interfere at all. Do you get print output at the UART? Just be sure that the signal level at RX/TX is 3.3V, not 5V. But even that should not interfere with WiFi. |
Beta Was this translation helpful? Give feedback.
-
Try throwing a try/except around connect(): try:
sta_if.connect(config.hotspot, config.password)
except OSError as error:
try:
with open('errors.txt', 'a') as outfile:
outfile.write(str(error) + '\n')
except OSError:
pass Or print statements and try to determine how far through the def setup_wifi() process you get through. |
Beta Was this translation helpful? Give feedback.
-
You can try this:
sta_if.active(True)
sta_if.config(txpower=8.5)
sta_if.connect('ssid', 'passwd') |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm having a hard time getting the wifi to connect in the production (home use) environment, on a Wemos S2 mini (ESP32).
It works fine on the desk test setup, it maybe takes a few seconds but most of times without any hiccups. Just not when connected to the production wires. The 4 wires that are connected are: GND, 5V, Rx (pin 9) and Tx (Pin 10). These wires (UART) connect via a 2m cable to a UART appliance.
The following function is run when the board boots, and every xx seconds.
`
def setup_wifi() -> None:
"""Set up the wifi connection."""
print("\nsetup_wifi()")
`
As dictated by the code, if it cannot connect to the wifi it retries a maximum of 5 times and stops and resets the board. I choose to do it this way to recover if the wifi connection got lost and a reconnect isn't working out. The code is called for ever so often, making sure the Wemos S2 keeps its connection.
Does anyone have had similar problems? Is it due to the length of the UART cable?
Best regards,
lvx.
P.S. just to test I switched the cable for a double twisted pair cable (2 pairs of a 4 pair UTP cable), hoping it would remedy the issue, sadly it didn't!
Beta Was this translation helpful? Give feedback.
All reactions