Git Product home page Git Product logo

gprs_sim900's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gprs_sim900's Issues

GPRS_SIM900 isCallActive() troubleshooting

In my program, when the shield gets an incoming call it should answer and listen to the microphone until the other side hangs up.
I think this is the way doing it, but it's not working. Statement never gets true.
Can anybody tell me why?

`......
gprs.answer();
char *cid=NULL
while (gprs.isCallActive(cid))
{
// do nothing
// stay inside loop & listen to microphone until caller hangs up
}

gprs.hangup();
....`
I

can't gprs.print ?

help me sir

#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

#define PIN_TX    7
#define PIN_RX    8
//make sure that the baud rate of SIM900 is 9600!
//you can use the AT Command(AT+IPR=9600) to set it through SerialDebug
#define BAUDRATE  9600

char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\n";
char buffer[512];
GPRS gprs(PIN_TX, PIN_RX, BAUDRATE);
void setup(){
  Serial.begin(9600);
  // use DHCP
  while(!gprs.init()) {
      delay(1000);
      Serial.print("init error\r\n");
  }
  delay(3000);    
  // attempt DHCP
  while(!gprs.join(F("cmnet"))) {
      Serial.println("gprs join network error");
      delay(2000);
  }

  // successful DHCP
  Serial.print("IP Address is ");
  Serial.println(gprs.getIPAddress());

  if(!gprs.connect(TCP,"mbed.org", 80)) {
      Serial.println("connect error");
  }else{
      Serial.println("connect mbed.org success");
  }

  Serial.println("waiting to fetch...");
  gprs.println("AT+CIPSEND");
  gprs.print(fix.latitude());
  gprs.print(F(","));
  gprs.print(fix.latitude());
  gprs.print(F(","));
  fix.longitudeDMS.printDDDMMmmmm(gprs);
  sim900_send_byte(0x1A);
//  gprs.send(http_cmd, sizeof(http_cmd)-1);
//  while (true) {
//      int ret = gprs.recv(buffer, sizeof(buffer)-1);
//      if (ret <= 0){
//          Serial.println("fetch over...");
//          break; 
//      }
//      buffer[ret] = '\0';
//      Serial.print("Recv: ");
//      Serial.print(ret);
//      Serial.print(" bytes: ");
//      Serial.println(buffer);
//  }
  gprs.close();
  gprs.disconnect();
}

void loop(){

}

sendSms

Hi,
I noticed that sendSms returns sometimes true even if its get a OK from the sim900 chip (i checked the serial). I tried to increase the timeout from 5 Seconds to 10 and for interchar from 3000 to 6000.It only happens when i send multiple sms. Any guess?

data transmission stops after few days

Hello all,
i am using an arduino uno an a sim 900 modul, for sending water level to ThingSpeak. But after a few days of perfect data connection, it stops working. After reconnecting the power supply it starts again.

I think the network connection ist being lost and because of this the Arduino cannot send data any more. How can i check if the connection is still doning fine, in the loop. And maybe start reconnection again?

Thanks

//Einbindung der erforderlichen Bibliotheken
#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>

//Pins und Geschwindigkeit der Verbindungs-
//Kommunikation mit der SIM900 - Modul
//Serielle Verbindung, TX und RX PINS 7 und 8
//Power on Pin 9, Einschalten des Sim Moduls
#define pinTX 7
#define pinRX 8
#define pinPower 9
#define BaudrateSim 9600

//Paramenter fuer die Verbindung zu Thingspeak
//Setze den Namen des Servers, mit dem wir uns verbinden wollen
char gprsServer[] = "api.thingspeak.com";
//Setze Speicher-API für ThingSpeak
String API = "VZZ****";
//Die Variable, die verwendet wird, um die Boolean Server Response Dump- Anweisung auszuloesen
boolean vypis = 0;

//Initialisierung des SIM900-Moduls aus der GPRS- Bibliothek
GPRS sim900(pinTX, pinRX, BaudrateSim);

//Variablen initailisieren
int pegel = 0.0;

//Setup wird nur einmal durchlaufen
void setup() {

// Kommunikation über die serielle Leitung initiieren
Serial.begin(9600);

// die Stromversorgung des SIM900-Moduls überprüfen, wenn das Modul ausgeschaltet ist
if (!sim900.checkPowerUp()) {
sim900.powerUpDown(pinPower);
}
// Warten zum Initialisieren des SIM-Moduls
while (!sim900.init()) {
Serial.println( "Initialisierungsfehler!" );
delay(4000);

// Zusaetzliche Prüfung ob Sim-Modul eingeschaltet ist,
// falls Arduino Stromversorgung vor der des Sim-Moduls einschaltet
    if (!sim900.checkPowerUp()) {
    sim900.powerUpDown(pinPower);
  } 

}
delay(15000);
Serial.println("Initialisierung erfolgreich");
Serial.println("");

//Zugangsdaten für Internetverbindung, abhaenig vom Provider
//Siehe: https://praxistipps.chip.de/apn-einstellungen-mobiles-internet-richtig-einrichten_46068
//Standardparameter ist der APN-Name, der zweite Anmeldename und das dritte Kennwort
//("")bedeutet dieses Feld bleibt leer
//Beispiel: sim900.join (F ("apn"), F ( "user"), F ( "Passwort"))

//Für Vodafone
while (!sim900.join(F("web.vodafone.de"),F(""),F(""))) {

Serial.println("Fehler beim Verbinden mit GPRS!");
Serial.println("");
Serial.println("Starte SIM Modul neu!");

    // Modul neustarten wenn Verbindung scheitert
    // Modul ausschalten
    digitalWrite(9, HIGH);
    delay(3000);
    digitalWrite(9, LOW);
    delay(3000);
    //Modul einschalten
    digitalWrite(9, HIGH);
    delay(3000);

Serial.println("SIM Modul neugestartet!");
delay(20000);
}

// Die zugewiesene oeffentliche IP Adresse abrufen
Serial.print("Oeffentliche IP Adresse: ");
Serial.println(sim900.getIPAddress());
}

//Programmschleife
void loop() {

// TCP - Verbindung zu einem definierten Server auf Port 80,
// wenn ein Problem auftritt, Fehlermeldung über die serielle Leitung
// und nach einer Pause 2 Sekunden versuchen , die Verbindung wieder aufzubauen
if (!sim900.connect(TCP, gprsServer, 80)) {
Serial.println("Fehler bei TCP - Verbindung");
delay(2000);
}
// Bei erfolgreicher Verbindung folgende Meldung
else {
Serial.print("Verbindung mit dem Server " );
Serial.print(gprsServer);
Serial.println(" gelungen!");
Serial.println("");

// Nachricht für Thingspeak erstellen    
//h0 = Hoehe Beckenboden bis Sensorkopf
float h0 = 3.95;
//Analogeingang einlesen
int pegel = analogRead(A1);
Serial.println(pegel);
//Messhoehe (Sensorkopf bis Wasseroberflaeche) aus 0-5V Eingangssignal 
//Umrechnungsfaktor ADC = 5m/1023
//+0,35m für Blindzone Sensor
float hmess = ((pegel*0.004887585)+0.35); 
Serial.println(hmess);
//Messhoehe - absoluten Sensorhoehe, um Wasserstand zu erhalten
float hwasser = (h0 - hmess); 
//Korrekturfaktor nach manueller Messung
hwasser = hwasser + 0.06;
Serial.println("Berechneter Pegel:");
Serial.println(hwasser);
float fuellstand = ((hwasser/3.2)*100);
Serial.println("Berechneter Fuellstand [%]:");
Serial.println(fuellstand);

// Erstellen Sie eine gesamte Nachricht, die gesendet werden soll. 
String str = "GET /update?api_key=";
str += API;
str += "&field1=";
str += hwasser;
str += "&field2=";
str += fuellstand;
str += " HTTP/1.0\r\n\r\n";
// Erstelle ein Zeichenfeld der Groesse 
// Nachricht + 1, um alle Zeichen 
char strChar[str.length() + 1];
// Konvertiere eine Nachricht von String in das richtige Groessenfeld 
str.toCharArray(strChar, str.length() + 1);
// Die erstellte Nachricht über die TCP-Verbindung senden
sim900.send(strChar, str.length());
// in der Schleife, während wir die gesamte Antwort abrufen, 
// vom Server, wenn der Daten-Dump aktiviert ist 
// empfangene Nachricht nach der seriellen Leitung 
char Antwort[512];
while (true) {
// Erstelle ein Zeichenfeld der Groesse 
// Nachricht + 1, um alle Zeichen
  int Zeichen = sim900.recv(Antwort, sizeof(Antwort) - 1);
// Konvertiere eine Nachricht von String in das richtige Groessenfeld
  if (Zeichen <= 0) {
    if (vypis) {
      Serial.println("-> Ende der Antwort.");
    }
    break;
  }
  Antwort[Zeichen] = '\0';
  if (vypis) {
    Serial.print("Received: ");
    Serial.print(Zeichen);
    Serial.print( "byte: " );
    Serial.println(Antwort);
  }
}
// Aktuelle Verbindung beenden und TCP Sim900 trennen
sim900.close();
sim900.disconnect();
Serial.println( "-> Verbindung der Datenverbindung trennen ." );
Serial.println(""); 

// pausiert , bevor die neuen Daten zu senden an Thingspeak 
// erforderlich , minimale Verzögerung von 15 Sekunden bei kostenloser Nutzung 
Serial.println("Pause 30s");
Serial.println("");
delay(30000);

}
}

GPRS_SIM900 won't compile on Seeeduino MEGA.

Hello everybody...

Can't compile library on Seeeduino MEGA
I always get the same error message.
On Seeeduino V.4.2 it works fine....Everything ok.
Anybody knows whats happening here?
It's supposed to work on MEGAs

Error Message:
Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\arduino-1.6.6\arduino-builder -dump-prefs -logger=machine -hardware "C:\arduino-1.6.6\hardware" -tools "C:\arduino-1.6.6\tools-builder" -tools "C:\arduino-1.6.6\hardware\tools\avr" -built-in-libraries "C:\arduino-1.6.6\libraries" -libraries "C:\Users\nexus\Documents\Arduino\libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10606 -build-path "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\nexus\AppData\Local\Temp\arduino_d484ab6bf6d6f33c478d8d4c8bc793bb\sketch_sep21b.ino"
C:\arduino-1.6.6\arduino-builder -compile -logger=machine -hardware "C:\arduino-1.6.6\hardware" -tools "C:\arduino-1.6.6\tools-builder" -tools "C:\arduino-1.6.6\hardware\tools\avr" -built-in-libraries "C:\arduino-1.6.6\libraries" -libraries "C:\Users\nexus\Documents\Arduino\libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10606 -build-path "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\nexus\AppData\Local\Temp\arduino_d484ab6bf6d6f33c478d8d4c8bc793bb\sketch_sep21b.ino"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900\GPRS_Shield_Arduino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900\sim900.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "C:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino\Suli.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial\SoftwareSerial.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire\Wire.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -M -MG -MP -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire\utility\twi.c"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp"
"C:\arduino-1.6.6\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\preproc\ctags_target.cpp"
"C:\arduino-1.6.6\tools-builder\ctags\5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\preproc\ctags_target.cpp"
"C:\arduino-1.6.6\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\arduino-1.6.6\hardware\arduino\avr\cores\arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\variants\mega" "-IC:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900" "-IC:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial" "-IC:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire" "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp" -o "C:\Users\nexus\AppData\Local\Temp\buildd484ab6bf6d6f33c478d8d4c8bc793bb.tmp\sketch\sketch_sep21b.ino.cpp.o"
In file included from C:\Users\nexus\AppData\Local\Temp\arduino_d484ab6bf6d6f33c478d8d4c8bc793bb\sketch_sep21b.ino:3:0:

C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900/GPRS_Shield_Arduino.h:205:7: error: expected unqualified-id before '/' token

  */        

   ^

C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900/GPRS_Shield_Arduino.h:205:6: error: expected ';' at end of member declaration

  */        

  ^

C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900/GPRS_Shield_Arduino.h:205:7: error: expected unqualified-id before '/' token

  */        

   ^

Using library GPRS_SIM900 in folder: C:\Users\nexus\Documents\Arduino\libraries\GPRS_SIM900 (legacy)
Using library Suli_Arduino in folder: C:\Users\nexus\Documents\Arduino\libraries\Suli_Arduino (legacy)
Using library SoftwareSerial at version 1.0 in folder: C:\arduino-1.6.6\hardware\arduino\avr\libraries\SoftwareSerial
Using library Wire at version 1.0 in folder: C:\arduino-1.6.6\hardware\arduino\avr\libraries\Wire
exit status 1
Error compiling.

send SMS method return is still false

Hello...
In #line39 of SIM900.h I changed DEFAULT_INTERCHAR_TIMEOUT to 5000 or 10000
but it still doesn't work...return is always false, even if SMS is not sent.
does anyone knows why?

gprs.SEND() for Post and Put Link Website upload some data variable

Dear Admin,
i hope you can give me refrence for this
i've done with manually type that link in my browser web and it's working fine (can input php variable)
but i test use POST or PUT im arduino code , it's not working T_T
i hope you can explain or give me a some code
thx before , i hope you can help me, its important for me
[example.com/index.php?visor=false&latitude=-6.342597&longitude=107.155583]

#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#define PIN_TX 7
#define PIN_RX 8
//make sure that the baud rate of SIM900 is 9600!
//you can use the AT Command(AT+IPR=9600) to set it through SerialDebug
#define BAUDRATE 9600
//example.com/index.php?visor=false&latitude=-6.342597&longitude=107.155583
char http_cmd[100];
char buffer[512];
float long2 = 106.880715;
float lat2 = -6.120140;
char latstr[40];
char longstr[40];
GPRS gprs(PIN_TX, PIN_RX, BAUDRATE);
void setup(){
Serial.begin(9600);
dtostrf(lat2,7,6,latstr);
dtostrf(long2,9,6,longstr);
sprintf(http_cmd,"GET visor=false&latitude=%s&longitude=%s HTTP/1.0\r\n\r\n",latstr,longstr);
// use DHCP
while(!gprs.init()) {
delay(1000);
Serial.print("init error\r\n");
}
delay(3000); 
// attempt DHCP

while(!gprs.join(F("internet"),F("internet"),F("internet"))) {
Serial.println("gprs join network error");
delay(2000);
}
// successful DHCP
Serial.print("IP Address is ");
Serial.println(gprs.getIPAddress());
if(!gprs.connect(TCP,"example.com/index.php?", 80)) {
Serial.println("connect error");
}else{
Serial.println("connect example.com success");
}
Serial.println("waiting to fetch...");
gprs.send(http_cmd, sizeof(http_cmd)-1);
while (true) {
int ret = gprs.recv(buffer, sizeof(buffer)-1);
if (ret <= 0){
Serial.println("fetch over...");
break; 
}
buffer[ret] = '\0';
Serial.print("Recv: ");
Serial.print(ret);
Serial.print(" bytes: ");
Serial.println(buffer);
}
Serial.print(http_cmd);
gprs.close();
gprs.disconnect();
}
void loop(){
}

Connect Error

I have tested all other funcationality they work fine but when trying to connect to gprs services its returning connect error and then fetch over message.
I guess I am misssing something APN setting or something like that.
I didn't find any method to APN though in the Source Code though.


#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

#define PIN_TX    2
#define PIN_RX    3
//make sure that the baud rate of SIM900 is 9600!
//you can use the AT Command(AT+IPR=9600) to set it through SerialDebug
#define BAUDRATE  9600

char http_cmd[] = "GET /hello.txt HTTP/1.0\r\n\r\n";
char buffer[512];
GPRS gprs(PIN_TX, PIN_RX, BAUDRATE);
void setup(){
  gprs.checkPowerUp();
  Serial.begin(9600);
  Serial.print("Start TCP demostration...\r\n");

  // use DHCP
  while(!gprs.init()) {
      delay(1000);
      Serial.print("Initializing...\r\n");
  }
  
  while(!gprs.isNetworkRegistered())
  {
    delay(1000);
    Serial.println("Network has not registered yet!");
  }

  delay(3000);    
  // attempt DHCP
  while(!gprs.join(F("cmnet"))) {
      Serial.println("gprs join network error");
      delay(2000);
  }

  // successful DHCP
  Serial.print("IP Address is ");
  Serial.println(gprs.getIPAddress());

  if(!gprs.connect(TCP,"hpledmis.com", 80)) {
      Serial.println("connect error");
  }else{
      Serial.println("connect mbed.org success");
  }

  Serial.println("waiting to fetch...");
  gprs.send(http_cmd, sizeof(http_cmd)-1);
  while (true) {
      int ret = gprs.recv(buffer, sizeof(buffer)-1);
      if (ret <= 0){
          Serial.println("fetch over...");
          break; 
      }
      buffer[ret] = '\0';
      Serial.print("Recv: ");
      Serial.print(ret);
      Serial.print(" bytes: ");
      Serial.println(buffer);
  }
  gprs.close();
  gprs.disconnect();
}

void loop(){

}

HTTP Post

This is not an error, it's a question ...
Does anyone have any idea how I could use the library to send a POST request with some parameters?

getSignalStrength not working give ever noting back

Hello the function getSignalStrength not working give ever 0 back... (and yes i have rssi 18-20 when i direct ask the module)

struct WorkStruct
{
    char phone[16];
    char datetime[24];
    char gprsBuffer[64];
    char message[50];
    float temp;
    float hum;
    int oled_modus;
    int signal_level;
} Work;

  bool ok = gsm.getSignalStrength(Work.signal_level);
  Serial.println("QQ"); 
  Serial.println(ok); 
  Serial.println(Work.signal_level); 

Thanks for helping

Reason for checkSIMStatus being private

Hi,
is there a reason why the checkSIMStatus methode is private to the GPRS class?
One use case for this function in user code would be to test on startup if the sim is READY and if not try to unlock the sim.

get rid of error from AT+CMGF=1

When calling init() the first time the AT+CMGF=1 command always returns an ERROR. The second attempt is working. I'm using SIM800L.
1 Does anyone else experience this?
2 It seems like this command works only after the module put these lines on the serial:
+CPIN: READY
Call Ready
SMS Ready
So I thought of waiting for "SMS Ready" to arrive before issuing the AT+CMGF=1 command. As the manual does not say anything about "SMS Ready", I'm not sure if this is reliable. What do you think?
Edit: I just tried using AT+CFUN?, but this does not work since this command always returns 1 after setting AT+CFUN=1.

Toggle pin by sms

Hi. I could not find a forum for this library.
Can you please add example or comment how to switch a pin based on sms received?
Example. Pin/password Relay1 On. (1234 Relay1 On).
If pin is match then switch on relay1.
This would be very helpfull.

signal strength

getSignalStrength(buffer) command is returning a 0 value despite a return of 15 from the AT+CSQ when manually entered

Loop handle example

Checking if there is unread sms messages takes about 133ms.
Checking isReadable is much faster, but it never cathes sms messages. It only works when incomming call.

In the example there is call and sms function so I assume the idea was to catch sms message aswell.

What other fast way is there to check for new sms mesage?

Problem Uploading on Seeeduino Mega

Hello all
The following code cannot be uploaded on Mega. Uploading process sticks unless the last two lines of code are commented.
Can anybody help on this?
I tried it on Stalker and uploading process works fine.
Also,
...sendSMS() method should return false on success and true on error....but its always true, even if sms is not sent.

#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>
#define PHONE_NUMBER "+xxxxxx83314"
#define MESSAGE "Testing..."
GPRS gprsTest(10,8,19200);//RX,TX,BaudRate connected on Seeeduino Mega
void setup()
{ Serial.begin(19200);
while (!Serial.available()) {Serial.println ("press key...");}
if (!gprsTest.checkPowerUp())
{gprsTest.powerUpDown(9);} //POWER UP shield
while(!gprsTest.init())
{Serial.print("init error\r\n");
delay(1000);}
Serial.println("init success");
Serial.println("start to send message ...");
if (!gprsTest.sendSMS(PHONE_NUMBER,MESSAGE)) //define phone number and text
{Serial.println("SMS send OK"); }
// else //<<<<
// {Serial.println("ERROR SENDING SMS!!!"); } //<<<<
}

void loop() {}

How to join Zoom meeting

Hello,
Thanks for the library for the SIM900.
But I have a question and I hope you can help me.
I want to join a meeting at Zoom (https://zoom.us/) via the SIM900.
To do this I have to enter (paste) the following (in Android phone) to automatically call:

Phone Number+Pause(2 seconds)+MeetingID+#+Pause(4 seconds)+HostID+#+Pause(4 seconds)+Password+#
(MeetingID and Password as an example)
+31207946519,,83411719839#,,,,#,,,,*999999#

gprs.callUp(PHONE_NUMBER) does not connect.
Only accepts a phone number.

Any idea how I get that to work?
Thank you very much for the effort.
Sincerely,
Arie van den Berg

Can't use sendUSSDSynchronous

Hello,

I'm trying to use the sendUSSDSynchronous function to check the balance available on a SIM. Do you happen to have an example of how I might use this?

I'm a bit new to this whole thing, but this is what I'm trying:
gprs.sendUSSDSynchronous("*100#")
My assumption is I'm missing the other 2 parameters: char *resultcode + char *response

Thanks for any help!

Low memory on Atmega328P

Hi, loaded an example GPRS_TCPConnection and for Atmega328P got this warning:
Global variables use 1,816 bytes (88%) of dynamic memory, leaving 232 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur.

So i can't use other libraries due to low memory issue...

Can i change char buffer[512]; for example to char buffer[64]; ? Will it work ok?
With char buffer[64]; i got 66% of usage... but it still a lot of, what else i can change in library?

Altsoftserial change

Hi. I replaced all refrences from softwareserial to altsoftserial. Connected rx and tx as described in altsoftserial.
I am not getting ok response.
What exactly do I need to change to use altsoftserial?

readSMS example

i'm currently working on GSM900A with your library. all the keywords are working well. but example of readSMS is not working. pls help. it's very urgent.

Serial Monitor error when sending long messages

Hello,
I have tried the GPRS_SendSMS example and everything is fine when I send short messages. But when the message is longer than 30 chars, the serial monitor shows "Send SMS failed!" even f the SMS is sent and delivered correctly, not trunked.

Error while interfacing with mega

Im trying to use GSM 900A module ( not shield) with arduino mega. I have changed RX and TX pins accordingly to 10 and 11 but I'm always getting same error message on COM port "init error". When i used with normal AT commands it worked very well but now with library its not working.

Using with SIM800H

Hello, just one question: it's possibile to use this library to send/receive sms and to send/receive calls with SIM800H shield?
Many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.