Hardware in use: Notecarrier F, Notecard, Swan MCU, Android phone
In a nutshell: I have completed the Quickstart up to the setion where the sensors.qo is sent to the Notehub. It shows up in the events page.
The sensors.qo data is controlled in the quickstart FW by the " J *body = JAddObjectToObject(req, “body”);" code fragment that is part of the Quickstart code as shown here:
J *req = notecard.newRequest(“note.add”);
if (req != NULL)
{
JAddStringToObject(req, “file”, “sensors.qo”);
JAddBoolToObject(req, “sync”, true);
J *body = JAddObjectToObject(req, “body”);
if (body)
{
JAddNumberToObject(body, “temp”, temperature);
JAddNumberToObject(body, “humidity”, humidity);
notecard.sendRequest(req);
}
I created a similar code fragment with which I intended to correspond with Twilio SMS:
J *req2 = notecard.newRequest(“note.add”);
if (req2 != NULL)
{
JAddStringToObject(req2, “file”, “twilio.qo”);
JAddBoolToObject(req2, “sync”, true);
J *body = JAddObjectToObject(req2, “body”);
if (body)
{
JAddStringToObject(body, "customUsername", "...USERNAME HERE");
JAddStringToObject(body, "customMessage", "Coming From req2");
JAddNumberToObject(body, "temp", temperature);
JAddNumberToObject(body, "humidity", humidity);
JAddStringToObject(body, "customFrom", "+1FROMPHONE HERE");
JAddStringToObject(body, "customTo", "+1TOPHONE HERE");
}
notecard.sendRequest(req2);
So, what is happening is that both notes get to and show up at notehub.io. And Twilio is sending an SMS to my phone. The problem is that the title of the message is NOT the title that is in twilio.qo, it is the title that was put in on the “create route” page of notehub.io.
So it seems to me that both note.add commands are pushing the req and req2 data out to Notehub.io, and something is triggering notehub.io to send something to Twilio. However, none of the data appears to be being sent to Twilio, or if it is then Twilio doesn’t appear to know what to do with it. I don’t see anything in the tutorial that shows how to get the sensors.qo and twilio.qo DATA from notehub.io to Twilio.
Thanks,
Raymond