SoftwareSerial Problem, Forwarding data to ESP8266 Garbage Output

Are you sure your ESP is set to 9600 bauds?
Is that also what you set your console to in the IDE?
what is the baud rate and serial communication parameters of your Power Analyzer?

I would suggest you first write just a small piece of code listening for the Power Analyzer. Try to see if this code prints correctly all the stuff your Power Analyzer spits out

#include <SoftwareSerial.h>

// Power Analyzer
SoftwareSerial mySerial(3, 2); // RX, TX -> pin 3 connected to Tx of Power Analyzer, pin 4 to Rx of PA.
String Data ;

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  Data = "";
}

void loop() {
  if (mySerial.available() > 0) {
    int s = mySerial.read();
    if ( s != '\n' && s != '\r' && s != -1) {
      Data = Data + (char) s;
    } else {
      Serial.print("Received : ");
      Serial.println(Data);
      Data = "";
    }
  }
}

Also in your original code, can you test what

  wifi.connectToServer("192.168.254.101", "1738");

returns?

what's the code on that server? why do you say you get garbage on the other side? how are you reading?