{"id":16251889,"url":"https://github.com/mcspr/nofuss","last_synced_at":"2025-07-28T06:08:51.604Z","repository":{"id":37583077,"uuid":"199731140","full_name":"mcspr/nofuss","owner":"mcspr","description":"Imported from https://bitbucket.org/xoseperez/nofuss","archived":false,"fork":false,"pushed_at":"2024-06-13T16:47:37.000Z","size":6904,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T12:39:12.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/mcspr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-07-30T21:37:58.000Z","updated_at":"2024-06-13T16:47:35.000Z","dependencies_parsed_at":"2024-11-04T17:02:56.471Z","dependency_job_id":null,"html_url":"https://github.com/mcspr/nofuss","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mcspr/nofuss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcspr%2Fnofuss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcspr%2Fnofuss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcspr%2Fnofuss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcspr%2Fnofuss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcspr","download_url":"https://codeload.github.com/mcspr/nofuss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcspr%2Fnofuss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267470062,"owners_count":24092352,"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-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-10-10T15:11:42.760Z","updated_at":"2025-07-28T06:08:51.578Z","avatar_url":"https://github.com/mcspr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **This is a fork of the [original Bitbucket repository](https://bitbucket.org/xoseperez/nofuss)**\n\n# NoFUSS\n\nNoFUSS is a **Firmware Update Server for ESP8266** modules. It defines a protocol and its implementation as a PHP service and a C++ client library so your devices can check for updates, download them and flash them autonomously.\n\n## The protocol\n\nCurrent version of the protocol is simple. The client device does a GET request to a custom URL along with some headers defining:\n\n|header|description|example|\n|-|-|-|\n|X-ESP8266-MAC|Device MAC address|5C:CF:7F:8B:6B:26|\n|X-ESP8266-DEVICE|Device type|SENSOR|\n|X-ESP8266-VERSION|Application version|0.1.0|\n|X-ESP8266-BUILD|Application build|611cdf3|\n\nThe URL can be anywhere your device can reach:\n\n```\nhttp://192.168.1.10/nofuss\n```\n\nHere you have an example call using cURL:\n\n```\ncurl -H \"X-ESP8266-MAC:5C:CF:7F:8C:1E:6F\" -H \"X-ESP8266-VERSION:0.1.0\" -H \"X-ESP8266-DEVICE:TEST\" http://192.168.1.10/nofuss\n```\n\nThe response is a JSON object. If there are no updates available it will be\nempty (that is: '{}'). Otherwise it will contain info about where to find the new firmware binaries:\n\n```\n{\n    'version': '0.1.1',\n    'firmware': '/firmware/sonoff-0.1.1.bin',\n    'spiffs': '/firmware/sonoff-0.1.1-spiffs.bin'\n}\n```\n\nBinaries URLs (for the firmware and the SPIFFS file system) are relative to the server URL, so following with the example, the device will first download the SPIFFS binary from:\n\n```\nhttp://192.168.1.10/nofuss/firmware/sonoff-0.1.1-spiffs.bin\n```\n\nflash it and if everything went fine it will download the firmware from:\n\n```\nhttp://192.168.1.10/nofuss/firmware/sonoff-0.1.1.bin\n```\n\nflash it too and then restart the board.\n\n## Installing the server\n\n### PHP\n\nThe PHP server implementation depends on [Slim Framework][3], [Monolog][4] and [Akrabat IP Address Middleware][5]. They are all set as dependencies in the composer.json file, so you just have to type `php composer.phar install` from the server folder.\n\nNext you will have to configure your webserver to configure the URLs. If you are using [Apache][6] then all you have to do is create a new service pointing to the ```server/public``` folder. The ```.htaccess``` file there will take care of the rest. If you are using [Nginx][7] the create a new site file like this one:\n\n```\nserver {\n\tlisten 80 default_server;\n\tserver_name nofuss.local;\n\troot /\u003cpath_to_project\u003e/server/php/public/;\n\ttry_files $uri $uri/ /index.php?$query_string;\n\tindex index.php;\n\tinclude global/php5-fpm.conf;\n}\n```\n\nMake sure the server has permissions to write on the ```logs``` folder.\n\n### PHP using Docker\n\nYou can use the `docker-compose.yml` file in the root of the repository to rise an instance of a local NoFUSS server using Nginx and PHP7-FPM. Just type:\n\n```\ndocker-compose up\n```\n\nThe docker container will use the code under `server/php` and, in particular, the database in `server/php/data/versions.json`.\n\n### NodeJS\n\nUser Alex Suslov ported the NoFUSS Server to NodeJS. You can check his repo [node-nofuss repo on GitHub](https://github.com/alexsuslov/node-nofuss).\n\n## Versions\n\nThe versions info is stored in the `data/versions.json` file. This file contains an array of objects with info about version matching and firmware files.\n\nThe `origin` key contains filters. The server will apply those filters to the requester info. Version matching is done using different operators:\n\n* `ge` or `min`: Reported version should be greater or equal than the target version\n* `gt`: Striclty greater than\n* `eq`: Strictly equal\n* `lt` or `max`: Less than target version\n* `le`: Less or equal\n\nNotice `max` and `min` are there for backwards compatibility and they are not symetric: \"more or equal\" for minimum version number and \"less or equal\" for maximum version number. \n\nAn asterisk (`*`) means \"any\" and it's equivalent to not specifying that key. If specified, the `device` and `mac` keys must match exactly. The `build_not` filter works slightly different. If defined and different than `*` it will match any request with non-empty `X-ESP8266-BUILD` header that's different from the defined in the rule. This is meant for different build of the same version (problably a development one?) and to avoid a loop it requires the requested to report the build explicitly.\n\nIf you define no filter (i.e. the `origin` key is empty) every request will match. \n\nThe `target` key contains info about version number for the new firmware and paths to the firmware files relative to the `public` folder. The `firmware` key must be always present. If there is no binary for \"firmware\" just leave it empty.\n\n```\n[\n    {\n        \"origin\": {\n            \"mac\": \"5C:CF:7F:8B:6B:26\",\n            \"device\": \"TEST\",\n            \"gt\": \"*\",\n            \"lt\": \"0.1.1\",\n            \"build_not\": \"3fe56a4\"\n        },\n        \"target\": {\n            \"version\": \"0.1.1\",\n            \"firmware\": \"/firmware/test-0.1.1.bin\",\n            \"spiffs\": \"\"\n        }\n    }\n]\n```\n\n## Using the client\n\nThe client library depends on [Benoit Blanchon's ArduinoJson][1] library. It is set as a dependency in the platformio.ini file, so if you use  [PlatformIO][2] it will automatically download.\n\nTo use it you only have to configure the global NoFUSSClient object with proper server URL, device name and version in your setup:\n\n```\nNoFUSSClient.setServer(NOFUSS_SERVER);\nNoFUSSClient.setDevice(DEVICE);\nNoFUSSClient.setVersion(VERSION);\n```\n\nAnd then call every so often ```NoFUSSClient.handle()``` to check for updates. You can also monitor the update flow providing a callback function to the ```onMessage``` method. Check the basic.cpp example for a real usage.\n\n[1]: https://github.com/bblanchon/ArduinoJson\n[2]: https://platformio.org\n[3]: http://www.slimframework.com/\n[4]: https://github.com/Seldaek/monolog\n[5]: https://github.com/akrabat/rka-ip-address-middleware\n[6]: https://httpd.apache.org/\n[7]: https://nginx.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcspr%2Fnofuss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcspr%2Fnofuss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcspr%2Fnofuss/lists"}