|
| 1 | +/* |
| 2 | + This library was written by Vittorio Esposito |
| 3 | + https://github.com/VittorioEsposito |
| 4 | +
|
| 5 | + Designed to work with the GSM Sim800L. |
| 6 | +
|
| 7 | + ENG |
| 8 | + This library uses SoftwareSerial, you can define RX and TX pins |
| 9 | + in the header "Sim800L.h", by default pins are RX=10 and TX=11. |
| 10 | + Be sure that GND is connected to arduino too. |
| 11 | + You can also change the RESET_PIN as you prefer. |
| 12 | +
|
| 13 | + ESP |
| 14 | + Esta libreria usa SoftwareSerial, se pueden cambiar los pines de RX y TX |
| 15 | + en el archivo header, "Sim800L.h", por defecto los pines vienen configurado en |
| 16 | + RX=10 TX=11. |
| 17 | + Tambien se puede cambiar el RESET_PIN por otro que prefiera |
| 18 | +
|
| 19 | + ITA |
| 20 | + Questa libreria utilizza la SoftwareSerial, si possono cambiare i pin di RX e TX |
| 21 | + dall' intestazione "Sim800L.h", di default essi sono impostati come RX=10 RX=11 |
| 22 | + Assicurarsi di aver collegato il dispositivo al pin GND di Arduino. |
| 23 | + E' anche possibile cambiare il RESET_PIN. |
| 24 | +
|
| 25 | +
|
| 26 | + DEFAULT PINOUT: |
| 27 | + _____________________________ |
| 28 | + | ARDUINO UNO >>> Sim800L | |
| 29 | + ----------------------------- |
| 30 | + GND >>> GND |
| 31 | + RX 10 >>> TX |
| 32 | + TX 11 >>> RX |
| 33 | + RESET 2 >>> RST |
| 34 | +
|
| 35 | + POWER SOURCE 4.2V >>> VCC |
| 36 | +
|
| 37 | +
|
| 38 | + SOFTWARE SERIAL NOTES: |
| 39 | +
|
| 40 | + PINOUT |
| 41 | + The library has the following known limitations: |
| 42 | + 1. If using multiple software serial ports, only one can receive data at a time. |
| 43 | + 2. Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69). |
| 44 | + 3. Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). |
| 45 | + 4. On Arduino or Genuino 101 the current maximum RX speed is 57600bps |
| 46 | + 5. On Arduino or Genuino 101 RX doesn't work on Pin 13 |
| 47 | +
|
| 48 | + BAUD RATE |
| 49 | + Supported baud rates are 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, and 115200. |
| 50 | +
|
| 51 | +
|
| 52 | + Edited on: December 24, 2016 |
| 53 | + Editor: Vittorio Esposito |
| 54 | +
|
| 55 | + Original version by: Cristian Steib |
| 56 | +
|
| 57 | +
|
| 58 | +*/ |
| 59 | + |
| 60 | +#include <Sim800L.h> |
| 61 | +#include <SoftwareSerial.h> |
| 62 | + |
| 63 | +#define RX 10 |
| 64 | +#define TX 11 |
| 65 | + |
| 66 | +Sim800L GSM(RX, TX); |
| 67 | + |
| 68 | +/* |
| 69 | + In alternative: |
| 70 | + Sim800L GSM; // Use default pinout |
| 71 | + Sim800L GSM(RX, TX, RESET); |
| 72 | + Sim800L GSM(RX, TX, RESET, LED); |
| 73 | +*/ |
| 74 | + |
| 75 | +void setup() { |
| 76 | + Serial.begin(9600); |
| 77 | + GSM.begin(4800); |
| 78 | + |
| 79 | + if (GSM.calculateLocation()) Serial.println("Location Calculated"); |
| 80 | + else Serial.println("Error in calculating location"); |
| 81 | + |
| 82 | + Serial.print("Location Code: "); |
| 83 | + Serial.println(GSM.getLocationCode()); |
| 84 | + |
| 85 | + Serial.print("Longitude: "); |
| 86 | + Serial.println(GSM.getLongitude()); |
| 87 | + |
| 88 | + Serial.print("Longitude: "); |
| 89 | + Serial.println(GSM.getLatitude()); |
| 90 | + |
| 91 | + /* |
| 92 | + Location Code: |
| 93 | + 0 Success |
| 94 | + 404 Not Found |
| 95 | + 408 Request Time-out |
| 96 | + 601 Network Error |
| 97 | + 602 No Memory |
| 98 | + 603 DNS Error |
| 99 | + 604 Stack Busy |
| 100 | + 65535 Other Error |
| 101 | + */ |
| 102 | + |
| 103 | +} |
| 104 | + |
| 105 | +void loop() { |
| 106 | + |
| 107 | +} |
| 108 | + |
0 commit comments