Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SRedd17
Novice
2,260 Views

connecting Intel Galileo Gen 2 to internet through GPRS commands

Hello Sir/Ma'am,

I am trying to post data on cloud through GPRS. I am using AT commnads for http connection and got stuck in one command i.e., AT+SAPBR, kindly help me out. Is there any alternative command that I can use instead of AT+SAPBR.

My code is

void setup()

{

Serial1.begin(115200);

Serial.begin(9600);

Serial.println("Config SIM900...");

delay(2000);

Serial.println("Done!...");

//gprsSerial.flush();

Serial.flush();

// Serial1.println("AT");

//delay(2000);

//ShowSerialData();

}

void ShowSerialData()

{

while(Serial1.available()!=0)

Serial.write(Serial1.read());

}

void loop()

{

Serial1.println("AT");

delay(2000);

ShowSerialData();

Serial1.println("AT+CGATT?");

delay(2000);

ShowSerialData();

//bearer settings

Serial1.println("AT+SAPBR=3,1,\"contype\",\"GPRS\"");

delay(2000);

ShowSerialData();

Serial1.println("AT+SAPBR=3,1,\"APN\",\"http://airtelgprs.com/ airtelgprs.com\"");

delay(100);

ShowSerialData();

//bearer settings

Serial1.println("AT+SAPBR=1,1");

delay(100);

ShowSerialData();

}

The Response of above commands is as follows:

Config SIM900...

Done!...

AT

OK

AT+CGATT?

+CGATT: 1

OK

AT+SAPBR=3,1,"contype","GPRS"

ERROR

AT

OK

AT+CGATT?

+CGATT: 1

OK

AT+SAPBR=3,1,"contype","GPRS"

ERROR

16 Replies
idata
Community Manager
57 Views

Hello Sreevardhan,

 

 

Thanks for reaching out!

 

 

One thing that could be of much help to us is if you can share the GPRS module that you are using. If we had this information we would be able to look for more specific causes for this behavior.

 

 

Nevertheless, I read online that something that could be happening is that the GPRS module is already connected to the ISP when you try to connect it. If this was the case, you could try resetting the module before entering the AT+SAPBR commands.

 

 

Also, something else that you can try is setting the APN settings with the AT+CSTT= command. You can find details about the AT+CSTT command in http://m2msupport.net/m2msupport/atcstt-satrt-task-and-set-apn-username-and-password/.

 

 

I hope this information helps you,

 

Pedro M.
SRedd17
Novice
57 Views

Hello Sir,

I am using gprs module of linksprite.com, i.e., ATWIN QUAD-BAND gprs shield. And I am connection this shiled to Intel galileo gen 2 by UART pin no. 0(rx) and pin no. 1(tx). I have tried using the command AT+CSTT, as you suggested but this is again showing error.

idata
Community Manager
57 Views

From what I read in http://linksprite.com/wiki/index.php5?title=ATWIN_Quad-band_GPRS/GSM_Shield_for_Arduino, I understand that there is a library for this shield. Why aren't you using it? Is it incompatible with Galileo's x86 architecture? Or, is there any other reason?

 

 

In case it is compatible with Galileo, I suggest you to try using it and to check the link I shared above, it includes an example which you might find helpful.

 

 

Also, I wanted to ask you if you tried my other suggestion. I mentioned that there were issues with certain modules where they would throw error messages when they were connected to the network before the connection commands arrive to them and some people have reported to fix this behavior by resetting the module before entering the commands. Did this help you?

 

 

Let me know.

 

Pedro M.
idata
Community Manager
57 Views

Hello Sreevardhan,

 

 

Do you have any updates about this?

 

 

Pedro M.
AGarc24
Beginner
57 Views

Hi, i'm having troubles connecting the intel galileo with the GSM module SIM900, using the linux interface, when i configure the uart using the UART class in mraa lib, i don't receive any answer from the module, even when i use the basic command AT. Also i'm using the instruction mraa_uart_data_available to check if there is any information but is always "0", can u please help me with my problem?

# include

# include

# include

# include "mraa.h"

int main () {

FILE *err;

FILE *sim;

char msj[]="AT";

char rta[100];

int data;

err = fopen ("errors.txt","w");

sim = fopen ("results.txt","w");

mraa_uart_context uart;

uart = mraa_uart_init (1);

mraa_uart_set_baudrate (uart,19200);

if (uart == NULL){

fprintf (err, "UART not iniciated");

exit;

}

mraa_uart_write (uart,msj,sizeof(msj));

data=mraa_uart_data_available(uart,10000);

printf ("data: %i \n",data);

if (data == 1){

mraa_uart_read (uart,rta,sizeof(rta));}

else {fprintf (err,"no response \n");

}

mraa_uart_stop (uart);

fprintf (sim, " Instruction: %s \n", msj);

fprintf (sim, " Response: %s \n", rta);

fclose (err);

fclose (sim);

return (0);

exit;

}

SRedd17
Novice
57 Views

Hello Sir,

Sorry for the late reply.

Sir you had mentioned an inbuilt library for the linksprite gprs module, if you are talking about the softwareserial library, then Sir galileo does not support softwareserial library. Is there any other library you were talking about?

As you had asked me to reset the module and I did that also, I had reset the board as well as the galileo, but it did not work.

idata
Community Manager
57 Views

While indeed SoftwareSerial is not supported by Galileo, if you have a Galileo Gen 2, there is a workaround that will make it work on pins 2 and 3. In case you are interested on this workaround, you can find it in https://github.com/MakersTeam/Galileo/tree/master/Arduino-Examples/SoftwareSerial.

 

 

While reading http://linksprite.com/wiki/index.php5?title=ATWIN_Quad-band_GPRS/GSM_Shield_for_Arduino I found something very important. It is stated that the shield must be powered by a wall adapter with 9V, 1A. And I got confirmation that it will not work if powered in a different way in http://forum.linksprite.com/index.php?/topic/2466-pin-connections-for-atwin-quad-band-gprsgsm-shield.... How are you powering your shield? Are you trying to power it through the board? If so, this will not work, you'll have to use a different power supply for this shield. In case you haven't, please try this and let us know how it goes.

 

 

Pedro M.
idata
Community Manager
57 Views

Hi alejnavarro,

 

 

Do you have access to a logic analyzer? Checking what actually comes out of the Galileo's and the SIM 9000's UART bus might be of much help. You might want to see if the message is getting out of the Galileo and if it is the SIM 9000 that won't respond or if it is the other way around.

 

 

The new line and carriage return signals have been known to cause issues in the past. Check if the SIM 9000 is sending them. I've encountered users that have had issues where the board does not detect the messages that are sent to them. It was because the bus waits for these signals to know that the message has finished and when they don't arrive, the board can't detect the messages.

 

 

Let me know.

 

Pedro M.
AGarc24
Beginner
57 Views

yes. i tried taking off the sim900 and setting a loop between tx and rx, that works perfectly, so i think the problem might be in the set up of the sim; but i don't know how can i check if the sim900 is sending any data without seeing in the intel galileo

idata
Community Manager
57 Views

In order to check this, you'll need access to a logic analyzer or an oscilloscope. These tools are used to check the actual signals sent from the board or the SIM module.

 

 

In case you don't have access to one of these tools, are you able to test the board with a different board (such as an Arduino)?

 

 

Let me know.

 

Pedro M.
AGarc24
Beginner
57 Views

i finally did it, the terminals rx and tx in the module were inverted, i connect them with a jumper to the galileo and it start working, now i can receive data from the module, but i receive an hex code "bfe98441" always changing except for the to characters "bf" when i send the command "AT", is this have something to do with the baud rate?

idata
Community Manager
57 Views

Perhaps, what is the baud rate of the GPRS module? What is the baud rate set in your Galileo?

 

 

Pedro M.
AGarc24
Beginner
57 Views

115200 in both and if i change the baud rate the answer from the gsm module stops. perhaps it could be the set up of the port? i mean, parity bits, stop bit and that stuff

idata
Community Manager
57 Views

That would also depend on what the GPRS module needs as the Galileo is just reading when receiving those messages. Is any specific configurations mentioned in the module's documentation?

 

 

Pedro M.
AGarc24
Beginner
57 Views

yes, parity none, stop bits 1 and data bits 8, but i've an update, when i tried connecting the sim directly to my laptop, i receive 0x00 in hex, so i think the problem have to be in the reading, can u please give me some light on it?

idata
Community Manager
57 Views

It is a little bit difficult to provide you accurate suggestions as I don't have access to one of these devices. If we had an extract of the signals sent from and to the device taken with a logic analyzer we might be able to determine if the signal from the Galileo is being too low or too fast, if the carriage return and new line signals are being sent.

 

 

Right now, my best suggestion is that you make sure that you are setting up the baud rate on Galileo correctly and if you continue to have issues, contact your device's manufacturer for further help.

 

 

Pedro M.
Reply