{"id":18003023,"url":"https://github.com/zmactep/rickroll-wristband","last_synced_at":"2026-05-09T10:14:34.615Z","repository":{"id":143004064,"uuid":"567729446","full_name":"zmactep/rickroll-wristband","owner":"zmactep","description":"T-Wristband watch app with secret rickroll function","archived":false,"fork":false,"pushed_at":"2022-12-06T06:57:05.000Z","size":1057,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-09T19:53:34.387Z","etag":null,"topics":["esp32","lilygo","micropython","rickroll","t-wristband","wifi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmactep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-18T12:47:43.000Z","updated_at":"2023-08-09T04:56:17.000Z","dependencies_parsed_at":"2023-03-23T23:19:22.540Z","dependency_job_id":null,"html_url":"https://github.com/zmactep/rickroll-wristband","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmactep%2Frickroll-wristband","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmactep%2Frickroll-wristband/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmactep%2Frickroll-wristband/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmactep%2Frickroll-wristband/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmactep","download_url":"https://codeload.github.com/zmactep/rickroll-wristband/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149489,"owners_count":20891954,"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","lilygo","micropython","rickroll","t-wristband","wifi"],"created_at":"2024-10-29T23:25:10.111Z","updated_at":"2026-05-09T10:14:29.596Z","avatar_url":"https://github.com/zmactep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"RickRoll Wristband\n==================\n\n[![](https://img.youtube.com/vi/4qXFLblkhrk/0.jpg)](https://youtu.be/4qXFLblkhrk)\n\n## What is it?\n\nThis is a project of a wearable watch with a secret\n[rickroll spam](https://github.com/spacehuhn/esp8266_beaconSpam) Wi-Fi function based on a \n[LilyGo T-Wristband](https://www.lilygo.cc/products/t-wristband) device.\nThe watch uses deepsleep mode to reduce power consuption and also has\ndebug mode, that loads webrepl via Wi-Fi (station or access point mode).\n\nThis repository contains:\n- Custom MicroPython-1.19.1 [firmware](https://github.com/zmactep/rickroll-wristband/tree/master/firmware) for ESP32\n- Instruction how to build your own for a different version\n- A [code](https://github.com/zmactep/rickroll-wristband/tree/master/src) of watch app with rickroll function\n\n## Special thanks\n\n- MicroPython ([micropython/micropython](https://github.com/micropython/micropython))\n- ST7789_mpy ([russhughes/st7789_mpy](https://github.com/russhughes/st7789_mpy))\n\n## How to build\n\n### Step 1\n\nDownload last MicroPython stable version (e.g. 1.9.1), st7789_mpy driver and esp-idf tool:\n```bash\ngit clone -b v1.9.1 https://github.com/micropython/micropython.git\ngit clone https://github.com/russhughes/st7789_mpy.git\ngit clone -b v4.4.3 --recursive https://github.com/espressif/esp-idf.git\n```\n\n### Step 2\n\nInstall `esp-idf` and activate it. **Make sure that you use non-virtualenv python.**\n```bash\ncd esp-idf\n./install.sh\n. ./export.sh\ncd ..\n```\n\n### Step 3\n\nBuild `mpy-cross` tool:\n```bash\ncd micropython/mpy-cross\nmake\ncd ../..\n```\n\n### Step 4\n\nInsert two additional functions into ESP32 `network.WLAN`: `esp_wifi_set_channel` and `esp_wifi_80211_tx`. The first one is used\nto select specific channel and the second we can use to transfer some raw data package.\nYou can find a place to put them at `micropython/ports/esp32/network_wlan.c`.\nIf you use `1.19.1` version of MicroPython you can simple apply the [patch](https://github.com/zmactep/rickroll-wristband/blob/master/network_wlan.c.patch) in this repo. Otherwise you have to add two includes:\n```c\n#include \"py/objarray.h\"\n#include \"py/binary.h\"\n```\n\nAnd two functions:\n```c\nSTATIC mp_obj_t network_wlan_channel(mp_obj_t self_in, mp_obj_t channel) {\n    wifi_mode_t mode;\n    esp_exceptions(esp_wifi_get_mode(\u0026mode));\n    if ((mode \u0026 WIFI_MODE_STA) == 0) {\n        mp_raise_msg(\u0026mp_type_OSError, MP_ERROR_TEXT(\"STA must be active\"));\n    }\n\n    mp_int_t wifi_channel = 0;\n    if (mp_obj_get_int_maybe(channel, \u0026wifi_channel)) {\n        esp_exceptions(esp_wifi_set_channel(wifi_channel, WIFI_SECOND_CHAN_NONE));\n    } else {\n        mp_raise_msg(\u0026mp_type_TypeError, MP_ERROR_TEXT(\"Channel must be integer value\"));\n    }\n\n    return mp_const_none;\n}\nSTATIC MP_DEFINE_CONST_FUN_OBJ_2(network_wlan_channel_obj, network_wlan_channel);\n```\n\n```c\nSTATIC mp_obj_t network_wlan_sendraw(size_t n_args, const mp_obj_t *args) {\n    wifi_mode_t mode;\n    esp_exceptions(esp_wifi_get_mode(\u0026mode));\n\n    bool en_sys_seq = 0;\n    if (n_args == 3) {\n        en_sys_seq = mp_obj_is_true(args[2]);\n    }\n\n    mp_obj_array_t* a_ptr = MP_OBJ_TO_PTR(args[1]);\n    if (a_ptr-\u003etypecode != BYTEARRAY_TYPECODE) {\n        mp_raise_msg(\u0026mp_type_TypeError, MP_ERROR_TEXT(\"Package must be a bytestring\"));\n    }\n\n    byte* packet = (byte*)a_ptr-\u003eitems;\n    size_t packet_len = a_ptr-\u003elen;\n\n    int result = esp_wifi_80211_tx(mode \u0026 WIFI_MODE_STA ? ESP_IF_WIFI_STA : ESP_IF_WIFI_AP, packet, packet_len, en_sys_seq);\n\n    return mp_obj_new_int(result);\n}\nSTATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(network_wlan_sendraw_obj, 2, 3, network_wlan_sendraw);\n```\n\nYou also have to add function objects into methods table:\n```c\nSTATIC const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {\n    ...\n     { MP_ROM_QSTR(MP_QSTR_channel), MP_ROM_PTR(\u0026network_wlan_channel_obj) },\n     { MP_ROM_QSTR(MP_QSTR_sendraw), MP_ROM_PTR(\u0026network_wlan_sendraw_obj) },\n};\n```\n\n### Step 5\n\nCopy some fonts from [st7789 c-module](https://github.com/russhughes/st7789_mpy):\n```bash\ncp st7789_mpy/fonts/bitmap/vga2_*.py micropython/ports/esp32/modules/\n```\n\nAnd build the firmware:\n```bash\nmake USER_C_MODULES=../../../../st7789_mpy/st7789/micropython.cmake FROZEN_MANIFEST=\"\" FROZEN_MPY_DIR=./modules\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmactep%2Frickroll-wristband","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmactep%2Frickroll-wristband","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmactep%2Frickroll-wristband/lists"}