Im using a locally made Arduino Uno clone called Gizduino and a GSM/GPRS shield SIM900D. Im using two libraries (see attachments). I wanted to convert the double value from Emonlib to char* value in order for the GSM to recognize it. I tried to send realPower data from Emonlib(OpenEnergyMonitor) via SMS. However, the sent SMS contains blank message. I still did not connect it to the circuit diagram expecting the output should be 0.00. I've also attached an image of the circuit diagram and here is the code below:
#include <EmonLib.h>
EnergyMonitor emon1;
#include <SerialGSM.h>
#include <SoftwareSerial.h>
SerialGSM cell(2,3);
void setup(){
char* realPower;
dtostrf(emon1.realPower, 5, 2, realPower);
Serial.begin(9600);
cell.begin(9600);
cell.Verbose(true);
cell.Boot();
cell.FwdSMS2Serial();
cell.Rcpt("+639265209022");
cell.Message(realPower);
cell.SendSMS();
}
void loop(){
if (cell.ReceiveSMS()){
Serial.println(cell.Message());
cell.DeleteAllSMS();
}
}
EmonLib-master.zip (7.22 KB)
SerialGSM-master.zip (4.24 KB)