need help streaming data with UNO and SEEED GSM/GPRS V2.0
configuration:
-ios mavericks
-arduino uno
-seeed gsm/gprs v2.0
-unlocked , verified at&t sim card data (no sms or voice calls)
how stream voltage readings analog sensor onto web?
i'm using m2x.att.com api, i'm open , interested in other options--perhaps better support community.
this code i'm using:
i tried using following code test modem:
and got "error: not imei"
-ios mavericks
-arduino uno
-seeed gsm/gprs v2.0
-unlocked , verified at&t sim card data (no sms or voice calls)
how stream voltage readings analog sensor onto web?
i'm using m2x.att.com api, i'm open , interested in other options--perhaps better support community.
this code i'm using:
code: [select]
#include "serialmodem.h"
#include "jsonlite.h"
#include "m2xstreamclient.h"
serialmodemclient client;
char m2xfeedid[] = "df60542f9f2ee9c1fed588320363b823"; // feed want post to
char m2xkey[] = "30700b29c45af8922ec95e659e5da7a0"; // m2x access key
m2xstreamclient m2xclient(&client, m2xkey);
const int sensor = 0; // selects input pin thermistor
int val = 0; //variable used store value coming sensor
void setup() {
// note: analogue pins ,
// automatically set inputs
serial.begin(115200); // in tutorial 9600
while (!serial);
serialmodem.setdriver(driver_mtsmc_h5);
serialmodem.setserial(&serial, 115200);
while (!serialmodem.ready()) {
serial.println("waiting modem ready..");
delay(100);
}
while (serialmodem.getnetworkstatus() < network_status_roaming) {
serial.println("waiting network registration");
delay(2000);
}
while (!serialmodem.setapn("wap.cingular")) {
serial.println("setting apn");
delay(2000);
}
}
void loop() {
val = analogread(sensor); //read value sensor
serial.println(val); // print value serial port
delay(1000); // wait 100 ms between each send
}
i tried using following code test modem:
code: [select]
/*
example test if modem working correctly.
circuit:
* gsm shield attached (using digital pins 2, 3, , 7)
created 12 jun 2012
david del peral
modified 21 nov 2012
tom igoe
*/
// libraries
#include <gsm.h>
// modem verification object
gsmmodem modem;
// imei variable
string imei = "";
void setup()
{
// initialize serial communications
serial.begin(9600);
// start modem test (reset , check response)
serial.print("starting modem test...");
if(modem.begin())
serial.println("modem.begin() succeeded");
else
serial.println("error, no modem answer.");
}
void loop()
{
// modem imei
serial.print("checking imei...");
imei = modem.getimei();
// check imei response
if(imei != null)
{
// show imei in serial monitor
serial.println("modem's imei: " + imei);
// reset modem check booting:
serial.print("reseting modem...");
modem.begin();
// , check imei 1 more time
if(modem.getimei() != null)
{
serial.println("modem functoning properly");
}
else
{
serial.println("error: getimei() failed after modem.begin()");
}
}
else
{
serial.println("error: not imei");
}
// nothing:
while(true);
}
and got "error: not imei"
i gave on m2x. i've tried xively well, not going either. i've got same setup you. know though, .setdriver method in m2x code refers model of gprs shield different yours.
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > need help streaming data with UNO and SEEED GSM/GPRS V2.0
arduino
Comments
Post a Comment