-->
Page 1 of 1

pinMode(x, INPUT) causes bad wifi

PostPosted: Sun Dec 15, 2019 7:33 am
by Jeroenst
I'm programming this device: https://aliexpress.com/item/4000218700204.html

Which is more or less the same as: https://blakadder.github.io/templates/q ... immer.html

It works fine, but when I enable input (I tried gpio5 and gpio13 which I need), I get a very high packet loss.

Also with INPUT_PULLUP the packet loss is very high.

When I tie the inputs to gnd, the packet loss is 0.

Why do I get packet loss when I configure these pins as input?

I also had to set GPIO to output, otherwise the same packet loss occurs.

When I measure the pins with a 20mhz scope, I don't see any noise.

Re: pinMode(x, INPUT) causes bad wifi

PostPosted: Sat Dec 21, 2019 1:12 pm
by Jeroenst
At this moment I defined all gpio's as output and have set them to low. It looks wifi is stable now. Still strange, because with other devices (nodemcu, sonoff) I never had this issue.

Re: pinMode(x, INPUT) causes bad wifi

PostPosted: Sun Dec 22, 2019 9:13 pm
by teddyz
I do not think that making them INPUT is the error as they are all INPUT after boot.
But If you have connected wires that pass the Wifi antenna, perhaps some radio energy goes either into or out from the chip causing problems. Keep signal wires short.

Test if decreasing output power can help. For me it lowered the number of false detections from my PIR sensor.

WiFi.setOutputPower(WiFiOutputPower); // 0 - 20.5 dBm