Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: 3g module
PostPosted: Thu Apr 04, 2019 6:24 am 

Joined: Thu Apr 04, 2019 6:19 am
Posts: 3
Hello, I recently purchased the 3G/GPRS shield over Arduino and Raspberry Pi with SIM5215e , I was able to send SMS massages but I can't communicate with a server like your tutorial : How to Upload Data to a Personal Cloud Server (Thingspeak) Using 3G+GPS Mobile Kit, although I created a channel in thingspeak as mentioned. In the code, I wrote the write API write key but didn't know what url to put


Top
 Profile  
 
 Post subject: Re: 3g module
PostPosted: Thu Apr 04, 2019 10:06 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

The url is set in the code.
api.thingspeak.com/update?OUR_KEY=&field1=DATA_1&field2=DATA_2

Code:
    // set the request
    sprintf(aux_str, "GET /update?key=%s&field1=%d&field2=%s HTTP/1.1\r\nHost: api.thingspeak.com\r\nContent-Length: 0\r\n\r\n", APIWriteKey, _light, data)  ;
    Serial.println(aux_str);


The tutorial was created 4-5 yeas ago. Maybe the way to send data to Thingspeak changed. Please check if the way we created the get request is the correct now.

Regards


Top
 Profile  
 
 Post subject: Re: 3g module
PostPosted: Thu Apr 04, 2019 11:30 am 

Joined: Thu Apr 04, 2019 6:19 am
Posts: 3
Thank you for replying
So I tried the new url but I still get : Error waiting for the request. I'm also trying to send an email but it's not working so maybe the sim is not accessing the internet?

For the server, this is how I filled the code:
const char pin_number[] = "0000";
const char apn[] = "zain";
const char user_name[] = "zain";
const char password[] = "zain";

//Write here you Thingspeak data
const char APIWriteKey[] = "1R9Y2YFDOHFK00GA";

char url[ ]= "api.thingspeak.com/update?OUR_KEY=&field1=DATA_1&field2=DATA_2";

For the email, this is how I filled the code:

//Write here you server and account data
const char smtp_server[ ] = "smtp.gmail.com"; // SMTP server
const char smtp_user_name[ ] = "myusername@gmail.com"; // SMTP user name
const char smtp_password[ ] = "my password"; // SMTP password
const char smtp_port[ ] = "465" or "587"; // SMTP server port

//Write here your information about sender, direcctions and names
const char sender_address[ ] = "myusername@gmail.com"; // Sender address
const char sender_name[ ] = "my username"; // Sender name

const char to_address[ ] = "recipient@gmail.com"; // Recipient address
const char to_name[ ] = "recipient"; // Recipient name


Top
 Profile  
 
 Post subject: Re: 3g module
PostPosted: Fri Apr 05, 2019 8:34 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

You don't have to change the url to the one we shared. It won't work. It was a example to see how the url is created.

Did you set the correct apn? Is the pin of the sim card enable? Did you set the pin if it is enabled?

Could you use basic example codes to check if the node connect to the network?

Regards


Top
 Profile  
 
 Post subject: Re: 3g module
PostPosted: Fri Apr 05, 2019 4:14 pm 

Joined: Thu Apr 04, 2019 6:19 am
Posts: 3
Ok, I will check what you told me. What url I should use then?

But I still need some help with programming the module, I'm using the module in a project where the arduino will read a temperature sensor and send the value to a web server by the module.

I'm having a lot of trouble writing the program, could please post a simple example for that or send me any helpful documents ?

Thank you


Top
 Profile  
 
 Post subject: Re: 3g module
PostPosted: Tue Apr 09, 2019 1:24 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

You can find example code in the tutorial website of each device. We don't have additional examples.

We don't know the url you have to use. Please check the documentation from Thingspeak website, they explain how create http requests to send data to its cloud.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.