{"id":14963397,"url":"https://github.com/craigpeacock/zephyr_wifi","last_synced_at":"2025-10-25T02:30:31.260Z","repository":{"id":85794998,"uuid":"586142910","full_name":"craigpeacock/Zephyr_WiFi","owner":"craigpeacock","description":"Example Zephyr WiFi code","archived":false,"fork":false,"pushed_at":"2024-07-17T04:42:11.000Z","size":49,"stargazers_count":33,"open_issues_count":8,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T04:51:27.769Z","etag":null,"topics":["esp32","esp32c3","nrf7002","wifi","zephyr","zephyr-rtos"],"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/craigpeacock.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":"2023-01-07T04:42:26.000Z","updated_at":"2024-10-20T15:35:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"8c7fb2e9-6434-4585-b976-6a393a8d7a7a","html_url":"https://github.com/craigpeacock/Zephyr_WiFi","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":"0.30000000000000004","last_synced_commit":"e8d7c2a514cf2bbdf7a2f843682151fb34d20274"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigpeacock%2FZephyr_WiFi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigpeacock%2FZephyr_WiFi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigpeacock%2FZephyr_WiFi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craigpeacock%2FZephyr_WiFi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/craigpeacock","download_url":"https://codeload.github.com/craigpeacock/Zephyr_WiFi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238059129,"owners_count":19409601,"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","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":["esp32","esp32c3","nrf7002","wifi","zephyr","zephyr-rtos"],"created_at":"2024-09-24T13:31:26.917Z","updated_at":"2025-10-25T02:30:31.255Z","avatar_url":"https://github.com/craigpeacock.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zephyr WiFi Code\n\nSimple example Zephyr WiFi code that is targeted for the [ESP32-S3](https://www.espressif.com/en/products/socs/esp32-s3), [ESP32-C3](https://www.espressif.com/en/products/socs/esp32-c3), Raspberry [Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html) (Infineon [CYW43439](https://www.infineon.com/part/CYW43439)) and Nordic [nRF7002](https://www.nordicsemi.com/Products/Wireless/WiFi/Products?lang=en#infotabs), although it should be platform-agnostic (one of the advantages of Zephyr).\n\nThis example connects to a WiFi network, obtains an IPv4 address via DHCP, pings Goggle's DNS server 8.8.8.8 four times, does a DNS lookup for iot.beyondlogic.org returning IPv4 and IPv6 addresses and finally performs a http GET request for http://iot.beyondlogic.org/LoremIpsum.txt\n\n```\n*** Booting Zephyr OS build v4.2.0-1744-g1cb0b6a7ffa5 ***\nWiFi Example\nBoard: esp32s3_devkitc\nConnecting to SSID: test_ap\nConnected\nSSID: test_ap\nBand: 2.4GHz\nChannel: 9\nSecurity: WPA2-PSK\nRSSI: -68\nIPv4 address: 192.168.0.152\nSubnet: 255.255.255.0\nRouter: 192.168.0.254\nReady...\nReply from 8.8.8.8: bytes=28 time=25ms TTL=116\nReply from 8.8.8.8: bytes=28 time=21ms TTL=116\nReply from 8.8.8.8: bytes=28 time=18ms TTL=116\nReply from 8.8.8.8: bytes=28 time=16ms TTL=116\n\nLooking up IP addresses:\nIPv4: 66.39.146.38\nIPv6: 2607:f440::4227:9226\nConnecting to HTTP Server:\nConnecting to 2607:f440::4227:9226:80 Failure (-1)\nConnecting to 66.39.146.38:80 Success\nHTTP/1.1 200 OK\nDate: Sat, 16 Aug 2025 11:19:55 GMT\nServer: Apache\nLast-Modified: Thu, 27 Jun 2024 11:26:53 GMT\nETag: \"f6f-61bdd685e5940\"\nAccept-Ranges: bytes\nContent-Length: 3951\nContent-Type: text/plain\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel dolor auctor, bibendum lectus sit amet, bibendum velit. Nunc euismod, odio eget eleifend aliquet, nibh nibh malesuada risus, vel pretium nunc eros at elit. Donec finibus ultrices quam a luctus. Curabitur lobortis massa id sapien aliquam, id congue mi lobortis. Fusce id aliquam ante. Nullam congue velit ac bibendum eleifend. Nulla quis gravida odio, vel rutrum risus. Ut tincidunt, justo in fermentum bibendum, mauris mauris malesuada metus, ut eleifend augue lectus ut ex. Nam ut mollis ante.\n```\n\n# Building for ESP32-S3 (xtensa)\n\nFollow the [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) to install Zephyr and the build tools. \n\nZephyr Board Information: [ESP32-S3-DevKitC](https://docs.zephyrproject.org/latest/boards/espressif/esp32s3_devkitc/doc/index.html)\n\n```\ngit clone https://github.com/craigpeacock/Zephyr_ESP32_WiFi.git\ncd Zephyr_ESP32_WiFi\nwest blobs fetch hal_espressif\nwest build -b esp32s3_devkitc/esp32s3/procpu\nwest flash\nwest espressif monitor\n```\n\n# Building for ESP32-C3 (RISC-V)\n\nFollow the [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) to install Zephyr and the build tools. \n\nZephyr Board Information: [ESP32-C3-DevKitC](https://docs.zephyrproject.org/latest/boards/espressif/esp32c3_devkitc/doc/index.html)\n\n```\ngit clone https://github.com/craigpeacock/Zephyr_ESP32_WiFi.git\ncd Zephyr_ESP32_WiFi\nwest blobs fetch hal_espressif\nwest build -b esp32c3_devkitc/esp32c3\nwest flash\nwest espressif monitor\n```\n\n# Building for ESP32-C6 (RISC-V)\n\nFollow the [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) to install Zephyr and the build tools. \n\nZephyr Board Information: [ESP32-C6-DevKitC](https://docs.zephyrproject.org/latest/boards/espressif/esp32c6_devkitc/doc/index.html)\n\n```\ngit clone https://github.com/craigpeacock/Zephyr_ESP32_WiFi.git\ncd Zephyr_ESP32_WiFi\nwest blobs fetch hal_espressif\nwest build -b esp32c6_devkitc/esp32c6/hpcore\nwest flash\nwest espressif monitor\n```\n\n# Building for Raspberry PicoW\n\nFollow the [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) to install Zephyr and the build tools.\n\nZephyr Board Information: [Raspberry Pi Pico](https://docs.zephyrproject.org/latest/boards/raspberrypi/rpi_pico/doc/index.html)\n\n```\ngit clone https://github.com/craigpeacock/Zephyr_ESP32_WiFi.git\ncd Zephyr_ESP32_WiFi\nwest blobs fetch hal_infineon\nwest build -b rpi_pico/rp2040/w\nwest flash\n```\n\nThe console is available on P0/P1. UART0_TX is P0, UART0_RX is P1.\n\nConsole Output:\n```\nWLAN Firmware    : wl0: Jun  5 2024 06:33:59 version 7.95.88 (cf1d613 CY) FWID 01-7b7cf51a\nWLAN CLM         : API: 12.2 Data: 9.10.39 Compiler: 1.29.4 ClmImport: 1.36.3 Creation: 2024-04-16 21:20:55\nWHD VERSION      : 3.3.2.25168 : v3.3.2 : GCC 12.2 : 2024-12-06 06:53:17 +0000\n*** Booting Zephyr OS build v4.2.0-1744-g1cb0b6a7ffa5 ***\nWiFi Example\nBoard: rpi_pico\nConnecting to SSID: test_ap\nConnected\n```\n\n# Troubleshooting\n\n*West blobs fetch hal_espressif* downloads WiFi and Bluetooth binary blobs required for the ESP32. If these are not installed, you are likely to get linker errors resulting from missing files such as\n\n```\ncannot find -lnet80211: No such file or directory\ncannot find -lcore: No such file or directory\ncannot find -lpp: No such file or directory\ncannot find -lcoexist: No such file or directory\ncannot find -lphy: No such file or directory\ncannot find -lmesh: No such file or directory\n```\n\nThe RISC-V architecture (ESP32C3) requires the kconfig option CONFIG_HEAP_MEM_POOL_SIZE=32768 otherwise multiple errors result with undefined reference to `k_malloc'\n\nIf this value is too small, errors can result loading the WiFi driver at runtime:\n\n```\n[00:00:00.003,000] \u003cerr\u003e esp32_wifi_adapter: memory allocation failed          \n[00:00:00.005,000] \u003cerr\u003e esp32_wifi: Failed to start Wi-Fi driver  \n```\n\n# nrf7002dk_nrf5340_cpuapp (Nordic nRF7002)\n\nThis project currently builds and sucessfully connects when using nRFConnect SDK 2.2.0 and 2.3.0. Support for the nRF7002 is very new and change should be expected as the code matures over time. Below is a list of common issues encounted when porting your Zephyr WiFi code to the nRF7002 target:\n\n## Troubleshooting \n\nIt may be observed when using SDK 2.3.0 that the following error (Unable to get wpa_s handle for wlan0) is reported at runtime:\n\n```\nWiFi Example\nBoard: nrf7002dk_nrf5340_cpuapp\nConnecting to SSID: test_ap\n[00:00:00.600,189] \u003cinf\u003e wpa_supp: z_wpas_start: 385 Starting wpa_supplicant thread with debug level: 3\n[00:00:00.600,402] \u003cinf\u003e wpa_supp: Successfully initialized wpa_supplicant\n[00:00:00.600,830] \u003cerr\u003e wpa_supp: z_wpas_get_handle_by_ifname: Unable to get wpa_s handle for wlan0\n```\n\nExamining nRF7002 code from Nordic, it appears they have put a 1 second day in after registering the callbacks, and before calling wifi_connect(). This was not required in SDK 2.2.0\n\nTo prevent the following build error\n```\n\\wifi\\nrf700x\\zephyr\\src\\shim.c:14:10: fatal error: sys/time.h: No such file or directory\n```\nadd the following to your prj.conf:\n```\nCONFIG_NEWLIB_LIBC=y\nCONFIG_NEWLIB_LIBC_NANO=n\n```\n\nTo prevent build error\n```\nundefined reference to `z_impl_sys_rand32_get'\n```\nand the following to your prj.conf:\n```\nCONFIG_ENTROPY_GENERATOR=y\nCONFIG_TEST_RANDOM_GENERATOR=y\n```\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraigpeacock%2Fzephyr_wifi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraigpeacock%2Fzephyr_wifi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraigpeacock%2Fzephyr_wifi/lists"}