Hey All,
I need a bit of guidance.
Context: I've built a small automated greenhouse. I'm using a mega to do the bulk of the processing, and passing sensor values and other info to an uno connected to an ethernet shield.
I'm attempting to use Dr. Charles Bell's connector/arduino methods to send the data to an instance of mySQL hosted on an amazon RDS. I've been able to manually pass data thru the unto to mysql fine, but now I'm trying to concat all of my sensor data together into an INSERT INTO statement, but I think it's overflowing available memory. Furthermore, I'm not certain i have everything in the right format.
I've constructed an array on the mega(master) side, and successfully passed/parsed the array into an array on the uno(slave) side. I'm trying to take that data, and replace this:
char INSERT_SQL[] = "INSERT INTO test_arduino.greenhouse VALUES (72,now())";
Here's what I'm doing in attempt to create a variable I can replace INSERT_SQL[] with:
byte index = 0;
while(Wire.available() > 0 && index < 12)
{
values[index] = Wire.read();
index++;
counter[0]=values[11]; //THIS IS THE COUNTER, INDICATING IF THE DATA IS NEW OR NOTString insertInto="INSERT INTO test_arduino.data_test VALUES (now(), ";
char dblQuote ='"';
String comma = ",";
char clParen = ')';
// three = dblQuote+ insertInto +values[0]+comma+values[1]+comma+values[2]+comma+values[3]+comma+values[4]+comma+values[5];
// four=comma+values[6]+comma+values[7]+comma+values[8]+comma+values[9]+clParen+dblQuote;
//three = dblQuote+ insertInto +values[0]+clParen+dblQuote;five=dblQuote+ insertInto +values[0]+comma+values[1]+comma+values[2]+comma+values[3]+comma+values[4]+comma+values[5]+comma+values[6]+comma+values[7]+comma+values[8]+comma+values[9]+clParen+dblQuote;
five.toCharArray(convertBuf,200);
}
I can get Serial.print(three+four) to work, but not combined into one variable.
Any advice on this out there?
Thanks
Justin