Error in code for roller blind

this is the project i am trying to build: Printables
i got everything wired up fine.
on the coding side, when i try to use his codes and i got errors all over the place config tung.txt - Google Drive
any idea what his testblind.yaml is or what’s in it?

I have updated the original as it was out of date. You will still have to make modifications for your stepper motor.

The main changes are

From:

esphome:
  name: $devicename
  platform: ESP8266
  board: d1_mini
  esp8266_restore_from_flash: True
  on_boot:

to

esp8266:
  board: d1_mini
  restore_from_flash: True
esphome:
  name: $devicename
  on_boot:

You’re also missing the encryption key, don’t forget to set it up in secrets.yaml; unless you just put your encryption key instead of !secret enc_key

api:
  encryption:
    key: !secret enc_key

and I don’t think you can use stepper as a stepper ID, change it back to mystepper

OK, try that then :slight_smile:

@tung256 You are using an ESP32, try this instead

esp32:
  board: nodemcu-32s
esphome:
  name: roller-right
  on_boot:

The rest of the above reply still applies.

thank you for updating your code to work with the uln2003 driver. i compiled and no errors came up!

this is my file updated to work with the ESP32 and TMC2208 driver, i get a bunch of errors as seen here

Change id: my_stepper to id: $mystepper

stepper:
  - platform: a4988
    id: $mystepper

See how that goes.

The information is in the error text.

thanks! error went away.
it refuses to connect to my wifi network, even though i disabled my 5ghz band. will try again tomorrow…

im happy to say it finally works!
used this whole code of yours as seen here. compiled to get the bin file. next, i flashed the board using this link i used the ESPHome flasher at Web - ESPHome
i dont know why my easyFlasher exe program does not work after days of troubleshooting.

one of the thing i noticed is that my Nema 17 is extremely slow. this is the value from the guy using the nema 17 motor

is there anyway to boost up the speed? if i use your code, would it boost the speed? im not sure if your code is compat with this nema 17.
image

the only reason i am using nema 17 is because the motor in your code is not powerful enough to lift my big heavy roller shade.

Yes :slight_smile: It’s the variable/substitute for max_speed:

See Docs

ok. thanks for confirming.

1 of the thing i noticed now is that if i unplug power, and plug back in, the memory is gone. meaning i have to run set up again. is there anyway to make it remember the position?
today, the shade was opened. i unplugged. plugged back in power. when i hit the close button, it closed but the motor would not stop when it reached the closed position.

all issues resolved thanks to @RoadkillUK !!!
i made this video so others know how to make one themselves a lot easier DIY your own automatic roller shade for big, or small windows - YouTube hope that helps.

1 Like

looks like i need more torque for an even bigger roller shade.
can i use the same code of the nema 17 for the bigger Nema 23 motor? if not, which part of the esphome yml code must i change?

Yes, I can’t see why the same code wouldn’t work, it’s just a larger motor.

1 Like