{"id":14963330,"url":"https://github.com/hpsaturn/espnowcam","last_synced_at":"2026-03-06T01:04:49.561Z","repository":{"id":213183923,"uuid":"733255698","full_name":"hpsaturn/ESPNowCam","owner":"hpsaturn","description":"ESPNowCam, a straightforward video streamer for popular ESP32Cam models, leveraging the ESPNow protocol. No need for IPs, routers, or credentials—keeping it simple! :D","archived":false,"fork":false,"pushed_at":"2025-04-05T10:56:34.000Z","size":5091,"stargazers_count":157,"open_issues_count":6,"forks_count":13,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-05T11:25:03.751Z","etag":null,"topics":["arduino","camera","esp32","esp32cam","esp32s3","nanopb","platformio","protocol-buffers","protos"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hpsaturn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"hpsaturn","liberapay":"Hpsaturn","buy_me_a_coffee":"hpsaturn","patreon":"hpsaturn"}},"created_at":"2023-12-18T23:12:05.000Z","updated_at":"2025-04-05T10:56:37.000Z","dependencies_parsed_at":"2024-01-20T14:32:17.504Z","dependency_job_id":"dd7528fd-1e91-4443-a059-2d07d61dfb15","html_url":"https://github.com/hpsaturn/ESPNowCam","commit_stats":{"total_commits":172,"total_committers":1,"mean_commits":172.0,"dds":0.0,"last_synced_commit":"b8dca20f7051614d8057e1fe0789faf7438581ff"},"previous_names":["hpsaturn/esp32s3-cam"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpsaturn%2FESPNowCam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpsaturn%2FESPNowCam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpsaturn%2FESPNowCam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpsaturn%2FESPNowCam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpsaturn","download_url":"https://codeload.github.com/hpsaturn/ESPNowCam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332559,"owners_count":20921853,"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":["arduino","camera","esp32","esp32cam","esp32s3","nanopb","platformio","protocol-buffers","protos"],"created_at":"2024-09-24T13:31:21.614Z","updated_at":"2026-03-06T01:04:49.549Z","avatar_url":"https://github.com/hpsaturn.png","language":"C++","funding_links":["https://github.com/sponsors/hpsaturn","https://liberapay.com/Hpsaturn","https://buymeacoffee.com/hpsaturn","https://patreon.com/hpsaturn"],"categories":[],"sub_categories":[],"readme":"# ESPNowCam - Data streamer\n\n[![PlatformIO](https://github.com/hpsaturn/esp32s3-cam/workflows/PlatformIO/badge.svg)](https://github.com/hpsaturn/esp32s3-cam/actions/) [![All Platforms](https://github.com/hpsaturn/esp32s3-cam/workflows/Scheduled/badge.svg)](https://github.com/hpsaturn/esp32s3-cam/actions/) ![ViewCount](https://views.whatilearened.today/views/github/hpsaturn/esp32s3-cam.svg)  \n\nThe ESPNowCam library is a simple and direct video or data streamer designed for popular ESP32 devices, utilizing the ESPNow protocol. No need for IPs, routers, or credentials—keeping it straightforward and hassle-free! :D\n\n\u003e[!TIP]\n\u003e**This library is for general purpose**, as it accepts pointers to various types of data, including buffers, strings, images, or any byte-formatted content. This flexibility enables transmission of larger packages across different scenarios, not limited to cameras alone. For instance, a buffer of 4000 bytes takes approximately 1/9 of a second to transmit, resulting in a frame rate of around 9FPS.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      Don't forget to star ⭐ this repository\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\nThe latest version brings numerous enhancements and is currently highly stable. It offers support for various transmission modes including:\n\n- One transmitter to multiple receivers using the internal ESPNow broadcasting feature (1:N mode).\n- Peer-to-peer (P2P) connections utilizing MAC address targeting (1:1 mode).\n- Multi-sender mode with one receiver (N:1 mode).\n- **NEW:** [80211tx()](#wifi-raw-80211tx-mode-experimental) WiFi raw ESPNow alternative (Beta).\n\n[![ESPNowCam broadcast camera mode](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/broadcast-camera-mode.gif)](https://youtu.be/zXIzP1TGlpA) [![ESPNowCam P2P mode](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/p2p-camera-mode.gif)](https://youtu.be/XDIiJ25AKr8) [![ESPNowCam multi camera mode](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/multi-camera-mode.gif)](https://youtu.be/ip6RohVEg2s)  \n[[1:N mode video]](https://youtu.be/zXIzP1TGlpA) [[1:1 mode video]](https://youtu.be/XDIiJ25AKr8) [[N:1 mode video]](https://youtu.be/ip6RohVEg2s)  \n\n\u003e[!TIP]\n\u003eIt's important to note that the library is versatile and capable of transmitting various types of data, not limited to video.\n\n## Performance\n\nThe current version was tested with the next cameras:\n\n| Sender |  Frame | PSRAM | JPGQ | FPS | Status |\n|:---------|:-----:|:-----:|:------:|:-------:|:------:|\n| Freenove [80211tx()](#wifi-raw-80211tx-mode-experimental) | QVGA | Yes | 12 | ~13 FPS | TESTING |\n| TTGO TJournal |  QVGA | No | 12 | ~11 FPS | STABLE |\n| XIAO Sense S3 | QVGA | Yes | 12 | ~11 FPS | STABLE |\n| Freenove S3 | QVGA | Yes | 12 | ~10 FPS | STABLE |\n| Freenove S3 | HVGA | Yes | 12 | ~6 FPS | STABLE |\n| M5CoreS3 | QVGA | Yes | 12  | ~11 FPS | STABLE |\n| M5UnitCamS3 | QVGA | Yes | 12 | ~9 FPS | STABLE |\n\n[Full list of senders and receivers that was tested](https://github.com/hpsaturn/ESPNowCam/wiki/Supported-Devices)\n\n## Library installation\n\n**PlatformIO**:\n\nAdd the following line to the lib_deps option of your [env:] section:\n\n```python\nhpsaturn/EspNowCam@^0.2.0\n```\n\nOr via command line:  \n\n```python\npio pkg install --library \"hpsaturn/ESPNowCam@^0.2.0\"\n```\n\n**Arduino IDE**:\n\n\u003e[!IMPORTANT]\n\u003eFor `Arduino IDE` is a little bit more complicated because the Arduino IDE dependencies resolver is very bad, but you only need:\n\u003e\n\u003e1. Download and install the [Nanopb library](https://github.com/nanopb/nanopb/releases/tag/nanopb-0.4.9.1) using the `Include Library` section via zip file\n\u003e2. and then with the **Library Manager** find **ESPNowCam** and install it.\n\n\u003e[!TIP]\n\u003eNanobp is not included as a dependency because, despite being 25 years after the invention of symbolic links, Arduino IDE does not support these types of files. Consider exploring PlatformIO for your future developments, as it offers a more versatile and modern development environment.\n\n## Usage\n\n**To send** any kind of data, you only need a buffer and the size to send:\n\n```cpp\n#include \u003cESPNowCam.h\u003e\n\nESPNowCam radio;\n\nradio.init();\nradio.sendData(data, data_len);\n```\n\n[full sender implementation example](https://github.com/hpsaturn/ESPNowCam/blob/master/examples/xiao-espnow-sender/xiao-espnow-sender.cpp)\n\n**To receive** the data, you only need to define a buffer and callback:\n\n```cpp\nradio.setRecvBuffer(fb);\nradio.setRecvCallback(onDataReady);\nradio.init();\n```\n\n```cpp\nvoid onDataReady(uint32_t lenght) {\n  tft.drawJpg(fb, lenght , 0, 0, dw, dh);\n}\n```\n\n[full receiver implementation example](https://github.com/hpsaturn/ESPNowCam/blob/master/examples/m5core2-basic-receiver/m5core2-basic-receiver.ino)\n\n\u003e[!NOTE]\n\u003eIf you don't define any specific target, the radio will work in broadcasting mode, that means **1:N mode**, for instance one camera sending video to multiple screen receivers.\n\n### P2P mode (1:1)\n\nIt's also possible to define a specific target:\n\n```cpp\nconst uint8_t macRecv[6] = {0xB8,0xF0,0x09,0xC6,0x0E,0xCC};\nradio.setTarget(macRecv);\nradio.init();\n```\n\n\u003e[!TIP]\n\u003eThis mode is very recommended to increase the performance, and also it reduces the noise and possible glitches.\n\n### Multi camera mode (N:1)\n\nIs possible too configure multiple cameras or senders to only one receiver, N:1 mode, configuring filters by MAC in the receiver:\n\n```cpp\nradio.setRecvFilter(fb_cam1, mac_cam1, onCam1DataReady);\nradio.setRecvFilter(fb_cam2, mac_cam2, onCam2DataReady);\nradio.setRecvFilter(fb_cam3, mac_cam3, onCam3DataReady);\n```\n\nand each camera should have configured the receiver MAC like a target. Fore more details, please follow the [multi-camera-one-receiver](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/multi-camera-one-receiver/) directory example.\n\n### WiFi Raw 802.11tx mode (experimental)\n\nNow is possible use 80211tx() primitive or WiFi RAW mode without ESPNow internals. Using this raw mode it could be better performance. For that, only do that:\n\n**sender**:\n\n```cpp\nWiFiRawComm wifiRaw;\nESPNowCam radio(\u0026wifiRaw);\n\nradio.setTarget(macRecv); // receiver mac address to improve quality\nradio.setChannel(6);      // improve quality (recommended)\nradio.init(512);          // you are able to change the chunk size\n\nradio.sendData(out_data, out_data_len);\n```  \n\n[full wifiraw-80211tx-sender example](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/wifiraw-80211tx-sender)\n\n**receiver**:\n\n```cpp\nWiFiRawComm wifiRaw;\nESPNowCam radio(\u0026wifiRaw);\n\nradio.setRecvBuffer(fb);            // fixed buffer\nradio.setRecvCallback(onDataReady); // similar callback to other modes\nradio.setChannel(6);                // improve quality\nradio.init(512);                    // the same sender chunk size\n```  \n\n[full wifiraw-80211tx-receiver example](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/wifiraw-80211tx-receiver)\n\n\u003e[!TIP]\n\u003eNote: The N:1 mode is not full implemented on WiFi raw. It is recommended use channel and mac address target on the sender for improve quality. Please sse the examples for details.\n\n### Predefined drivers\n\nThe library includes some pre-defined camera configs to have an easy implementation, for example:\n\n```cpp\n#include \u003cESPNowCam.h\u003e\n#include \u003cdrivers/CamFreenove.h\u003e\n\nCamFreenove Camera;\n```\n\n\u003e[!TIP]\n\u003eFor now, it includes drivers for FreenoveS3, XIAOS3, M5UnitCamS3, Freenove WRover, ESP32Cam AI-Thinker and the TTGO T-Journal cameras, but you are able to define your custom camera like is shown in the [custom-camera-sender](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/custom-camera-sender) example. If you can run it in a different camera, please notify me via a [GitHub issue](https://github.com/hpsaturn/ESPNowCam/issues/new) or please contribute with the project sending a pull request :D\n\n### Channel\n\nIs possible to configure the radio channel or the WiFi channel. You should put the same channel on all devices. This setting is optional, and it is not mandatory, but could improve the connection.\n\n```cpp\nradio.setChannel(2);\nradio.init();\n```\n\n### PSRAM or DRAM?\n\nWell, in my last tests with different cameras and using QVGA frame size, seems that is better using the DRAM and the internal JPG. DRAM is more faster than PSRAM, and the internal compressor has a better quality with the same JPGQ level, but it uses more bandwidth, on the other hand the result is so good on P2P mode.\n\nFor change to DRAM and the internal JPG, you are able to pre-configure it like this:\n\n```cpp\nCamera.config.pixel_format = PIXFORMAT_JPEG;\nCamera.config.frame_size = FRAMESIZE_QVGA;\nCamera.config.fb_count = 2;\nCamera.config.fb_location = CAMERA_FB_IN_DRAM;\n```\n\nmore details in the sample [xiao-internal-jpg-sender](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/xiao-internal-jpg-sender).\n\n## Examples\n\n[![Tank Example - Video demo](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/tank_example.jpg)](https://youtu.be/nhLr7XEUdfU) [![ESPNowCam Broadcasting - Video demo](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/broadcasting_example.jpg)](https://youtu.be/zXIzP1TGlpA) [![Multi camera - Video demo](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/master/pictures/multi-camera.jpg)](https://youtu.be/ip6RohVEg2s)\n\nFor install and run the [examples](https://github.com/hpsaturn/ESPNowCam/tree/master/examples), first install [PlatformIO](http://platformio.org/) open source ecosystem for IoT development compatible with **Arduino** IDE and its command line tools (Windows, MacOs and Linux). Also, you may need to install [git](http://git-scm.com/) in your system.\n\nThen compile and install each sample, only choose one of them **ENV names** in [the table](https://github.com/hpsaturn/ESPNowCam/tree/master/examples/README.md), and run the next command in the root of this project, like this:\n\n```bash\npio run -e m5cores3-espnow-receiver --target upload\n```\n\nSome examples are for Arduino users (*.ino samples), but is possible too compile and install it from PlatformIO, only needs run the next command into each directory:\n\n ```bash\n pio run --target upload\n ```\n\n### Camera CLI\n\nAlso I'm working in a complete Camera configurator and test suite for this library and also other features around the ESP Cameras. It is a project in progress, but you are able to configure and test all ESPNowCam features more easy using a [CLI and manager](https://github.com/hpsaturn/esp32-camera-cli) that runs into the Camera:\n\n[![ESP32 Camera CLI](https://raw.githubusercontent.com/hpsaturn/ESPNowCam/refs/heads/master/pictures/esp32_camera_cli_preview.jpg)](https://github.com/hpsaturn/esp32-camera-cli)\n\n[![ESP32 Camera CLI Demo](https://img.youtube.com/vi/ibuKil7jjsg/maxresdefault.jpg)](https://youtu.be/ibuKil7jjsg)\n\n[video demo](https://youtu.be/ibuKil7jjsg)\n\n## Troubleshooting\n\n\u003e [!NOTE]\n\u003eTo increase the performance, **the recommended use is the 1:1 mode**, and also is a good practice to configure the other radio senders around of this device in this mode, because if you have other senders in broadcasting mode together, them could be generating interference.\n\u003e\n\u003eThe **Freenove camera** sometimes needs good power cable and also takes some seconds to stabilization, that means, that not worries for initial video glitches.\n\u003e\n\u003e**pb_decode.h error**: For **Arduino IDE users**, if you have a compiler error, maybe you forget install **NanoPb library**. Please see above in [library installation](#library-installation) section.\n\n\u003e [!TIP]\n\u003e This project was developed and thoroughly tested on PlatformIO. While I did compile and execute it successfully on Arduino IDE using Espressif 2.0.11 and Arduino IDE 2.2.1, with PSRAM enabled, I generally avoid using Arduino IDE due to its tendency to mix everything and its buggy nature. Therefore, **I highly recommend using PlatformIO** for a smoother and more reliable development experience.\n\n## TODO\n\n- [x] NanoPb possible issue #1 (payload size)\n- [x] Unified ESPNow in an one class for all transmitters and receivers\n- [x] Isolate the ESPNow Receiver and Transmitter in a seperated library\n- [x] Add sender callback to improve speed\n- [x] Added internal drivers for some popular Cameras\n- [x] Added multi-camera support with one only target\n- [x] Migration to esp_wifi_80211_tx() to improve Payload and Quality\n\n## Credits\n\nI want to extend my gratitude to:\n\n[@ElectroZeusTIC](https://github.com/electrozeustic) and [@AcoranTf](https://github.com/AcoranTf) for testing on Arduino IDE.  \n[@UtaAoya](https://x.com/UtaAoya) for findings related to the M5UnitCam device.  \n[@MeloCuentan](https://github.com/MeloCuentan) for fixing issues with the AI-Thinker Camera and the new ESP32S3 RGB receiver.  \n[@turmandreams](https://github.com/turmandreams) for tests on the AI-Thinker Camera and the M5Core receiver.  \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpsaturn%2Fespnowcam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpsaturn%2Fespnowcam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpsaturn%2Fespnowcam/lists"}