--- title: Ai-Thinker A6 and A7 --- # Ai-Thinker A6 and A7 (group) **Module:** **[Supported Modules](group__group__supported__modules.html)** **/** **[Ai-Thinker](group__group__ai__thinker.html)** **/** **[Ai-Thinker A6 and A7](group__aithinker__a6.html)** Manufacturer: Ai-Thinker. Models: A6, A7. ## Connection Information - TCP sockets: - 8 - SSL client not supported * - Socket Buffering: - The modem does **not** have an internal buffer for incoming data. - You must set the buffer size in this library to be larger than your largest expected incoming packet, or you will lose incoming data. - Socket Numbering: - The modem will automatically assign a channel number when the client connects to a server. **Todo**: [todo](todo.html#_todo000001) ## Supported Public Functions - [TinyGsmA6](../classes/class_tiny_gsm_a6.md) - GSM Modem Constructor - [TinyGsmA6(Stream& stream)](../classes/class_tiny_gsm_a6.md#ad459add630369ce785ffc7c52279d2b9) - Basic functions ([TinyGsmModem.tpp](../files/_tiny_gsm_modem_8tpp.md)) - [begin(const char* pin = nullptr)](../classes/class_tiny_gsm_modem.md#ae4397a65939a770e478e29c718d13e59) - [init(const char* pin = nullptr)](../classes/class_tiny_gsm_modem.md#a27f7f71fb1a2008dc57f6d454564022c) - [sendAT(Args... cmd)](../classes/class_tiny_gsm_modem.md#afa190e606feb7831c86094577064d2e6) - [setBaud(uint32_t baud)](../classes/class_tiny_gsm_modem.md#a279bffb4e905f1150dadab726e8482f2) - [forceModemBaud(StreamObject& at_serial, uint32_t targetBaud)](../classes/class_tiny_gsm_modem.md#a0ff68001b77fed375db7e048bc5ab5f4) - [testAT(uint32_t timeout_ms = 10000L)](../classes/class_tiny_gsm_modem.md#a5bfedec6b19edfbcbc0a5832fff7d603) - [waitResponse(uint32_t timeout_ms, String& data, GsmConstStr r1 = GFP(ModemConfig::GSM_OK), GsmConstStr r2 = GFP(ModemConfig::GSM_ERROR), GsmConstStr r3 = nullptr, GsmConstStr r4 = nullptr, GsmConstStr r5 = nullptr, GsmConstStr r6 = nullptr, GsmConstStr r7 = nullptr, GsmConstStr r8 = nullptr)](../classes/class_tiny_gsm_modem.md#a4416426fc61492fcb761139b85f1535b) - [waitResponse(uint32_t timeout_ms, GsmConstStr r1 = GFP(ModemConfig::GSM_OK), GsmConstStr r2 = GFP(ModemConfig::GSM_ERROR), GsmConstStr r3 = nullptr, GsmConstStr r4 = nullptr, GsmConstStr r5 = nullptr, GsmConstStr r6 = nullptr, GsmConstStr r7 = nullptr, GsmConstStr r8 = nullptr)](../classes/class_tiny_gsm_modem.md#a5d04ca30762417cd04f0df3b620b6df7) - [waitResponse(GsmConstStr r1 = GFP(ModemConfig::GSM_OK), GsmConstStr r2 = GFP(ModemConfig::GSM_ERROR), GsmConstStr r3 = nullptr, GsmConstStr r4 = nullptr, GsmConstStr r5 = nullptr, GsmConstStr r6 = nullptr, GsmConstStr r7 = nullptr, GsmConstStr r8 = nullptr)](../classes/class_tiny_gsm_modem.md#ac8849ac15a91800244750682561c3938) - [getConfiguredModem()](../classes/class_tiny_gsm_modem.md#a2f9a76aa8ef51867e560196a8261c170) - [getModemInfo()](../classes/class_tiny_gsm_modem.md#a587c942eefa8b4905da4cfaf79d04c53) - [getModemName()](../classes/class_tiny_gsm_modem.md#a500246b8d736f654ffd91db17664e42a) - [getModemManufacturer()](../classes/class_tiny_gsm_modem.md#a3bf0eb3d18cefc70a0277103719873aa) - [getModemModel()](../classes/class_tiny_gsm_modem.md#ae0ca787c0bb16776f3b326a899c39d4e) - [getModemRevision()](../classes/class_tiny_gsm_modem.md#a748dce8b32f1a5d4ca0f9bf9a5ea55a2) - [getModemSerialNumber()](../classes/class_tiny_gsm_modem.md#a3a13f308ec6beb7e2a270d1ece67978e) - [factoryDefault()](../classes/class_tiny_gsm_modem.md#a229a18e6a1226a51301ba3a41f75947d) - Power functions ([TinyGsmModem.tpp](../files/_tiny_gsm_modem_8tpp.md)) - [restart(const char* pin = nullptr)](../classes/class_tiny_gsm_modem.md#a986567555e19bc82fc3f4f154f89de40) - [powerOff()](../classes/class_tiny_gsm_modem.md#ac6d0ce36377992e00b0d38c5cb1a9126) - [radioOff()](../classes/class_tiny_gsm_modem.md#a084efec47f33f71933c2084bf4c3fead) - [sleepEnable(bool enable = true)](../classes/class_tiny_gsm_modem.md#ae293a3c9ef0c55ce7dbc05a29dd5c3a7) - [setPhoneFunctionality(uint8_t fun, bool reset = false)](../classes/class_tiny_gsm_modem.md#a496f2e6fb026bea432f2f3d31b50d2be) - Generic network functions ([TinyGsmModem.tpp](../files/_tiny_gsm_modem_8tpp.md)) - [getRegistrationStatus()](../classes/class_tiny_gsm_modem.md#a75286fdda3bb1672f1c88a06d010c04d) - [isNetworkConnected()](../classes/class_tiny_gsm_modem.md#ac6923f6667d67ec47e88a15d34d365fe) - [waitForNetwork(uint32_t timeout_ms = 60000L, bool check_signal = false)](../classes/class_tiny_gsm_modem.md#a8cdad3a71c520124dd1d5aed16ee726b) - [getSignalQuality()](../classes/class_tiny_gsm_modem.md#a714c21a155a823bb32a7be87fde815bd) - [getLocalIP()](../classes/class_tiny_gsm_modem.md#a69cbe284005cf8831b0155f5ba721d87) - [localIP()](../classes/class_tiny_gsm_modem.md#ab6aae9d6513ea9496f79704367eeff44) - SIM card functions ([TinyGsmGPRS.tpp](../files/_tiny_gsm_g_p_r_s_8tpp.md)) - [simUnlock(const char* pin)](../classes/class_tiny_gsm_g_p_r_s.md#a466fae623fa90d89e3b899f8ad9b6770) - [getSimCCID()](../classes/class_tiny_gsm_g_p_r_s.md#a8ba9e16bbba657b10ebb7da122c21d54) - [getIMEI()](../classes/class_tiny_gsm_g_p_r_s.md#a27acb4e97886f54e2d741c5554a25aa4) - [getIMSI()](../classes/class_tiny_gsm_g_p_r_s.md#a33c0b782e1076262c262063857d648a2) - [getSimStatus(uint32_t timeout_ms = 10000L)](../classes/class_tiny_gsm_g_p_r_s.md#a04fe0ca24dc592e8e564c9669fd4a314) - GPRS functions ([TinyGsmGPRS.tpp](../files/_tiny_gsm_g_p_r_s_8tpp.md)) - [gprsConnect(const char* apn, const char* user = nullptr, const char* pwd = nullptr)](../classes/class_tiny_gsm_g_p_r_s.md#a23ddc191f39cb31d183d91bc89b4bd44) - [gprsDisconnect()](../classes/class_tiny_gsm_g_p_r_s.md#aa6decbde976ddbdee7e0d5a0047f46da) - [isGprsConnected()](../classes/class_tiny_gsm_g_p_r_s.md#a047ca5d9e0d99bcc87e5dbce11403aec) - [getOperator()](../classes/class_tiny_gsm_g_p_r_s.md#aa80d4559b92f4ab0d4a1142013364821) - Socket listening functions ([TinyGsmTCP.tpp](../files/_tiny_gsm_t_c_p_8tpp.md)) - [maintain()](../classes/class_tiny_gsm_t_c_p.md#a35e2f8d26fd77dd0c217631b153d41bc) - Phone call functions ([TinyGsmCalling.tpp](../files/_tiny_gsm_calling_8tpp.md)) - [callAnswer()](../classes/class_tiny_gsm_calling.md#a6b4a239a88045684c75450ba1fed7357) - [callNumber(const String& number)](../classes/class_tiny_gsm_calling.md#ac37617522cec7757a026ff4afde827e2) - [callHangup()](../classes/class_tiny_gsm_calling.md#ad526aeba6fa6c5cadfc62bf0be261cb7) - [dtmfSend(char cmd, int duration_ms = 100)](../classes/class_tiny_gsm_calling.md#a8bcc2a98729f0c4fe2b4a67d1a1e3cfc) - Audio functions - [audioSetHeadphones()](../classes/class_tiny_gsm_a6.md#a05202818d2802f63012dcfedfb556754) - [audioSetSpeaker()](../classes/class_tiny_gsm_a6.md#ae750db2b82fc92c19f8fd16820de3b44) - [audioMuteMic(bool mute)](../classes/class_tiny_gsm_a6.md#a1dfd1fd27c0a13b0494d153ca01e9bd3) - Text messaging (SMS) functions ([TinyGsmSMS.tpp](../files/_tiny_gsm_s_m_s_8tpp.md)) - [sendUSSD(const String& code)](../classes/class_tiny_gsm_s_m_s.md#a0d0e6c715e06650381620ec1417edcfd) - [sendSMS(const String& number, const String& text)](../classes/class_tiny_gsm_s_m_s.md#afbbd31f4c58b16319bef3e3b9e42b5dd) - [sendSMS_UTF16(const char* const number, const void* text, size_t len)](../classes/class_tiny_gsm_s_m_s.md#a430127e129d6fb41b643a0364deca94b) - Time functions ([TinyGsmTime.tpp](../files/_tiny_gsm_time_8tpp.md)) - [getGSMDateTime(TinyGSMDateTimeFormat format)](../classes/class_tiny_gsm_time.md#adaaa4aba622ee5d874fcc2abc6109e84) - [getNetworkTime(int* year, int* month, int* day, int* hour, int* minute, int* second, float* timezone)](../classes/class_tiny_gsm_time.md#a68d9baf6ba1f006441b3d71e5e058cdb) - [getNetworkEpoch(TinyGSM_EpochStart epoch = TinyGSM_EpochStart::UNIX)](../classes/class_tiny_gsm_time.md#a96cf8b52cd88938c4211d17de826376e) - Battery functions ([TinyGsmBattery.tpp](../files/_tiny_gsm_battery_8tpp.md)) - [getBattPercent()](../classes/class_tiny_gsm_battery.md#a349ded65e22bc04beb5dd320b58965d6) - [getBattChargeState()](../classes/class_tiny_gsm_battery.md#ac2179871063de50df9e3134a049f68b0) - [getBattStats(int8_t& chargeState, int8_t& percent, int16_t& milliVolts)](../classes/class_tiny_gsm_battery.md#a0aeea9308d460dcd811089c5821eada3) - Utilities ([TinyGsmModem.tpp](../files/_tiny_gsm_modem_8tpp.md)) - [streamWrite(T last)](../classes/class_tiny_gsm_modem.md#aa03b38efd4eb8437c9e5ed92aac89742) - [streamWrite(T head, Args... tail)](../classes/class_tiny_gsm_modem.md#a6f0a60b7020372ab7e7605f90d5eb2a5) - [streamClear()](../classes/class_tiny_gsm_modem.md#a7879aad8a0f9def7cd8d7450800b2d64) - [streamDump(int16_t expected_len)](../classes/class_tiny_gsm_modem.md#a20ccc061bab4e038a8800c244e761ecd) - [GsmClientA6](../classes/class_tiny_gsm_a6_1_1_gsm_client_a6.md) - Arduino Client interface ([TinyGsmTCP.tpp](../files/_tiny_gsm_t_c_p_8tpp.md)) - [connect(const char* host, uint16_t port, int timeout_s)](../classes/class_gsm_client.md#ac3343dcdf3ba62f63aeb3b0775e4a93a) - [connect(IPAddress ip, uint16_t port, int timeout_s)](../classes/class_gsm_client.md#aec4d4702d5652a7ccce867f0dcb1fd29) - [connect(const char* host, uint16_t port)](../classes/class_gsm_client.md#a6e86eac67796044a92dba6695e2f6f9f) - [connect(IPAddress ip, uint16_t port)](../classes/class_gsm_client.md#a19fa0b322c6fb17a1d0de28d747222ec) - [stop(uint32_t maxWaitMs)](../classes/class_gsm_client.md#a138ad35447383cc62d99c037743e4210) - [stop()](../classes/class_gsm_client.md#acac60bc3c9cb1e7d58e2b13833e4c720) - [write(const uint8_t* buf, size_t size)](../classes/class_gsm_client.md#a528d5a4c7d75a6951ec236b7b46fcedb) - [write(uint8_t c)](../classes/class_gsm_client.md#a3afda0b395cdc163a542915c90c3647b) - [available()](../classes/class_gsm_client.md#a5327499ee49bd0f7ca6ea292de7fe492) - [read(uint8_t* buf, size_t size)](../classes/class_gsm_client.md#a2cd9c417964981283684cdea7ac7d3c2) - [read()](../classes/class_gsm_client.md#af3b9f9b2908979e751098c222fc655d4) - [peek()](../classes/class_gsm_client.md#aa684170a2aa623822ccc3d428568913e) - [flush()](../classes/class_gsm_client.md#ad7f9b8cf52f29a390fafc3003f1ecd99) - [connected()](../classes/class_gsm_client.md#a5eb01b0909582692e00b07c41ec7bd22) - Extended Client API ([TinyGsmTCP.tpp](../files/_tiny_gsm_t_c_p_8tpp.md)) - [getMux()](../classes/class_gsm_client.md#a9dc458d3a5eced0cfecdbdc72e06d6c0) - [getConnectionID()](../classes/class_gsm_client.md#a198f6e1698d43841c3a1ab287bca914d) - [beginWrite(uint16_t size)](../classes/class_gsm_client.md#a3faf91fd6a17294a5915ce57ac5bdc0d) - [endWrite(uint16_t expected_size = 0)](../classes/class_gsm_client.md#a36e18c3adb596ab7d299796e658f42a5) ## Classes | | Name | | -------------- | -------------- | | struct | **TinyGsmA6ModemConfig**
Basic modem configurations for the A6 and A7 modems. | | struct | **TinyGsmA6TcpConfig**
TCP behavior and limits for the A6 and A7 modems. | | class | **TinyGsmA6**
TinyGsmA6 is a class for controlling the Ai-Thinker A6 and A7 GSM/GPRS module. | | class | **TinyGsmA6::GsmClientA6**
Inner client. | ## Types | | Name | | -------------- | -------------- | | enum class | [A6RegStatus](#gae5416a7fef2067e15992a73692ee530f) { REG_NO_RESULT = -1, REG_UNREGISTERED = 0, REG_SEARCHING = 2, REG_DENIED = 3, REG_OK_HOME = 1, REG_OK_ROAMING = 5, REG_UNKNOWN = 4 }
Registration status. | ### A6RegStatus | Enumerator | Value | Description | | ---------- | ----- | ----------- | | REG_NO_RESULT | -1 | No registration result. | | REG_UNREGISTERED | 0 | Not registered on the network. | | REG_SEARCHING | 2 | Searching for network. | | REG_DENIED | 3 | Registration denied. | | REG_OK_HOME | 1 | Registered on the home network. | | REG_OK_ROAMING | 5 | Registered on a roaming network. | | REG_UNKNOWN | 4 | Unknown registration status. | ------------------------------- Generated by [Doxygen](https://www.doxygen.nl) and [m.css](https://mcss.mosra.cz/) with templates from [doxybook2](https://github.com/matusnovak/doxybook2) Updated on 2026-09-11