You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
12 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
6 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
6 years ago
8 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
7 years ago
6 years ago
5 years ago
5 years ago
8 years ago
7 years ago
6 years ago
7 years ago
7 years ago
6 years ago
6 years ago
8 years ago
8 years ago
6 years ago
5 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
6 years ago
7 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
6 years ago
6 years ago
8 years ago
6 years ago
6 years ago
8 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
7 years ago
8 years ago
6 years ago
7 years ago
6 years ago
7 years ago
8 years ago
6 years ago
7 years ago
8 years ago
8 years ago
6 years ago
8 years ago
8 years ago
6 years ago
8 years ago
6 years ago
8 years ago
7 years ago
7 years ago
7 years ago
  1. ![TinyGSM logo](https://cdn.rawgit.com/vshymanskyy/TinyGSM/d18e93dc51fe988a0b175aac647185457ef640b5/extras/logo.svg)
  2. A small Arduino library for GSM modules, that just works.
  3. <!---
  4. [![GitHub download](https://img.shields.io/github/downloads/vshymanskyy/TinyGSM/total.svg)](https://github.com/vshymanskyy/TinyGSM/releases/latest)--->
  5. [![GitHub version](https://img.shields.io/github/release/vshymanskyy/TinyGSM.svg)](https://github.com/vshymanskyy/TinyGSM/releases/latest)
  6. [![Build status](https://img.shields.io/travis/vshymanskyy/TinyGSM.svg)](https://travis-ci.org/vshymanskyy/TinyGSM)
  7. [![GitHub issues](https://img.shields.io/github/issues/vshymanskyy/TinyGSM.svg)](https://github.com/vshymanskyy/TinyGSM/issues)
  8. [![GitHub wiki](https://img.shields.io/badge/Wiki-available-brightgreen.svg)](https://github.com/vshymanskyy/TinyGSM/wiki)
  9. [![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg)](https://github.com/vshymanskyy/TinyGSM/stargazers)
  10. [![License](https://img.shields.io/badge/license-LGPL3-blue.svg)](https://github.com/vshymanskyy/TinyGSM/blob/master/LICENSE)
  11. If you like **TinyGSM** - give it a star, or fork it and contribute!
  12. [![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/TinyGSM.svg?style=social&label=Star)](https://github.com/vshymanskyy/TinyGSM/stargazers)
  13. [![GitHub forks](https://img.shields.io/github/forks/vshymanskyy/TinyGSM.svg?style=social&label=Fork)](https://github.com/vshymanskyy/TinyGSM/network)
  14. You can also join our chat:
  15. [![Gitter](https://img.shields.io/gitter/room/vshymanskyy/TinyGSM.svg)](https://gitter.im/tinygsm)
  16. ### Arduino Client interface support
  17. This library is easy to integrate with lots of sketches which use Ethernet or WiFi.
  18. **PubSubClient ([MQTT](http://mqtt.org/))**, **[Blynk](http://blynk.cc)**, **HTTP Client** and **File Download** examples are provided.
  19. ![examples](/extras/examples.png)
  20. ### TinyGSM is tiny
  21. The complete WebClient example for Arduino Uno (via Software Serial) takes little resources:
  22. ```
  23. Sketch uses 15022 bytes (46%) of program storage space. Maximum is 32256 bytes.
  24. Global variables use 574 bytes (28%) of dynamic memory, leaving 1474 bytes for local variables. Maximum is 2048 bytes.
  25. ```
  26. Arduino GSM library uses 15868 bytes (49%) of Flash and 1113 bytes (54%) of RAM in a similar scenario.
  27. TinyGSM also pulls data gently from the modem (whenever possible), so it can operate on very little RAM.
  28. **Now, you have more space for your experiments.**
  29. ## Features
  30. Feature \ Modem | SIM8xx | u-Blox | A6/A7/A20 | Neoway M590| ESP8266 |Digi XBee|Quectel BG96|Quectel M95|Quectel MC60(E)| SIM7000 | Monarch |
  31. --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
  32. **Data connections**
  33. TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
  34. UDP | ◌ | ◌ | | | | ◌ | ◌ | | | ◌ | ◌ |
  35. SSL/TLS (HTTPS) | ✔¹ | ✔ | x | x | ✔ | ✔ | ◌ | | | ◌ | ✔ |
  36. **USSD**
  37. Sending USSD requests | ✔ | | ✔ | ✔ | x | | | | | ✔ | |
  38. Decoding 7,8,16-bit response | ✔ | | ✔ | ✔ | x | | | | | ✔ | |
  39. **SMS**
  40. Sending | ✔ | ✔ | ✔ | ✔ | x | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
  41. Sending Unicode | ✔ | | ◌ | x | x | | ✔ | ✔ | ✔ | ✔ | |
  42. Reading | | | | | x | | | | | | |
  43. Incoming message event | | | | ? | x | | | | | | |
  44. **Calls**
  45. Dial, hangup | ✔ | | ✔ | x | x | x | | | | | |
  46. Receiving calls | ✔ | | ✔ | x | x | x | | | | | |
  47. Incoming event (RING) | ◌ | | ◌ | x | x | x | | | | | |
  48. DTMF sending | ✔ | | ✔ | x | x | x | | | | | |
  49. DTMF decoding | ◌ | | x | x | x | x | | | | | |
  50. **Location**
  51. GSM location service | ✔ | ✔ | x | x | x | x | | x | ✔ | ✔ | x |
  52. GPS/GNSS | ✔¹ | x | ◌¹ | x | x | x | | x | | ✔ | x |
  53. **Credits**
  54. Primary Author/Contributor |[vshymanskyy](https://github.com/vshymanskyy)|[vshymanskyy](https://github.com/vshymanskyy)|[vshymanskyy](https://github.com/vshymanskyy)|[vshymanskyy](https://github.com/vshymanskyy)|[vshymanskyy](https://github.com/vshymanskyy)|[SRGDamia1](https://github.com/SRGDamia1/)|[vshymanskyy](https://github.com/vshymanskyy) |[replicadeltd](https://github.com/replicadeltd)|[V1pr](https://github.com/V1pr)|[captFuture](https://github.com/captFuture/)|[nootropicdesign](https://github.com/nootropicdesign/)|
  55. ✔ - implemented  ◌ - planned  x - not available on this modem
  56. ¹ - only some device models or firmware revisions have this feature (SIM8xx R14.18, A7, etc.)
  57. ## Supported modems
  58. - SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
  59. - SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
  60. - AI-Thinker A6, A6C, A7, A20
  61. - ESP8266 (AT commands interface, similar to GSM modems)
  62. - Digi XBee WiFi and Cellular (using XBee command mode)
  63. - Neoway M590
  64. - u-blox Cellular Modems (many modules including LEON-G100, LISA-U2xx, SARA-G3xx, SARA-U2xx, TOBY-L2xx, LARA-R2xx, MPCI-L2xx, SARA-R4xx, SARA-N4xx, _but NOT SARA-N2xx_)
  65. - Sequans Monarch LTE Cat M1/NB1
  66. - Quectel BG96
  67. - Quectel M95
  68. - Quectel MC60 ***(alpha)***
  69. - SIMCom SIM7000 ***(alpha)***
  70. ### Supported boards/modules
  71. - Arduino MKR GSM 1400
  72. - GPRSbee
  73. - Microduino GSM
  74. - Adafruit FONA (Mini Cellular GSM Breakout)
  75. - Adafruit FONA 800/808 Shield
  76. - Industruino GSM
  77. - RAK WisLTE ***(alpha)***
  78. - ... other modules, based on supported modems. Some boards require [**special configuration**](https://github.com/vshymanskyy/TinyGSM/wiki/Board-configuration).
  79. More modems may be supported later:
  80. - [ ] Quectel M10, UG95
  81. - [ ] SIMCom SIM5320, SIM5360, SIM5216
  82. - [ ] SIMCom SIM7020, SIM7100
  83. - [ ] Telit GL865
  84. - [ ] ZTE MG2639
  85. - [ ] Hi-Link HLK-RM04
  86. Watch this repo for new updates! And of course, contributions are welcome ;)
  87. ## Donation
  88. [![Donate BountySource](https://img.shields.io/badge/Donate-BountySource-149E5E.svg)](https://salt.bountysource.com/checkout/amount?team=tinygsm-dev)
  89. [![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](http://tny.im/aen)
  90. If you have found TinyGSM to be useful in your work, research or company, please consider making a donation to the project commensurate with your resources. Any amount helps!
  91. **All donations will be used strictly to fund the development of TinyGSM:**
  92. - Covering cellular network expenses
  93. - Buying new hardware and modems for integration
  94. - Bounty Budget (to reward other developers for their contributions)
  95. - Implementing new features
  96. - Quality Assurance
  97. ## Getting Started
  98. 1. Using your phone:
  99. - Disable PIN code on the SIM card
  100. - Check your balance
  101. - Check that APN, User, Pass are correct and you have internet
  102. 2. Ensure the SIM card is correctly inserted into the module
  103. 3. Ensure that GSM antenna is firmly attached
  104. 4. Check if serial connection is working (Hardware Serial is recommended)
  105. Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino)
  106. If you have any issues:
  107. 1. Read the whole README (you're looking at it!)
  108. 2. Some boards require [**special configuration**](https://github.com/vshymanskyy/TinyGSM/wiki/Board-configuration).
  109. 3. Try running the Diagnostics sketch
  110. 4. Check for [**highlighted topics here**](https://github.com/vshymanskyy/TinyGSM/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22for+reference%22+)
  111. 5. If you have a question, please post it in our [Gitter chat](https://gitter.im/tinygsm)
  112. ## How does it work?
  113. Many GSM modems, WiFi and radio modules can be controlled by sending AT commands over Serial.
  114. TinyGSM knows which commands to send, and how to handle AT responses, and wraps that into standard Arduino Client interface.
  115. ## API Reference
  116. For GPRS data streams, this library provides the standard [Arduino Client](https://www.arduino.cc/en/Reference/ClientConstructor) interface.
  117. For additional functions, please refer to [this example sketch](examples/AllFunctions/AllFunctions.ino)
  118. ## Troubleshooting
  119. ### Diagnostics sketch
  120. Use this sketch to diagnose your SIM card and GPRS connection:
  121. File -> Examples -> TinyGSM -> tools -> [Diagnostics](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/Diagnostics/Diagnostics.ino)
  122. ### Ensure stable data & power connection
  123. Most modules require up to 2A and specific voltage - according to the module documentation.
  124. So this actually solves stability problems in **many** cases:
  125. - Provide a good stable power supply. Read about [**powering your module**](https://github.com/vshymanskyy/TinyGSM/wiki/Powering-GSM-module).
  126. - Keep your wires as short as possible
  127. - Consider soldering them for a stable connection
  128. - Do not put your wires next to noisy signal sources (buck converters, antennas, oscillators etc.)
  129. ### SoftwareSerial problems
  130. When using ```SoftwareSerial``` (on Uno, Nano, etc), the speed **115200** may not work.
  131. Try selecting **57600**, **38400**, or even lower - the one that works best for you.
  132. In some cases **9600** is unstable, but using **38400** helps, etc.
  133. Be sure to set correct TX/RX pins in the sketch. Please note that not every Arduino pin can serve as TX or RX pin.
  134. **Read more about SoftSerial options and configuration [here](https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html) and [here](https://www.arduino.cc/en/Reference/SoftwareSerial).**
  135. ### ESP32 HardwareSerial
  136. When using ESP32 `HardwareSerial`, you may need to specify additional parameters to the `.begin()` call.
  137. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/91#issuecomment-356024747).
  138. ### SAMD21
  139. When using SAMD21-based boards, you may need to use a sercom uart port instead of `Serial1`.
  140. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/102#issuecomment-345548941).
  141. ### Broken initial configuration
  142. Sometimes (especially if you played with AT commands), your module configuration may become invalid.
  143. This may result in problems such as:
  144. * Can't connect to the GPRS network
  145. * Can't connect to the server
  146. * Sent/received data contains invalid bytes
  147. * etc.
  148. To return module to **Factory Defaults**, use this sketch:
  149. File -> Examples -> TinyGSM -> tools -> [FactoryReset](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/FactoryReset/FactoryReset.ino)
  150. ### Goouuu Tech IOT-GA6 vs AI-Thinker A6 confusion
  151. It turns out that **Goouuu Tech IOT-GA6** is not the same as **AI-Thinker A6**. Unfortunately IOT-GA6 is not supported out of the box yet. There are some hints that IOT-GA6 firmware may be updated to match A6... See [this topic](https://github.com/vshymanskyy/TinyGSM/issues/164).
  152. __________
  153. ### License
  154. This project is released under
  155. The GNU Lesser General Public License (LGPL-3.0)