{"id":20186627,"url":"https://github.com/zimbora/esp32-modem-freertos","last_synced_at":"2025-10-07T04:20:04.376Z","repository":{"id":64964221,"uuid":"566312703","full_name":"zimbora/esp32-modem-freeRTOS","owner":"zimbora","description":"freeRTOS - dedicated process to manage network","archived":false,"fork":false,"pushed_at":"2025-04-21T21:44:26.000Z","size":114,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T19:43:46.205Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zimbora.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-15T12:12:59.000Z","updated_at":"2025-09-17T20:20:37.000Z","dependencies_parsed_at":"2023-01-31T05:01:08.255Z","dependency_job_id":"64037641-143c-47e7-be86-d26db926c5f8","html_url":"https://github.com/zimbora/esp32-modem-freeRTOS","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/zimbora/esp32-modem-freeRTOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbora%2Fesp32-modem-freeRTOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbora%2Fesp32-modem-freeRTOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbora%2Fesp32-modem-freeRTOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbora%2Fesp32-modem-freeRTOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimbora","download_url":"https://codeload.github.com/zimbora/esp32-modem-freeRTOS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbora%2Fesp32-modem-freeRTOS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278718267,"owners_count":26033726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T03:18:01.479Z","updated_at":"2025-10-07T04:20:04.321Z","avatar_url":"https://github.com/zimbora.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#esp32-modem-freeRTOS\n\n## Dependencies \n  - Board esp32 by Espressif Systems 3.0.7\n  - WiFi.h v1.2.7\n  - HTTPClient v2.2.0\n  - EspMQTTClient.h v1.13.3\n  - TimeLib v1.6.1\n  - esp32-BG95 v1.0.5\n\n## Usage\n  Edit editable_macros.h file to change macros according to your needs\n  Check examples folder to see examples. Each example imports a credentials.h file that is not present on this repository. You have to create it at your own\n\n## Examples\n\n### demo-mqtt\n  Create the \"credentials.h\" file in demo-mqtt folder\n  Edit the file according to your setup    \n```\n  // WIFI credentials\n  #define WIFI_SSID \"ssid\"\n  #define WIFI_PASSWORD \"password\"\n\n  // MQTT credentials\n  #define MQTT_HOST_1 \"mqtt host\"\n  #define MQTT_PORT_1 1883\n  #define MQTT_USER_1 \"device\"\n  #define MQTT_PASSWORD_1 \"device\"\n  #define MQTT_PROJECT \"esp32/freeRTOS2\"\n  #define MQTT_UID_PREFIX \"uid:\"\n  #define MQTT_WILL_SUBTOPIC \"status\"\n  #define MQTT_WILL_PAYLOAD \"offline\"\n```\n\n## Important\n  All topics start with the prefix\n  :project/:uid/...\n  ':project' and ':uid' are passed with mqtt_configure_connection method\n\n## Description\n  This library implements an independent process to manage LTE and WiFi interfaces\n\n## Functionalities\n  - Manage APN connection (LTE)\n  - Manage Context connection (LTE)  \n  - Manage WIFI connection  \n  - Manage TCP+SSL multi-connection (LTE for now)\n  - Manage MQTT/MQTTS multi-connection (WIFI+LTE)\n  - Manage HTTP/HTTPS multi-requests (WIFI+LTE)\n  - Read messages from Queue and sends to modem\n  - Get messages from modem and write on respective Queue\n  - SMS not supported for now\n\n## Examples\n - HTTP (WIFI/LTE)\n - HTTPS (WIFI/LTE)\n - MQTT (WIFI/LTE)\n - TCP (LTE)\n\n## Public Methods\n\n[void init(const char* ssid, const char* password)](#Init-WiFi)\n[void init(uint16_t cops, uint8_t mode, uint8_t pwkey)](#Init-LTE)\n[void loop()](#Loop)\n[bool set_context(uint8_t contextID, String apn, String user, String pwd)](#Set-context)\n\n### TCP\n[void tcp_configure_connection(uint8_t clientID, uint8_t contextID, String host, uint16_t port)](#TCP-configure-connection)\n[void tcp_setup(void(*callback1)(uint8_t clientID),void(*callback2)(uint8_t clientID))](#TCP-setup)\n[TCP_MSG* tcp_getNextMessage(TCP_MSG *pxRxedMessage)](#TCP-getNextMessage)\n[bool tcp_pushMessage(uint8_t clientID, const char* data, uint16_t len)](#TCP-pushMessage)\n\n### HTTP\n[bool http_pushMessage(uint8_t contextID, uint8_t clientID, String host, String path, String method)](#HTTTP-pushMessage)\n[HTTP_HEADER_MSG* http_header_getNextMessage(HTTP_HEADER_MSG *pxRxedMessage)](#HTTTP-header-getNextMessage)\n[HTTP_BODY_MSG* http_body_getNextMessage(HTTP_BODY_MSG *pxRxedMessage)](#HTTTP-body-getNextMessage)\n\n### MQTT\n[void mqtt_configure_connection(uint8_t clientID, uint8_t contextID, String project, String uid, String host, uint16_t port, String user, String pwd)](#MQTT-configure-connection)\n[void mqtt_set_will_topic(uint8_t clientID, String topic, String payload)](#MQTT-set-will-topic)\n[void mqtt_add_subscribe_topic(uint8_t clientID, uint8_t index, String topic)](#MQTT-add-subscribe-topic)\n[void mqtt_setup(void(*callback)())](#MQTT-setup)\n[bool mqtt_pushMessage(uint8_t clientID, const String\u0026 topic, const String\u0026 message, uint8_t qos, uint8_t retain)](#MQTT-pushMessage)\n[MQTT_MSG* mqtt_getNextMessage(MQTT_MSG *pxRxedMessage)](#MQTT-getNextMessage)\n\n## Examples\n  Run programs inside examples folder to check how it works\n\n### demo-tcp\n  Establishes connection to a server, do a request and reads its response\n\n### demo-http\n  Two processes running simultaneously:\n    - One process is controlling the modem and executing requests\n    - The other one is used to send and received requests to and from the first process\n\n### demo-mqtt\n  Two processes running simultaneously:\n    - One process is controlling the modem, handling mqtt connection and executing requests\n    - The other one is used to send and received requests to and from the first process\n\n\n## Unit Test with Arduino\n  Not available for now\n### unitTest\n  Not available for now\n\n## Public Methods - Extension\n\n#### Init WiFi\n```\nvoid init(const char* ssid, const char* password);\n```\n\n#### Init LTE\n```\nvoid init(uint16_t cops, uint8_t mode, uint8_t pwkey);\n```\n\n#### Loop\n```\nvoid loop();\n```\n\n#### Set context\n```\nbool set_context(uint8_t contextID, String apn, String user, String pwd);\n```\n\n### TCP\n\n#TCP configure connection\n* call it before tcp_setup\n* changes tcp connection parameters\n* while clientID has contextID != 0, loop function will try to keep connection activated\n*\n* @clientID 0-5, limited to MAX_TCP_CONNECTIONS defined in bgxx library\n* @contextID 1-16, limited to MAX_CONNECTIONS defined in bgxx library\n* @host - IP or DNS of server\n* @port\n```\nvoid tcp_configure_connection(uint8_t clientID, uint8_t contextID, String host, uint16_t port)\n```\n\n#TCP setup\n* configures callbacks to be called when connection is established and closed\n```\nvoid tcp_setup(void(*callback1)(uint8_t clientID),void(*callback2)(uint8_t clientID))\n```\n\n#TCP getNextMessage\n* use it to get received messages.\n*\n* returns a pointer to TCP_MSG struct containing the received message\n* if no message is available it returns NULL\n```\nTCP_MSG* tcp_getNextMessage(TCP_MSG *pxRxedMessage)\n```\n#TCP pushMessage\n* use it to send tcp messages\n*\n* @clientID 0-5, tcp index client\n* @data - payload to be sent\n* @len - payload len\n*\n* @retain true|false\n```\nbool tcp_pushMessage(uint8_t clientID, const char* data, uint16_t len)\n```\n\n### HTTP\n\n#### HTTTP pushMessage\n* use it to do http requests\n*\n* @contextID 1-11, context id\n* @clientID 0-5, tcp index client\n* @host\n* @port\n* @path\n* @method\n```\nbool http_pushMessage(uint8_t contextID, uint8_t clientID, String host, String path, String method)\n```\n\n#### HTTTP header getNextMessage\n* use it to get http header messages.\n*\n* returns a pointer to HTTP_HEADER_MSG struct containing the received message\n* if no message is available it returns NULL\n```\nHTTP_HEADER_MSG* http_header_getNextMessage(HTTP_HEADER_MSG *pxRxedMessage)\n```\n\n#### HTTTP body getNextMessage\n* use it to get http body messages.\n*\n* returns a pointer to HTTP_BODY_MSG struct containing the received message\n* if no message is available it returns NULL\n```\nHTTP_BODY_MSG* http_body_getNextMessage(HTTP_BODY_MSG *pxRxedMessage)\n```\n\n### MQTT\n#### MQTT configure connection\n```\nvoid mqtt_configure_connection(uint8_t clientID, uint8_t contextID, String project, String uid, String host, uint16_t port, String user, String pwd);\n```\n#### MQTT set will topic\n```\nvoid mqtt_set_will_topic(uint8_t clientID, String topic, String payload);\n```\n#### MQTT add subscribe topic\n```\nvoid mqtt_add_subscribe_topic(uint8_t clientID, uint8_t index, String topic);\n```\n#### MQTT setup\n```\nvoid mqtt_setup(void(*callback)());\n```\n#### MQTT pushMessage\n```\nbool mqtt_pushMessage(uint8_t clientID, const String\u0026 topic, const String\u0026 message, uint8_t qos, uint8_t retain);\n```\n#### MQTT getNextMessage\n```\nvoid init(uint16_t cops, uint8_t mode, uint8_t pwkey);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbora%2Fesp32-modem-freertos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimbora%2Fesp32-modem-freertos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbora%2Fesp32-modem-freertos/lists"}