1.2.16. fejezet, SMS küldés, GPRS kommunikáció és GPS logger
Beküldte pzoli - 2017, december 28 - 11:33du
Alkalmazott hardverek
- gprs/gsm shield
- gps-sd shield (leírás)
Projekt forráskódok
- MyGSMCenter Arduino projekt
- MyGSMCenterSwing Java kliens projekt
- MyGSMCenterPythonClient Python kliens projekt
Hasonló projektek
- Guide to SIM900 GSM GPRS Shield with Arduino
- GPRS modul szoftveres bekapcsolása
- Guide to NEO-6M GPS Module with Arduino
- gprs/gsm modul - youtube
- how to interface a gps module
- TinyGPS++
- NMEA üzenetek szerkezete (jó összefoglaló és rövid leírás)
- SIM900 GPRS HTTP AT commands
- Jump to SIM900/SIM800 HTTP POST request
- HTTP post GPRS-en keresztül
- Phone activity status (AT commands)
- GPRS helymeghatározás
- GPRS helymeghatározás hiba(Firmware update)
- Hasznos szolgáltatói kódok
GPS koordináták fogadása
#include <TinyGPS++.h> #include <SoftwareSerial.h> static const int RXPin = 6, TXPin = 7; static const uint32_t GPSBaud = 9600; TinyGPSPlus gps; SoftwareSerial ss(RXPin, TXPin); void setup() { Serial.begin(115200); ss.begin(GPSBaud); } void loop() { while (ss.available() > 0) if (gps.encode(ss.read())) displayInfo(); if (millis() > 5000 && gps.charsProcessed() < 10) { Serial.println(F("No GPS detected: check wiring.")); while(true); } } void displayInfo() { Serial.print(F("Location: ")); if (gps.location.isValid()) { Serial.print(gps.location.lat(), 6); Serial.print(F(",")); Serial.print(gps.location.lng(), 6); } else { Serial.print(F("INVALID")); } Serial.print(F(" Date/Time: ")); if (gps.date.isValid()) { Serial.print(gps.date.month()); Serial.print(F("/")); Serial.print(gps.date.day()); Serial.print(F("/")); Serial.print(gps.date.year()); } else { Serial.print(F("INVALID")); } Serial.print(F(" ")); if (gps.time.isValid()) { if (gps.time.hour() < 10) Serial.print(F("0")); Serial.print(gps.time.hour()); Serial.print(F(":")); if (gps.time.minute() < 10) Serial.print(F("0")); Serial.print(gps.time.minute()); Serial.print(F(":")); if (gps.time.second() < 10) Serial.print(F("0")); Serial.print(gps.time.second()); Serial.print(F(".")); if (gps.time.centisecond() < 10) Serial.print(F("0")); Serial.print(gps.time.centisecond()); } else { Serial.print(F("INVALID")); } Serial.println(); }
SMS küldés
/* use Leonardo or similar that have secondary serial */ void setup() { Serial1.begin(19200); // Give time to your GSM shield log on to network delay(20000); sendSMS(); } void loop() { } void sendSMS() { Serial1.print("AT+CMGF=1\r"); delay(100); Serial1.println("AT + CMGS = \"+36301234567\""); delay(100); Serial1.println("Szia."); delay(100); Serial1.println((char)26); delay(100); Serial1.println(); delay(5000); }
- A hozzászóláshoz be kell jelentkezni