I have some nicely working code that is based on all the openweathermap.com and arduinoJSON examples. Works well, gets on wifi, gets and prints data, can recover from losing wifi and all of that.
However, as soon as I start to try to use the PWM pins with the servo.h library, the board won't stay on WiFi and WL_CONNECTED goes false every30 seconds or so, prompting my code to do its recovery and get back on.
At first I thought I was having some sort of brownout with servo power needs, but this happens with no servos plugged in at all. Indeed it happens with no commands to make servos move. At that is required to cause problems is adding the following lines:
#define tnowpin 3 // current temperature servo PWM output pin on Arduino
#define tmaxpin 5 // temp max servo output put
#define tminpin 6 // temp min servo
#define mainpin 9 // Main weather conditions dial servo output pin
#define precpin 10 // precip servo PWM output
#define tempservo0 500
#define tempservo100 2500 // temperature servos reading 100 degrees.
#define precipservo0 500 // and so on...
#define precipservo10 2500
#define mainservomin 500
#define mainservomax 2500
Servo TempDial;
Servo MinDial;
Servo MaxDial;
Servo MainDial;
Servo PrecipDial;
And in setup():
TempDial.attach(tnowpin,tempservo0,tempservo100);
MinDial.attach(tminpin,tempservo0,tempservo100);
MaxDial.attach(tmaxpin,tempservo0,tempservo100);
MainDial.attach(mainpin,mainservomin,mainservomax);
PrecipDial.attach(precpin,precipservo0,precipservo10);
It feels like WiFiNINA is using one of the PWM pins or timer configurations for something that servo.h is stepping on. But I am way too much of a noob to know.
I didn't immediately see any reported issues like this in arduino-libraries/Servo.
I am on 1.1.4 of the servo.h lib.
Thanks in advace
Z