Uploading via SIM800 GSM module using AT+ commands | Arduino | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Uploading via SIM800 GSM module using AT+ commands
No permission to create posts
March 25, 2018
12:56 pm
Avatar
SailSenseTech
New Member
Members
Forum Posts: 4
Member Since:
November 3, 2017
sp_UserOfflineSmall Offline

Does anyone know what is wrong when I am able to complete a send with SEND OK but the channel is not updated?  My Arduino code is using TCP and is it very simple.  I think I am suppose to get the update number from as feedback but i never get it.  The channelcan be updated using the GET command using POSTMAN and via a browser.  I have run out of ideas.  Do you have any suggestions?

David

 

#include <SoftwareSerial.h>
#define SIM_800_TX 7
#define SIM_800_RX 6

int midZ=2000;//time delays
int minZ=500;
int maxZ=5000;

SoftwareSerial MySerial(SIM_800_RX, SIM_800_TX); // RX, TX

void setup() {

Serial.begin(9600);
while (!Serial);
MySerial.begin(9600);

delay(midZ);

MySerial.println("at+csq");
delay(minZ);
feedback();
MySerial.println("at+cipshut");
delay(minZ);
feedback();

MySerial.println("at+cstt=\"giffgaff.com\",\"giffgaff\",\"\"");
feedback();
MySerial.println("at+ciicr");//start wireless connection cellular network
feedback();
MySerial.println("at+cifsr");//enquire regarding the IP address allocated
feedback();
MySerial.println("at+cipstart=\"TCP\",\"184.106.153.149\",\"80\"");//connect to the ThingSpeak update URL (https://api.thingspeak.com)
feedback();
MySerial.println("at+cipsend=71");//declare the number of bytes (characters) I want to send
feedback();
MySerial.print("GET https://api.thingspeak.com/update?");//this is a constant beginning for the GET command and is as provided by ThingSpeak
feedback();
MySerial.print("api_key=IVEJWZMAPDSP2AXB");//the channel API key provided by ThingSpeak

feedback();
MySerial.print("&field1=");

feedback();
MySerial.println("5");//the value that I want to post to field 1
feedback();
MySerial.println("at+cipack");//ask for acknowledge details

feedback();
MySerial.println("at+cipclose");//close the IP connection
feedback();
}

void loop() {

if (MySerial.available()) {

Serial.write(MySerial.read());
}
if (Serial.available()) {

MySerial.write(Serial.read());
}
}

void feedback() {
delay(midZ);
while (MySerial.available()) {
Serial.write(MySerial.read());
}
}

March 30, 2018
6:49 am
Avatar
SailSenseTech
New Member
Members
Forum Posts: 4
Member Since:
November 3, 2017
sp_UserOfflineSmall Offline

The secret is a double MySerial.println(); after the request string is entered.  This can be added to the end of the string as "

".  If the CIPSEND command is specifying the length of the message this needs to be 4 more than the number of characters in the basic GET /update?key=.... string.

April 23, 2018
4:22 pm
Avatar
KR46
New Member
Members
Forum Posts: 1
Member Since:
April 23, 2018
sp_UserOfflineSmall Offline

Hi SailSense,

I have been struggling with exactly the same problem the past 3 weeks. I receive validation "SEND OK", but the field does not update. USING Postman or browser result in a successful update. Have you managed to sort the coding and update successfully? Would you mind sending me the coding please?

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

briskpanda, Dejw0089, Yassine Ben Salah, anis, 43994554AKS, suda

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457