{"id":13615165,"url":"https://github.com/GoneUp/mask-go","last_synced_at":"2025-04-13T21:30:36.678Z","repository":{"id":176690173,"uuid":"615533627","full_name":"GoneUp/mask-go","owner":"GoneUp","description":"Control your \"shining\" LED mask with Golang","archived":false,"fork":false,"pushed_at":"2023-06-23T20:51:56.000Z","size":2257,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-07T23:39:11.584Z","etag":null,"topics":["go","golang","ledtik","shining-mask"],"latest_commit_sha":null,"homepage":"","language":"Go","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/GoneUp.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}},"created_at":"2023-03-17T23:27:00.000Z","updated_at":"2024-10-28T03:43:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f093e91-edd1-4143-8e0a-a8f42992643d","html_url":"https://github.com/GoneUp/mask-go","commit_stats":null,"previous_names":["goneup/mask-go"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoneUp%2Fmask-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoneUp%2Fmask-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoneUp%2Fmask-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoneUp%2Fmask-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoneUp","download_url":"https://codeload.github.com/GoneUp/mask-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248785838,"owners_count":21161357,"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":["go","golang","ledtik","shining-mask"],"created_at":"2024-08-01T20:01:10.128Z","updated_at":"2025-04-13T21:30:32.876Z","avatar_url":"https://github.com/GoneUp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# mask-go\nA shining mask implementation written in Golang. It is intended to be used with masks controlled by the Shining mask app.\n\nIt seems that there are several different vendor models avaialable, but they share the same app/protocol. E.g. `Lumen Couture LED Face Changing Mask`.\n\n[Play store link of the control app](https://play.google.com/store/apps/details?id=cn.com.heaton.shiningmask)\n\nFeatures: \n- Connection with mask over BLE (using tinygo.org/x/bluetooth)\n- Controlling the mask remotely (Brightness, Static image, Anmination, Text speed, Text color) \n- Uploading/showing text on the mask \n\n![](image.png)\n## Usage\nInstallation with\n`go get github.com/GoneUp/mask-go`\n\n\nSimple usage example\n```go\nimport \"github.com/GoneUp/mask-go/mask\"\n\nmask.InitAndConnect(true)\nmask.SetText(\"Hello world\")\n```\n\nA demo application is included in the [main.go](main.go) file.\n\nGoDoc can be found [here](https://pkg.go.dev/github.com/GoneUp/mask-go) \n## Protocol \nThe mask commuicates over Bluetooth LE with the mask. The protocol iself is fairly simply, however there is a AES ECB encryption. \n\nPlease review this reddit post, it contains all basic protocol details and the AES key used: https://www.reddit.com/r/ReverseEngineering/comments/lr9xxr/comment/h14nm39/?utm_source=reddit\u0026utm_medium=web2x\u0026context=3\n\nThe most complicated bit of the mask-go is the text upload. The mask just accepts a bitmap/colors in a very custom format. \nSo to upload text, we have to draw it to a bitmap, convert it accordingly to the protcol and send it in custom manner to the app.\n\nThe protocol is implemented in [mask.go](mask/mask.go) and [draw.go](mask/draw.go).\n\nBraindumping protocol details:\n\n```\nMethods \n\nccroll mode:\n05MODEnn \nnn 01 = steady\nnn 02 = blink\nnn 03 = scroll left\nnn 04 = scroll right\nnn 05 = steady\n\n\ncustom text front color:\n06FC\u003c00/01\u003e \u003cRR\u003e \u003cBB\u003e \u003cGG\u003e\n\ncustom text back color:\n06BC\u003c00/01\u003e \u003cRR\u003e \u003cBB\u003e \u003cGG\u003e\n\nspeed:\n06SPEEDnn\n\nset text color mode:\n03M\u003c00/01\u003e\u003c00-07\u003e\n\n00-03= text gradients \n05-07= background animations\n\nset light\n06LIGHTnn\n\nset image\n06IMAGnn\n\nset anmiation\n06ANIMnn\n\nset diy image\n06PLAY01nn\n\n\n\nText upload:\n\n\tUPLOAD PROCESS:\n\tDATS \u003e Mask\n\tMask \u003e DATSOKP\n\tper packet\n\t\tUpload ...\n\t\tMask \u003e REOK\n\tDATCP \u003e Mask\n\tMask \u003e DATCPOK\n\n09DATS - 2 byte total len - 2 byte bitmap len \n\nImage data:\nThe display of the mask is 16 pixel high, the data is sent accordingly per pixel colum. \nFor each pixel in a pixel colum a bit is set (on/off). For each colum there is also a RGB value. \n\nIn more formal form:\n  for each column:\n    column encoded in 2byte \n      b1: line 0-7, bit 0-7\n      b2: line 7-15, bit 0-7\n  for each colum\n    3 byte RGB\n\n\n\nexample: 8 colums, 12b pixels, 24b color = 36byte\nFFFF0000 FFFF0000 FFFF0000 FFFF0000  FF0000 FF0000 00FF00 00FF00 FF0000 FF0000 00FF00 00FF00\n\nImplemented in draw.go\n\nsending in the format of max 100b packets:\n  \u003clen with count\u003e\u003cpkt count\u003e\u003cdata, max 98b\u003e\n```\n\n\n## Credits\n\nI was able to learn a lot from other open-source code:\n\nAll peeps in this reddit thread https://www.reddit.com/r/ReverseEngineering/comments/lr9xxr/help_me_figure_out_how_to_reverse_engineer_the/\n\nbeclaminde with this project https://github.com/beclamide/mask-controller\n\nshawnrancatore with this hacky project https://github.com/shawnrancatore/shining-mask\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoneUp%2Fmask-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGoneUp%2Fmask-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoneUp%2Fmask-go/lists"}