Weird glitching behaviour with Virtuino on ESP8266 + Arduino Uno

I'm currently working on a project (a small submarine) which I would like to controll with my smartphone. I used the virtuino library with an ESP8266 for the wifi connection.

The problem is, that every time communication takes place between the smartphone and arduino the connected servos twitch back and forth. It's only a few degrees but it is quite annoying. I also noticed that the connected motor (speed is also controlled over PWM) slows down a tiny bit.

I don't believe that it's a power problem. Motor, servos and ESP are connected to a external powersupply.

I basically followed this tutorial:

and added the functionality I needed.

The code I used is attached.

I really hope someone can help me fix it.
I hope I gave all the information necessary.

Thanks in advance
Ahwisiu

main-programm_wifi.ino (9.03 KB)

#include <SoftwareSerial.h>
SoftwareSerial espSerial =  SoftwareSerial(2,3);

Don't use SoftwareSerial if you want a more steady servo. The SoftwareSerial library blocks interrupts for too long time frames so the timer interrupts of the Servo library aren't exact enough to let them work without jitter.

So either use the HardwareSerial interface for the ESP8266 (you loose the debugging serial) or connect the servos only to hardware PWM channels (you loose the nice library).

I replaced SoftwareSerial with HardwareSerial and now everything works fine.
Thanks a lot!