{"id":20830239,"url":"https://github.com/stone/gotaserver","last_synced_at":"2025-12-24T09:30:34.331Z","repository":{"id":142019642,"uuid":"90146822","full_name":"stone/gotaserver","owner":"stone","description":"A Simple http server for OTA upgrades of ESP8266/Arduino","archived":false,"fork":false,"pushed_at":"2019-05-13T15:02:15.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-12T09:07:30.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/stone.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":"2017-05-03T12:32:18.000Z","updated_at":"2024-06-19T06:43:50.563Z","dependencies_parsed_at":"2023-07-07T07:46:03.291Z","dependency_job_id":null,"html_url":"https://github.com/stone/gotaserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone%2Fgotaserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone%2Fgotaserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone%2Fgotaserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone%2Fgotaserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stone","download_url":"https://codeload.github.com/stone/gotaserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243179899,"owners_count":20249187,"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":[],"created_at":"2024-11-17T23:23:49.000Z","updated_at":"2025-12-24T09:30:34.292Z","avatar_url":"https://github.com/stone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GOTAserver\n\nA Simple http server for OTA upgrades of ESP8266/Arduino.\n\nThe main difference between the GOTAserver than placing a firmware on a regular HTTP server\n is that it only serves firmware to the connecting device if there's a newer version of the\n firmware. If there are no firmware noting gets served to the connecting device.\n\nChoose a directory, place your firmware files there, they need\nto be in the following format format: /project/[anything]_\u003cmajor\u003e.\u003cminor\u003e.\u003csuffix\u003e\nwhere [anything] can be an alpha numeric string describing firmware, \nlike fermentrack, sonoff. \u003cmajor\u003e and \u003cminor\u003e are\nints describing the version of the firmware and the directory is the project.\n\n***Examples:***\n\nDirectory layout:\n\n    /srv/firmwaredir/esp8266-sonoff/esp8266_1.0.bin\n    /srv/firmwaredir/esp8266-sonoff/esp8266_1.1.bin\n    /srv/firmwaredir/fermentrack/firmware_2.2.bin\n    /srv/firmwaredir/fermentrack/firmware_2.6.bin\n\nExample requests for above files:\n\n    /esp8266-sonoff/1.0/ Then esp8266_1.1.bin is served.\n    /esp8266-sonoff/1.1/ 404 Not Found (no need for update already got latest version).\n    /fermentrack/firmware_2.3.bin Then firmware_2.6.bin is served.\n    /fermentrack/firmware_0.1.bin Then firmware_2.6.bin is served.\n    /fermentrack/firmware_2.9.bin 404 Not Found (version later than our latest).\n\n\nConfiguration example:\n\n    {\n        \"FirmwareDir\": \"/srv/firmwaredir\",\n        \"FirmwareSuffix\": \"*.bin\",\n        \"ServerHostPort\": \"localhost:8082\"\n    }\n\n# Running GOTAserver\n\n    $ gotaserver -h\n    Usage of gotaserver:\n        -c string\n            Configuration file\n        -d string\n            Directory to serve firmware-files from (default \"firmwares\")\n        -p string\n            \u003chost\u003e:\u003cport\u003e to listen to (default \"127.0.0.1:8000\")\n        -s string\n            Suffix of files to use as firmware (default \"*.bin\")\n\n    $ gotaserver -c cfg.json\n    ============[ GOTAserver ]==================\n    Firmware Directory  : /srv/firmwaredir\n    Firmware Suffix     : *.bin\n    Server listening on : localhost:8082\n    ===========================================\n    2017/04/18 20:21:42 PRJ: fermentrack REQ-VERSION: 6.1 FOUND:  firmware_6.2.bin\n    2017/04/18 20:21:42 [GET] \"/fermentrack/6.1/\" 1.547301ms\n    2017/04/18 20:21:48 PRJ: fermentrack REQ-VERSION: 1.0 FOUND:  firmware_6.2.bin\n    2017/04/18 20:21:48 [GET] \"/fermentrack/1.0/\" 173.343µs\n    2017/04/18 20:22:04 Already got the latest version\n    2017/04/18 20:22:04 [GET] \"/fermentrack/6.9/\" 112.32µs\n    2017/04/18 20:22:09 Already got the latest version\n    2017/04/18 20:22:09 [GET] \"/fermentrack/6.2/\" 112.121µs\n    2017/04/18 20:22:13 PRJ: fermentrack REQ-VERSION: 6.1 FOUND: firmware_6.2.bin\n    2017/04/18 20:22:13 [GET] \"/fermentrack/6.1/\" 160.508µs\n\n\n# Arduino setup\n\n    #include \u003cArduinoOTA.h\u003e\n    #include \u003cESP8266HTTPClient.h\u003e\n    #include \u003cESP8266httpUpdate.h\u003e\n    #define OTA_SERVER 192.168.1.10:8080\n    #define PROJECT_NAME fermentrack\n    #define VERSION 1.1\n\n    void doHTTPUpdate() {\n        if (WiFi.status() != WL_CONNECTED) return;\n        t_httpUpdate_return ret = ESPhttpUpdate.update(\"http://\" OTA_SERVER \"/\" PROJECT_NAME \"/\", VERSION \"/\");\n        switch(ret) {\n            case HTTP_UPDATE_FAILED:\n                Serial.printf(\"HTTP_UPDATE_FAILED Error (%d): %s\\r\\n\", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());\n                break;\n            case HTTP_UPDATE_NO_UPDATES:\n                Serial.println(\"HTTP_UPDATE_NO_UPDATES\");\n                break;\n            case HTTP_UPDATE_OK:\n                Serial.println(\"HTTP_UPDATE_OK\");\n                break;\n        }\n    }\n\nArduinoOTA will make a request to:\nhttp://192.168.1.10:8080/fermentrack/1.1/\n\nGOTAserver will then serve the latest version of fermentrack firmware\nlocated in the directory firmwaredir/fermentrack/ and with our exampel above the file would be: firmware_2.6.bin. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone%2Fgotaserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstone%2Fgotaserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone%2Fgotaserver/lists"}