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.

237 lines
11 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
7 years ago
7 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
8 years ago
8 years ago
8 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
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. ## Supported modems
  30. - SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
  31. - SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
  32. - SIMCom WCDMA/HSPA/HSPA+ Modules (SIM5360, SIM5320, SIM5300E, SIM5300EA)
  33. - SIMCom LTE Modules (SIM7100E, SIM7500E, SIM7500A, SIM7600C, SIM7600E)
  34. - SIMCom SIM7000E CAT-M1/NB-IoT Module
  35. - AI-Thinker A6, A6C, A7, A20
  36. - ESP8266 (AT commands interface, similar to GSM modems)
  37. - Digi XBee WiFi and Cellular (using XBee command mode)
  38. - Neoway M590
  39. - u-blox 2G, 3G, 4G, and LTE Cat1 Cellular Modems (many modules including LEON-G100, LISA-U2xx, SARA-G3xx, SARA-U2xx, TOBY-L2xx, LARA-R2xx, MPCI-L2xx)
  40. - u-blox LTE-M Modems (SARA-R4xx, SARA-N4xx, _but NOT SARA-N2xx_)
  41. - Sequans Monarch LTE Cat M1/NB1
  42. - Quectel BG96
  43. - Quectel M95
  44. - Quectel MC60 ***(alpha)***
  45. ### Supported boards/modules
  46. - Arduino MKR GSM 1400
  47. - GPRSbee
  48. - Microduino GSM
  49. - Adafruit FONA (Mini Cellular GSM Breakout)
  50. - Adafruit FONA 800/808 Shield
  51. - Industruino GSM
  52. - RAK WisLTE ***(alpha)***
  53. - ... other modules, based on supported modems. Some boards require [**special configuration**](https://github.com/vshymanskyy/TinyGSM/wiki/Board-configuration).
  54. More modems may be supported later:
  55. - [ ] Quectel M10, UG95
  56. - [ ] SIMCom SIM7020
  57. - [ ] Telit GL865
  58. - [ ] ZTE MG2639
  59. - [ ] Hi-Link HLK-RM04
  60. Watch this repo for new updates! And of course, contributions are welcome ;)
  61. ## Features
  62. **Data connections**
  63. - TCP (HTTP, MQTT, Blynk, ...)
  64. - ALL modules support TCP connections
  65. - UDP
  66. - Not yet supported on any module, though it may be some day
  67. - SSL/TLS (HTTPS)
  68. - Supported on¹:
  69. - SIM800, u-Blox, XBee _cellular_, ESP8266, and Sequans Monarch
  70. ¹ - only some device models or firmware revisions have this feature (SIM8xx R14.18, A7, etc.)
  71. - Not yet supported on:
  72. - Quectel modems, SIM7000, SIM5360/5320/7100/7500/7600
  73. - Not possible on:
  74. - SIM900, A6/A7, M560, XBee _WiFi_
  75. **USSD**
  76. - Sending USSD requests and decoding 7,8,16-bit responses
  77. - Supported on:
  78. - SIM800/SIM900, SIM7000
  79. - Not yet supported on:
  80. - Quectel modems, SIM5360/5320/7100/7500/7600, XBee
  81. **SMS**
  82. - Only _sending_ SMS is supported, not receiving
  83. - Supported on:
  84. - SIM800/SIM900, SIM7000, XBee
  85. - Not yet supported on:
  86. - Quectel modems, SIM5360/5320/7100/7500/7600
  87. **Voice Calls**
  88. - Only Supported on SIM800 and A6/A7/A20
  89. - Dial, hangup
  90. - Receiving calls
  91. - Incoming event (RING)
  92. - DTMF sending
  93. - DTMF decoding
  94. **Location**
  95. - GPS/GNSS
  96. - SIM808 and SIM7000 only
  97. - GSM location service
  98. - SIM800, SIM and SIM7000 only
  99. **Credits**
  100. - Primary Author/Contributor:
  101. - [vshymanskyy](https://github.com/vshymanskyy)
  102. - Digi XBee, editing of all modules:
  103. - [SRGDamia1](https://github.com/SRGDamia1/)
  104. - SIM7000:
  105. - [captFuture](https://github.com/captFuture/)
  106. - Sequans Monarch:
  107. - [nootropicdesign](https://github.com/nootropicdesign/)
  108. - Quectel M9C60
  109. - [V1pr](https://github.com/V1pr)
  110. - Quectel M95
  111. - [replicadeltd](https://github.com/replicadeltd)
  112. - Other Contributors:
  113. - https://github.com/vshymanskyy/TinyGSM/graphs/contributors
  114. ## Donation
  115. [![Donate BountySource](https://img.shields.io/badge/Donate-BountySource-149E5E.svg)](https://salt.bountysource.com/checkout/amount?team=tinygsm-dev)
  116. [![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](http://tny.im/aen)
  117. 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!
  118. **All donations will be used strictly to fund the development of TinyGSM:**
  119. - Covering cellular network expenses
  120. - Buying new hardware and modems for integration
  121. - Bounty Budget (to reward other developers for their contributions)
  122. - Implementing new features
  123. - Quality Assurance
  124. ## Getting Started
  125. 1. Using your phone:
  126. - Disable PIN code on the SIM card
  127. - Check your balance
  128. - Check that APN, User, Pass are correct and you have internet
  129. 2. Ensure the SIM card is correctly inserted into the module
  130. 3. Ensure that GSM antenna is firmly attached
  131. 4. Check if serial connection is working (Hardware Serial is recommended)
  132. Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino)
  133. If you have any issues:
  134. 1. Read the whole README (you're looking at it!)
  135. 2. Some boards require [**special configuration**](https://github.com/vshymanskyy/TinyGSM/wiki/Board-configuration).
  136. 3. Try running the Diagnostics sketch
  137. 4. Check for [**highlighted topics here**](https://github.com/vshymanskyy/TinyGSM/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22for+reference%22+)
  138. 5. If you have a question, please post it in our [Gitter chat](https://gitter.im/tinygsm)
  139. ## How does it work?
  140. Many GSM modems, WiFi and radio modules can be controlled by sending AT commands over Serial.
  141. TinyGSM knows which commands to send, and how to handle AT responses, and wraps that into standard Arduino Client interface.
  142. ## API Reference
  143. For GPRS data streams, this library provides the standard [Arduino Client](https://www.arduino.cc/en/Reference/ClientConstructor) interface.
  144. For additional functions, please refer to [this example sketch](examples/AllFunctions/AllFunctions.ino)
  145. ## Troubleshooting
  146. ### Diagnostics sketch
  147. Use this sketch to diagnose your SIM card and GPRS connection:
  148. File -> Examples -> TinyGSM -> tools -> [Diagnostics](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/Diagnostics/Diagnostics.ino)
  149. ### Ensure stable data & power connection
  150. Most modules require up to 2A and specific voltage - according to the module documentation.
  151. So this actually solves stability problems in **many** cases:
  152. - Provide a good stable power supply. Read about [**powering your module**](https://github.com/vshymanskyy/TinyGSM/wiki/Powering-GSM-module).
  153. - Keep your wires as short as possible
  154. - Consider soldering them for a stable connection
  155. - Do not put your wires next to noisy signal sources (buck converters, antennas, oscillators etc.)
  156. ### SoftwareSerial problems
  157. When using ```SoftwareSerial``` (on Uno, Nano, etc), the speed **115200** may not work.
  158. Try selecting **57600**, **38400**, or even lower - the one that works best for you.
  159. In some cases **9600** is unstable, but using **38400** helps, etc.
  160. 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.
  161. **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).**
  162. ### ESP32 Notes
  163. #### HardwareSerial
  164. When using ESP32 `HardwareSerial`, you may need to specify additional parameters to the `.begin()` call.
  165. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/91#issuecomment-356024747).
  166. #### HttpClient
  167. You will not be able to compile the HttpClient or HttpsClient examples with ESP32 core >1.0.1. Downgrade to version 1.0.1 or use the WebClient example. Please comment on the issue on the ESP32 core, not in this library: https://github.com/espressif/arduino-esp32/issues/2755
  168. ### SAMD21
  169. When using SAMD21-based boards, you may need to use a sercom uart port instead of `Serial1`.
  170. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/102#issuecomment-345548941).
  171. ### Broken initial configuration
  172. Sometimes (especially if you played with AT commands), your module configuration may become invalid.
  173. This may result in problems such as:
  174. * Can't connect to the GPRS network
  175. * Can't connect to the server
  176. * Sent/received data contains invalid bytes
  177. * etc.
  178. To return module to **Factory Defaults**, use this sketch:
  179. File -> Examples -> TinyGSM -> tools -> [FactoryReset](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/FactoryReset/FactoryReset.ino)
  180. ### Goouuu Tech IOT-GA6 vs AI-Thinker A6 confusion
  181. 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).
  182. __________
  183. ### License
  184. This project is released under
  185. The GNU Lesser General Public License (LGPL-3.0)