{"id":15680379,"url":"https://github.com/raresail/pico-w-template","last_synced_at":"2025-07-21T12:03:46.063Z","repository":{"id":108890728,"uuid":"527677820","full_name":"RaresAil/pico-w-template","owner":"RaresAil","description":"This is a TCP Socket Server template for the RPI Pico W with features like AES 256 CTR encryption, JSON, Ping System","archived":false,"fork":false,"pushed_at":"2023-02-04T14:32:46.000Z","size":204,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T00:55:03.104Z","etag":null,"topics":["aes-256","aes-ctr","c","cpp","json","pico-wireless","rasspberry-pi","socket","tcp-server","template"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RaresAil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-08-22T18:02:26.000Z","updated_at":"2024-03-25T09:04:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3995a75-360b-4a36-9437-48622b48a2fc","html_url":"https://github.com/RaresAil/pico-w-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/RaresAil/pico-w-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fpico-w-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fpico-w-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fpico-w-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fpico-w-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaresAil","download_url":"https://codeload.github.com/RaresAil/pico-w-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fpico-w-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266296803,"owners_count":23907013,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["aes-256","aes-ctr","c","cpp","json","pico-wireless","rasspberry-pi","socket","tcp-server","template"],"created_at":"2024-10-03T16:41:40.813Z","updated_at":"2025-07-21T12:03:46.037Z","avatar_url":"https://github.com/RaresAil.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Examples\n\nThis template includes example code for the following services\n\n\u003e ### **WARNING, be careful on how you do your wiring or you might damage something**\n\n- Adjustable Desk with a 4 pin connector\n- Thermostat for a central heating unit\n\n## General\n\nThe current features of this template. For the defaults of the features check the `Config` section\n\n- Auto close connection if client didn't sent any request in a specific amount of time\n- Set a specific number of simultaneous clients.\n- Max packet size in bytes.\n- Set TCP port.\n- Set the Wifi SSID and Password at compile time\n- JSON format for packet's data\n- AES 256 CTR encryption\n- PING system\n- RTC\n- Method to send a message to all connected clients\n- Flash UID read at boot and stored in variable `FLASH_SERIAL_NUMBER` as `HEX`\n\nThe `server.cpp` could stay untouched, for parsing the data you can just check `handler.cpp`, after the request is processed the data is sent to the handler along with the client from which you can respond back.\n\nYou can keep the connection alive in order to have real time responses\n\n## Packets\n\nThe packet format is `number_of_characters;data` e.g. `4;demo`\n\n## Config file\n\n- Path: `src/config.h`\n- Code:\n\n  ```h\n  #ifndef __CONFIG_H__\n  #define __CONFIG_H__\n\n  #include \"pico/cyw43_arch.h\"\n\n  #define COUNTRY_CODE_0                  'U'\n  #define COUNTRY_CODE_1                  'S'\n\n  #define WIFI_AUTH                       CYW43_AUTH_WPA2_AES_PSK\n  #define WIFI_PASSWORD                   \"PASSWORD\"\n  #define FIRMWARE_VERSION                \"0.1.0\" // Your version\n  #define WIFI_SSID                       \"SSID\"\n\n  /**\n  * 1 - Thermostat\n  * 2 - Desk\n  */\n  #define SERVICE_TYPE                    2\n\n  // TCP SERVER\n\n  #define TCP_SERVER_PORT                 8098\n  #define TCP_SERVER_BUF_SIZE             2048\n  #define TCP_SERVER_POLL_TIME_S          5\n  #define TCP_SERVER_MAX_CLIENTS          5\n  #define TCP_SERVER_INACTIVE_TIME_S      35\n\n  // ENCRYPTION\n  // To disable encryption do not define this variable\n  #define AES_ENCRYPTION_KEY              \"32-BYTES-KEY-IN-BASE64\"\n\n  #endif\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraresail%2Fpico-w-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraresail%2Fpico-w-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraresail%2Fpico-w-template/lists"}