Hallo, melde mich bei euch, da ich das Problem selber nicht lösen kann.
Verwende den Code um den GPS Standort zu senden, nach dem der Schalter betätigt worden ist.
Das SMS wird gesendet mit dem Text der im Code steht nur werden die Koordinaten nicht gesendet. Steht nur:
0°00'00.0"N 0°00'00.0"E
Verwende Adruino Uno und Nano , GY-GPS6MV2 NEO6MV2 NEO-6M GPS Empfänger und SIM800L V2.0 QUAD BAND GSM GPRS MODUL
Alles wird mit 5V Spannung versorgt.
GPS LED blinkt, bekomme im Monitor Daten mit Standort viele Daten.
Ich habe auch die Komponenten einzeln getestet scheint alles zu funktionieren, vielleicht ist der Code falsch für die NEO 6 um die Position zu senden.
Wäre ich dankbar für eure Hilfe, ich habe auch schon andere Code versucht und stecke fest. Bin ziemlich am Anfang mit dem Projekt und will nicht aufgeben .
//Prateek
//www.justdoelectronics.com
#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <Wire.h>
SoftwareSerial Gsm(9, 10); // RX, TX pins for GSM module
char phone_no[] = "+91883058xxxx"; // Put Your phone number
TinyGPS gps;
int buttonState;
unsigned long buttonPressTime;
bool isSMSsent = false;
void setup() {
Serial.begin(9600);
Gsm.begin(9600);
Gsm.print("AT+CMGF=1\r");
delay(100);
Gsm.print("AT+CNMI=2,2,0,0,0\r");
delay(100);
pinMode(5, INPUT_PULLUP);
}
void loop() {
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
for (unsigned long start = millis(); millis() - start < 1000;) {
while (Serial.available()) {
char c = Serial.read();
Serial.print(c); // Output GPS data to the Serial Monitor
if (gps.encode(c))
newData = true; // Check if there is new GPS data
}
}
buttonState = digitalRead(5);
if (buttonState == LOW) { // Button is pressed
if (!isSMSsent) {
buttonPressTime = millis();
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Gsm.print("AT+CMGF=1\r");
delay(400);
Gsm.print("AT+CMGS=\"");
Gsm.print(phone_no);
Gsm.println("\"");
Gsm.println("Alert I Need help...");
Gsm.print("http://maps.google.com/maps?q=loc:");
Gsm.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Gsm.print(",");
Gsm.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
delay(200);
Gsm.println((char)26);
delay(200);
Serial.println("SMS Sent");
isSMSsent = true;
}
} else {
isSMSsent = false;
delay(10);
}
Serial.println(failed);
}