{"id":44634755,"url":"https://github.com/cwi-dis/iotsamotorserver","last_synced_at":"2026-02-14T17:20:44.000Z","repository":{"id":97041174,"uuid":"89700415","full_name":"cwi-dis/iotsaMotorServer","owner":"cwi-dis","description":"This is a wifi http server to control a steppermotor, which can then be used to move something, under control of a REST interface. It is built using the iotsa framework for ESP8266.","archived":false,"fork":false,"pushed_at":"2025-04-27T20:55:38.000Z","size":516,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-09-10T07:40:49.068Z","etag":null,"topics":["esp8266-arduino","iot","iotsa"],"latest_commit_sha":null,"homepage":"","language":"C++","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/cwi-dis.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-04-28T11:35:44.000Z","updated_at":"2025-04-27T20:55:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a614cc7-936f-4255-b5ac-2c95ef22cf42","html_url":"https://github.com/cwi-dis/iotsaMotorServer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cwi-dis/iotsaMotorServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwi-dis%2FiotsaMotorServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwi-dis%2FiotsaMotorServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwi-dis%2FiotsaMotorServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwi-dis%2FiotsaMotorServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwi-dis","download_url":"https://codeload.github.com/cwi-dis/iotsaMotorServer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwi-dis%2FiotsaMotorServer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29450850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["esp8266-arduino","iot","iotsa"],"created_at":"2026-02-14T17:20:43.466Z","updated_at":"2026-02-14T17:20:43.994Z","avatar_url":"https://github.com/cwi-dis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iotsaMotorServer - web server to drive a stepper motor\n\n![build-platformio](https://github.com/cwi-dis/iotsaMotorServer/workflows/build-platformio/badge.svg)\n![build-arduino](https://github.com/cwi-dis/iotsaMotorServer/workflows/build-arduino/badge.svg)\n\nThis is a wifi http server to control a steppermotor, which can then be used to move something, under control of a REST interface. It is built using the iotsa framework for ESP8266.\n\nHome page is \u003chttps://github.com/cwi-dis/iotsaMotorServer\u003e.\nThis software is licensed under the [MIT license](LICENSE.txt) by the   CWI DIS group, \u003chttp://www.dis.cwi.nl\u003e.\n\nOne application that has been built with this server is a device that moves a plant (or anything else) up and down, so you can use the height of the plant to visualise the value of a variable. An example of such a variable would be your current electricity consumption, the temperature (inside or outside), the number of minutes until it starts to rain again, or any other scalar value you can find on the internet.\n\nAt the moment minimum and maximum position and conversion rate of values to steps are hard-coded, so you need to modify the code to change these.\n\n## Software requirements\n\n* Arduino IDE, v1.6 or later.\n* The iotsa framework, download from \u003chttps://github.com/cwi-dis/iotsa\u003e.\n* The AccelStepper library by Mike McCauley, download from \u003chttp://www.airspayce.com/mikem/arduino/AccelStepper/\u003e.\n\n## Hardware requirements\n\n* a iotsa board. Alternatively another esp8266 board, such as an ESP-12 or ESP-201 can also be used.\n* A stepper motor (5-12v) such as the 28BYJ-48 (5 volt 4-input halfstep motor).\n* An ULN2003A (darlington driver array).\n* A microswitch to detect the minimum position, and optionally a second one to detect maximum position.\n* Mechanical hardware to put everything together.\n\n## Electronics\n\nIn _extras/fritzing_ you find a Fritzing schematic to allow you to build the server plus the steppermotor driver. As-is the code is meant to interface to a 5-wire steppermotor such as the cheap and popular 28BYJ-48 (5 volt 4-input halfstep motor), but similar motors should work as well. For other motors (fullstep, different wiring) you will need to modify the code.\n\nYou don't need Fritzing to build the board, if you have a iotsa board there is a schematic in [extras/fritzing/IotsaMotorServerBoard.pdf](extras/fritzing/IotsaMotorServerBoard.pdf) to show you how to populate the board. The iotsa board can handle 12 volt, so you can use a 12v stepper motor if that is more convenient.\n\n## Mechanics\n\nIf you want to build an assembly to pull a plant up and down (or anything else up to a weight of about 500 grams) you can find a 3D-printable design at \u003chttp://www.thingiverse.com/thing:2281030\u003e. \n\nThe Thingyverse page has links to the Tinkercad files, you will probably need to tweak the design a little to fit your application.\n\nThe page also has assembly intructions.\n\n## Building the software\n\nNear the top you need to define `numMotors` and parameters such as `STEPS_PER_MM`. Most of these will have to be determined using trial and error. `DETECT_LIMIT` governs whether a second microswitch is used (to determine the maximum position, you need at least one microswitch to determine minimum position).\n\nNext you specify GPIO pins for the stepper motor(s) and the microswitch(es).\n\nNow compile, and flash either using an FTDI or (if your esp board supports it) over-the-air.\n\n## Operation\n\nThe first time the board boots it creates a Wifi network with a name similar to _config-iotsa1234_.  Connect a device to that network and visit \u003chttp://192.168.4.1\u003e. Configure your device name (let's say _motor_, as an example), WiFi name and password, and after reboot the iotsa board should connect to your network and be visible as \u003chttp://motor.local\u003e.\n\nThere is nothing more to configure in the web interface, all settings are made in the code. This is on purpose: settings like GPIO pins used and number of steps needed to raise the object 1mm depend on the hardware and not changeable on the fly.\n\nWhen the board is powered on (or reset) it will start pulling in the wire until the microswitch engages, to determine the zero position, and then move back a few millimeter. You will probably need to fiddle the microswitch and the end stop hardware to get this to work consistently.\n\nThe server provides a REST-like interface on \u003chttp://motor.local/stepper\u003e and \u003chttp://motor.local/stepper/0\u003e for reading the current state. Changing positions, however, is done with an _http GET_ request to \u003chttp://motor.local/stepper/0?pos=123\u003e, which will set _target_ to _123_ millimeter and start moving there.\n\nIf you move to a large negative value the zero-limit microswitch will engage, the motor will stop and the position will be set to zero. This can be used to recalibrate (without rebooting), if needed.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwi-dis%2Fiotsamotorserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwi-dis%2Fiotsamotorserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwi-dis%2Fiotsamotorserver/lists"}