this post was submitted on 19 Aug 2023
0 points (50.0% liked)

Arduino

831 readers
66 users here now

All about Arduino boards and programming.

founded 4 years ago
MODERATORS
 

(me again) i’m trying to use both WIFI-AP, DO and SPI. But my wifi is not properly working when i let everything run at maximum (required) speed.

TLDR; Seems that pins D1 and D2 interfere with WIFI, but why?

i have a NodeMCU ESP8266 V3 ‘wemos’ variant. (it doesn’t have the ESP-12E board integrated) https://makerselectronics.com/product/wemos-nodemcu-v3-esp8266-340g-wifi-module-with-extra-memory-32m-flash

in setup() i have

  WiFi.softAP(ssid, password);

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);

  server.on("/", handleRoot);
  server.on("/set_config", handleForm);
  server.onNotFound(handleNotFound);
  server.begin();
  ..
  t=D1;pinMode(t, OUTPUT); digitalWrite(t, LOW);
  t=D2;pinMode(t, OUTPUT); digitalWrite(t, LOW);
  t=D3;pinMode(t, OUTPUT); digitalWrite(t, LOW);

What i'm seeing;

if i have a main loop() with only

  • while (Serial.available()){ .. }
  • server.handleClient();

Then i can see the AccessPoint and i can connect to it with my Android phone.

When i add code running once every 100 msec

  • Debug setting set to MAX debug info to Serial
  • using pins D1,D2,D3 for output (to LED screen)
  • using D5,D7 for SPI, (to LED screen)
  • having SPISettings(15000000, MSBFIRST, SPI_MODE0)
  • taking total 60 up to 74 microseconds

Then i do see the WIFI AP, and i CAN connect with the WIFI AccessPoint. (But my LED display is flickering)

When i change the code to running once every 10 msec

  • // same as before

Then i CAN connect with the WIFI AccessPoint (But my LED display is flickering)

When i change the code to running once every 10 msec

  • Debug setting off
  • using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 60 up to 74 microseconds

Then i CAN connect with the WIFI AccessPoint (But my LED display is flickering)

When i change the code to running once every 1 msec

  • Debug setting None + Debug to serial
  • using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 60 up to 74 microseconds

Then i do see the WIFI AP, but i CAN'T connect with the WIFI AccessPoint (But my LED display is showing a steady picture)

When i change the code to running once every 1 msec

  • Debug setting None + Debug disabled
  • using pins D1,D2,D3 for output
  • NOT using D5,D7 for SPI
  • taking total 30 up to 40 microseconds

Then i do NOT see the WIFI AP?!

When i change the code to running once every 1 msec

  • Debug setting None + Debug disabled
  • NOT using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 50 up to 70 microseconds

Then i CAN connect with the WIFI AccessPoint?!

Seems one of the pins D1,D2,D3 is interfering with WIFI..

instead of using D1,D2,D3, i changed all I/O to only use D1. Then the WIFI AP does not show up in the WIFI networks.

instead of using D1,D2,D3, i changed all I/O to only use D2. Then the WIFI AP does not show up in the WIFI networks.

instead of using D1,D2,D3, i changed all I/O to only use D3. Then the WIFI AP does show up in the WIFI networks. And i can connect to it.

So my question is; Seems that pins D1 and D2 interfere with WIFI, but why?

top 1 comments
sorted by: hot top controversial new old
[–] roho@lemmy.ml 0 points 1 year ago* (last edited 1 year ago)

✅ i also bought a "NodeMCU ESP8266 V3 12E". With this variant with the integrated ESP-12E (shielded)module, WIFI does not experience interference with pins D1 and D2!

This is how the modules differ visually:

"NodeMCU ESP8266 V3"

Says "Wemos". (link)

"NodeMCU ESP8266 V3 12E"

Says "Lolin" and has "ESP-12E" integrated. (link1)(link2)