Page 1 of 1

Arduino and GPRS

Posted: 14:24, 13 Aug 2015
by mike
Hi everyone :D i would like to use Evothings to control a LED...switch it on and off with my phone.
I have read your tutorials and see that you only connect to Evothings , via Arduino BLE and wifi/ethernet...

I only have a GPRS/GSM module for my arduino and would like to connect my smartphone to Evothings, through gprs...

Could anyone please assist me with this

regards
Mike
Senior engineer

Re: Arduino and GPRS

Posted: 14:42, 13 Aug 2015
by Fredrik
Tricky.

With GPRS, both your phone and the Arduino are NAT-firewalled, so you'd need a server on the Internet to act as a relay.

Re: Arduino and GPRS

Posted: 19:14, 13 Aug 2015
by mike
hmmm i see... so there would be no way then , to connect easily to Evothings ?

This is sample code to connect to any url using Gprs and arduino, but to configure this to connect to Evothings will probably be tricky.

Code: Select all

void SubmitHttpRequest()
{
 
  SIM900.println("AT+CSQ"); // Signal quality check

  delay(100);
 
  ShowSerialData();// this code is to show the data from gprs shield, in order to easily see the process of how the gprs shield submit a http request, and the following is for this purpose too.
 
  SIM900.println("AT+CGATT?"); //Attach or Detach from GPRS Support
  delay(100);
 
  ShowSerialData();
  SIM900.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");//setting the SAPBR, the connection type is using gprs
  delay(1000);
 
  ShowSerialData();
 
  SIM900.println("AT+SAPBR=3,1,\"APN\",\"CMNET\"");//setting the APN, Access point name string
  delay(4000);
 
  ShowSerialData();
 
  SIM900.println("AT+SAPBR=1,1");//setting the SAPBR
  delay(2000);
 
  ShowSerialData();
 
  SIM900.println("AT+HTTPINIT"); //init the HTTP request
 
  delay(2000);
  ShowSerialData();
 
  SIM900.println("AT+HTTPPARA=\"URL\",\"url goes here"");// setting the httppara, the second parameter is the website you want to access
  delay(1000);
 
  ShowSerialData();
 
  SIM900.println("AT+HTTPACTION=0");//submit the request
  delay(10000);//the delay is very important, the delay time is base on the return from the website, if the return datas are very large, the time required longer.
  //while(!SIM900.available());
 
  ShowSerialData();
 
  SIM900.println("AT+HTTPREAD");// read the data from the website you access
  delay(300);
  changeLed();
  ShowSerialData();
 
  SIM900.println("");
  delay(100);
}