MKR1000 behaves differently when it is connected to PC vs on 3.7V,14000mAh LIPO

Hi

My Arduino MKR1000 is behaving differently when it connected to a computer versus on a 3.7V, 1400mAh LIPO battery. My problem is quite similar to the one mentioned here, except Arduino Uno. But there they suspect drop in voltage as the villain. But my multimeter almost always gives me 3.7V as terminal voltage.

Background: Project involves Arduino-Unity mutual interaction over WiFi. Arduino is expected to send a set of 5 values (based on inputs from 5 analog sensors) upon receiving a correct command from Unity.

Problem I am facing: Everything works 100% perfect as long as I power up MKR with computer(micro usb). But the moment I switch to external power mode,with a 3.4V - 14000mAh LIPO battery, I am almost always getting same junk values at Unity side, over WiFi, which is "- 214783646",. Does this value signify something (I believe it as the minimum value of 32 bit signed int, what may be the possible causes to trigger this)?

Attaching condensed block of code here.Apology for still being it lengthy one, please ask me if you need extra information/ more clarity on something. Here acquireData() and sendValues() are the method that I am really interested in, most importantly on " client.println(strData); "

#include <WiFi101.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiSSLClient.h>
#include <WiFiUdp.h>
#include <SPI.h>
 
char ssid[] = "AMASHAL-PC";      //  your network SSID (name)
char pass[] = "1234567890";   // your network password
int keyIndex = 0;            // your network key Index number (needed only for WEP)
int status = WL_IDLE_STATUS;
int checkInterval = 10000;
int led1 = 6;
WiFiServer server(8000);            //What ever port your wish to use
boolean alreadyConnected = false; // whether or not the client was connected previously
char thisChar = 0;


int IRpin = 2; // IRpin represents pinky and IRpin4 represents thumb
int IRemitter = 0;
int IRpin1 = 3;
int IRemitter1 = 1;
int IRpin2 = 4;
int IRemitter2 = 2;
int IRpin3 = 5;
int IRemitter3 = 3;
int IRpin4 = 6;
int IRemitter4 = 4;
const int numReadings = 40;
const int numfingers = 5;
const float pi = 3.14; 
int readIndex_i = 0;
int readIndex_j = 0;
unsigned int total[numfingers];
int average[numfingers];
int readings[numReadings][numfingers]; 
int CorrectedValue[numfingers];
int sensorValue[numfingers];
int sensorMax[numfingers];
int sensorMin[numfingers];

int ReferenceLow0 = 0;
int ReferenceRange0 = 90;
int ReferenceLow1 = 0;
int ReferenceRange1 = 90;
int ReferenceLow2 = 0;
int ReferenceRange2 = 90;
int ReferenceLow3 = 0;
int ReferenceRange3 = 90;
int ReferenceLow4 = 0;
int ReferenceRange4 = 90; 

static int RawLow0 = 230;
static int RawLow1 = 250;
static int RawLow2 = 400;
static int RawLow3 = 330;
static int RawLow4 = 170;

static int RawRange0 = 200;
static int RawRange1 = 100;
static int RawRange2 = 250;
static int RawRange3 = 250;
static int RawRange4 = 40;
static String strData;
WiFiClient client;

 void setup() {
  
   pinMode(led1, OUTPUT);
   //Initialize serial and wait for port to open:
   Serial.begin(9600); 
   initializeSensors();  
   // check for the presence of the shield:
   if (WiFi.status() == WL_NO_SHIELD) {
     Serial.println("WiFi shield not present"); 
     // don't continue:
     while(true);
   } 
   
   // attempt to connect to Wifi network:
   while ( status != WL_CONNECTED) { 
     // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
     status = WiFi.begin(ssid, pass);
 
     // wait 10 seconds for connection:
     delay(10000);
   } 
  server.begin(); 
   // you're connected now, so print out the status:
   printWifiStatus();
  }
 
 
 void loop() {
   
    acquireData();  //acquire sensor data
    client = server.available();   // Wait for the client

   // When the client sends the first byte, say hello:
     if (client) { //if there is a client
	 
       if (!alreadyConnected) { //and its not already connected
       client.flush();          // clead out the input buffer:
       client.println("Hello Client, From Server");       
       alreadyConnected = true; // remember the client is now connected
       
     } 
   } else { // if there is no client
     
     if (alreadyConnected){      // if there has just been a client, set alreadyConnected to false 
     alreadyConnected = false;    
     }
	 
     alreadyConnected = false;
     } 
     
   }
  
	   if (client.available()) {   // if a client is available
	   thisChar = client.read();   // Read the bytes incoming from the client:
	   client.flush();        
	   if (thisChar == 48) {        // if the character received from Unity is '0'  call this function
		 calibrationFunction();                                    
	   } 
	  else {
	   if (thisChar == 49) {       // if the character received from Unity is '1'  call this function
		sendValues();                    
		  } 
	   }  
   }
   
 }
 
 void initializeSensors(){
  //logic to initialize sensors.
  
  }
  void acquireData(){
  
    strData="";
	
    //Subtracting the previous sensor data value
  total[0] = total[0] - readings[readIndex_i][0];
  total[1] = total[1] - readings[readIndex_i][1];
  total[2] = total[2] - readings[readIndex_i][2];
  total[3] = total[3] - readings[readIndex_i][3];
  total[4] = total[4] - readings[readIndex_i][4];
  //Storing the current sensor data to "readings[readindex]" variable
  readings[readIndex_i][0] = analogRead(IRpin); // IRpin represents pinky and IRpin4 represents thumb
  readings[readIndex_i][1] = analogRead(IRpin1);
  readings[readIndex_i][2] = analogRead(IRpin2);
  readings[readIndex_i][3] = analogRead(IRpin3);
  readings[readIndex_i][4] = analogRead(IRpin4);



  //Adding the the readings to the total
  total[0] = total[0] + readings[readIndex_i][0];
  total[1] = total[1] + readings[readIndex_i][1];
  total[2] = total[2] + readings[readIndex_i][2];
  total[3] = total[3] + readings[readIndex_i][3];
  total[4] = total[4] + readings[readIndex_i][4];  
  //Next value index
  readIndex_i = readIndex_i + 1;

    if (readIndex_i >= numReadings){
      //Stop the advancing and set back in loop
      readIndex_i = 0; 
    }
    
    //Calculating the average over 'numReadings' values
  average[0] = total[0] / numReadings;
  average[1] = total[1] / numReadings;
  average[2] = total[2] / numReadings;
  average[3] = total[3] / numReadings;
  average[4] = total[4] / numReadings;
  
 
  CorrectedValue[0] =       (((average[0]-RawLow0)*ReferenceRange0)/RawRange0)+ReferenceLow0;
  CorrectedValue[1] =       (((average[1]-RawLow1)*ReferenceRange1)/RawRange1)+ReferenceLow1;
  CorrectedValue[2] =       (((average[2]-RawLow2)*ReferenceRange2)/RawRange2)+ReferenceLow2;
  CorrectedValue[3] =       (((average[3]-RawLow3)*ReferenceRange3)/RawRange3)+ReferenceLow3;
  CorrectedValue[4] =       (((average[4]-RawLow4)*ReferenceRange4)/RawRange4)+ReferenceLow4;
  
  String data0=String(CorrectedValue[0]);
  String data1=String(CorrectedValue[1]);
  String data2=String(CorrectedValue[2]);
  String data3=String(CorrectedValue[3]);
  String data4=String(CorrectedValue[4]);
  strData=data0+","+data1+","+data2+","+data3+","+data4;

  }
 void sendValues(){
      client.flush();
      client.println(strData); 
    }
   void calibrationFunction(){     
   //calibration logic

    
}

 void printWifiStatus() {
   // logic to print the deatils  of the network you're attached to:
   
 }

Regards
mmpk