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.

181 lines
9.5 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
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
6 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 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 | U201 | A6/A7/A20 | M590 | ESP8266 | XBee | Quectel M95 |
  31. --- | --- | --- | --- | --- | --- | --- | ----------- |
  32. **Data connections**
  33. TCP (HTTP, MQTT, Blynk, ...) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
  34. UDP | ◌ | ◌ | | | | ◌ | ◌ |
  35. SSL/TLS (HTTPS) | ✔¹ | ✔ | 🅧 | 🅧 | ✔¹ | ✔¹ | |
  36. **USSD**
  37. Sending USSD requests | ✔ | | ✔ | ✔ | 🅧 | | |
  38. Decoding 7,8,16-bit response | ✔ | | ✔ | ✔ | 🅧 | | |
  39. **SMS**
  40. Sending | ✔ | | ✔ | ✔ | 🅧 | ✔ | ✔ |
  41. Sending Unicode | ✔ | | ◌ | 🅧 | 🅧 | | ? |
  42. Reading | | | | | 🅧 | | ? |
  43. Incoming message event | | | | ? | 🅧 | | |
  44. **Calls**
  45. Dial, hangup | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
  46. Receiving calls | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
  47. Incoming event (RING) | ◌ | | ◌ | 🅧 | 🅧 | 🅧 | ? |
  48. DTMF sending | ✔ | | ✔ | 🅧 | 🅧 | 🅧 | ? |
  49. DTMF decoding | ◌ | | 🅧 | 🅧 | 🅧 | 🅧 | ? |
  50. **Location**
  51. GSM location service | ✔ | ✔ | 🅧 | 🅧 | 🅧 | ✔ | 🅧 |
  52. GPS/GNSS | ✔¹ | 🅧 | ◌¹ | 🅧 | 🅧 | 🅧 | 🅧 |
  53. ✔ - implemented  ◌ - planned  🅧 - not available on this modem
  54. ¹ - only some device models or firmware revisions have this feature (SIM8xx R14.18, A7, etc.)
  55. ## Supported modems
  56. - SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
  57. - SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
  58. - AI-Thinker A6, A6C, A7, A20
  59. - U-blox SARA U201 (*alpha*)
  60. - ESP8266 (AT commands interface, similar to GSM modems)
  61. - Digi XBee WiFi and Cellular (using XBee command mode)
  62. - Neoway M590
  63. - Quectel M95
  64. ### Supported boards/modules
  65. - Arduino MKR GSM 1400 (*alpha*)
  66. - GPRSbee
  67. - Microduino GSM
  68. - Adafruit FONA (Mini Cellular GSM Breakout)
  69. - Adafruit FONA 800/808 Shield
  70. - Industruino GSM
  71. - ... other modules, based on supported modems
  72. More modems may be supported later:
  73. - [ ] Quectel M10, UG95
  74. - [ ] SIMCom SIM5320, SIM5360, SIM5216, SIM7xxx
  75. - [ ] Telit GL865
  76. - [ ] ZTE MG2639
  77. - [ ] Hi-Link HLK-RM04
  78. Watch this repo for new updates! And of course, contributions are welcome ;)
  79. ## Donation
  80. [![Donate BountySource](https://img.shields.io/badge/Donate-BountySource-149E5E.svg)](https://salt.bountysource.com/checkout/amount?team=tinygsm-dev)
  81. [![Donate Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](http://tny.im/aen)
  82. 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!
  83. **All donations will be used strictly to fund the development of TinyGSM:**
  84. - Covering cellular network expences
  85. - Buying new hardware and modems for integration
  86. - Bounty Budget (to reward other developers for their contributions)
  87. - Implementing new features
  88. - Quality Assurance
  89. ## Getting Started
  90. 1. Using your phone:
  91. - Disable PIN code on the SIM card
  92. - Check your balance
  93. - Check that APN,User,Pass are correct and you have internet
  94. 2. Ensure the SIM card is correctly inserted into the module
  95. 3. Check if serial connection is working (Hardware Serial is recommended)
  96. Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino)
  97. 4. Ensure that GSM antenna is firmly attached
  98. ## How does it work?
  99. Many GSM modems, WiFi and radio modules can be controlled by sending AT commands over Serial.
  100. TinyGSM knows which commands to send, and how to handle AT responses, and wraps that into standard Arduino Client interface.
  101. ## API Reference
  102. For GPRS data streams, this library provides the standard [Arduino Client](https://www.arduino.cc/en/Reference/ClientConstructor) interface.
  103. For additional functions, please refer to [this example sketch](examples/AllFunctions/AllFunctions.ino)
  104. ## Troubleshooting
  105. ### Diagnostics sketch
  106. Use this sketch to diagnose your SIM card and GPRS connection:
  107. File -> Examples -> TynyGSM -> tools -> [Diagnostics](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/Diagnostics/Diagnostics.ino)
  108. ### Ensure stable data & power connection
  109. This actually solves stability problems in **many** cases:
  110. - Provide a good, [stable power supply](https://github.com/vshymanskyy/TinyGSM/wiki/Powering-GSM-module) (up to 2A and specific voltage according to your module documentation)
  111. - Keep your wires as short as possible
  112. - Consider soldering them for a stable connection
  113. - Do not put your wires next to noisy signal sources (buck converters, antennas, oscillators etc.)
  114. ### SoftwareSerial problems
  115. When using ```SoftwareSerial``` (on Uno, Nano, etc), the speed **115200** may not work.
  116. Try selecting **57600**, **38400**, or even lower - the one that works best for you.
  117. 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.
  118. **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).**
  119. ### ESP32 HardwareSerial
  120. When using ESP32 `HardwareSerial`, you may need to specify additional parameters to the `.begin()` call.
  121. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/91#issuecomment-356024747).
  122. ### SAMD21
  123. When using SAMD21-based boards, you may need to use a sercom uart port instead of `Serial1`.
  124. Please [refer to this comment](https://github.com/vshymanskyy/TinyGSM/issues/102#issuecomment-345548941).
  125. ### Broken initial configuration
  126. Sometimes (especially if you played with AT comands), your module configuration may become invalid.
  127. This may result in problems such as:
  128. * Can't connect to the GPRS network
  129. * Can't connect to the server
  130. * Sent/recieved data contains invalid bytes
  131. * etc.
  132. To return module to **Factory Defaults**, use this sketch:
  133. File -> Examples -> TynyGSM -> tools -> [FactoryReset](https://github.com/vshymanskyy/TinyGSM/blob/master/tools/FactoryReset/FactoryReset.ino)
  134. ### Goouuu Tech IOT-GA6 vs AI-Thinker A6 confusion
  135. 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... But no one confirmed that up to my knowledge.
  136. __________
  137. ### License
  138. This project is released under
  139. The GNU Lesser General Public License (LGPL-3.0)