TASMOTA now supports the A4988 stepper-motor controller

As of a couple of days ago,  courtesy of Tim Leuschner, TASMOTA now supports the A4988 stepper-motor controller board.  Here are Tim’s instructions for getting it going:-

How to use:-

1. Physically connect at least Dir-&STP-Pin of the A4988 to 2 free GPIO’s of the ESP.
2. Allocate those GPIOS in settings to “A4988 pins” (#170ff).
3. In console type MOTOR {“setMIS”:1,”setRPM”:60,”setSPR”:200,”doTurn”:1.5} (sets microstepping to 1/1, StepsPerRevolution to 200, RevolutionsPerMinute to 60 and commands the motor to turn one and a half rotations).
MOTOR {“doMove”:100} commands the motor to step 100 times.
MOTOR {“doRotate”:360} commands the motor to rotate 360 degrees.
4. REST-Calls work with : http:///cm?user=aName&password=aPW&cmnd=MOTOR%20{%22setSPR%22:200,%22setRPM%22:60,%22doMove%22:360}

Command list:-

setMIS — Sets the micro-stepping (1,2,4,8,16 stand for a full step, or one-half, one-quarter, one-eighth or one-sixteenth of a step).
setSPR — Sets the number of steps the motor requires for one full rotation (depends on micro-stepping).
setRPM — Sets the number of revolutions per minute (roughly – not precise) – if too high, motor will not turn – test out an appropriate number for your use case.
doMove — Commands the motor to step the given number of times.
doRotate — Commands the motor rotate the given number of degrees.
doTurn — Commands the motor to spin the given number of rotations.

Tim is also looking for a little help with the MQTT implementation of the command set:-

Can someone plz take care to enable the MQTT-way to send this commands?Cheers Tim

Any takers?

A more detailed instruction sheet on how to set up the A4988 (with power switching and control of micro-stepping using additional GPIOs) has already been added to the Wiki by the hard-working maintainers (I don’t know how they keep up with all of the updates).