Arduino and GPRS

Ask, and ye shall receive.
mike
Posts: 2
Joined: 14:20, 13 Aug 2015

Arduino and GPRS

Postby mike » 14:24, 13 Aug 2015

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

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: Arduino and GPRS

Postby Fredrik » 14:42, 13 Aug 2015

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.

mike
Posts: 2
Joined: 14:20, 13 Aug 2015

Re: Arduino and GPRS

Postby mike » 19:14, 13 Aug 2015

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);
}



Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 5 guests