Doing a PID over a WiFi connection or Bluetooth connection is not a good idea. A PID needs to real time. Use the MonoBrick firmware instead and execute the programs directly on the brick. The firmware has support for setting both the speed and power directly. It even has its own PID implementation. Have a look here.