This library is easy to integrate with lots of sketches which use Ethernet or WiFi.
PubSubClient (MQTT), Blynk, HTTP Client and File Download examples are provided.
TinyGSM is tiny
The complete WebClient example for Arduino Uno (via Software Serial) takes little resources:
Sketch uses 15022 bytes (46%) of program storage space. Maximum is 32256 bytes.
Global variables use 574 bytes (28%) of dynamic memory, leaving 1474 bytes for local variables. Maximum is 2048 bytes.
Arduino GSM library uses 15868 bytes (49%) of Flash and 1113 bytes (54%) of RAM in a similar scenario.
TinyGSM also pulls data gently from the modem (whenever possible), so it can operate on very little RAM.
Now, you have more space for your experiments.
Supported modems
SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
The same command is used for both GPRS or EPS connection
If using a Digi brand cellular XBee, you must specify your GPRS/EPS connection information before waiting for the network. This is true ONLY for Digi cellular XBees! For all other cellular modules, use the GPRS connect function after network registration.
Connect the TCP or SSL client
client.connect(server, port)
Send out your data.
If you have any issues
Read the whole README (you're looking at it!), particularly the troubleshooting section below.
If you have a question, please post it in our Gitter chat
How does it work?
Many GSM modems, WiFi and radio modules can be controlled by sending AT commands over Serial.
TinyGSM knows which commands to send, and how to handle AT responses, and wraps that into standard Arduino Client interface.
This library is "blocking" in all of its communication.
Depending on the function, your code may be blocked for a long time waiting for the module responses.
Apart from the obvious (ie, waitForNetwork()) several other functions may block your code for up to several minutes.
The gprsConnect() and client.connect() functions commonly block the longest, especially in poorer service regions.
The module shutdown and restart may also be quite slow.
This libary does not support any sort of "hardware" or pin level controls for the modules.
If you need to turn your module on or reset it using some sort of High/Low/High pin sequence, you must write those functions yourself.
API Reference
For GPRS data streams, this library provides the standard Arduino Client interface.
For additional functions, please refer to this example sketch
Troubleshooting
Ensure stable data & power connection
Most modules require as much as 2A to properly connect to the network.
This is 4x what a "standard" USB will supply!
Improving the power supply actually solves stability problems in many cases!