Help. ESP32 WROOM-32D board doesn't work with pins or PWM

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by androiddrew » Tue Apr 13, 2021 3:09 am

Hey guys I bought 3 of the Hiletgo ESP32-WROOM-32D dev kits and all of them don't seem to work with the ESP32 binaries posted on the downloads page. At first I was trying to use PWM to drive a servo and nothing was happening, then I just attempted to use the built in LED on pin15 and those don't respond either. Do the binaries available only support the older ESP32 module? I have one of the older WROOM modules and all the code works just fine.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by Roberthh » Tue Apr 13, 2021 6:16 am

Can you load the firmware?
Do you get a REPL prompt at the USB/Serial interface?

androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by androiddrew » Tue Apr 13, 2021 3:04 pm

Yes, I can load the firmware and I get a REPL.

I uploaded an arduino sketch to the board too. I can confirm that the Built in LED will toggle using the Arduinio code.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by Roberthh » Tue Apr 13, 2021 3:20 pm

Can you show us the Python commands you used to driver the LED or PWM?

androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by androiddrew » Wed Apr 14, 2021 10:49 pm

Roberthh wrote:
Tue Apr 13, 2021 3:20 pm
Can you show us the Python commands you used to driver the LED or PWM?
You can view the code I am using here https://git.runcible.io/embedded/microp ... m/servo.py. I am certain that this code works as I have another ESP32 dev kit from a different manufacture where it was running successfully. My concern is that the generic .bin provided from the downloads page of micropython.org doesn't work with with this nodeMCU ESP32-S dev kit (https://www.amazon.com/gp/product/B0718 ... UTF8&psc=1).

If I need to build a different version from source I can start that process but looking under https://github.com/micropython/micropyt ... p32/boards I don't see a ESP32-D0WD section.

stanely
Posts: 55
Joined: Fri Jan 17, 2020 5:19 am
Location: Ohio, USA

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by stanely » Wed Apr 14, 2021 11:43 pm

The code I saw from your link has no main(). It just defines a class and some methods. You have to have some code to actually do something.

stanely
Posts: 55
Joined: Fri Jan 17, 2020 5:19 am
Location: Ohio, USA

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by stanely » Wed Apr 14, 2021 11:44 pm

I think you need something like this, https://git.runcible.io/embedded/microp ... wm/main.py

stanely
Posts: 55
Joined: Fri Jan 17, 2020 5:19 am
Location: Ohio, USA

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by stanely » Wed Apr 14, 2021 11:52 pm

Try adding some print statements in your code so you can see what it's doing in the REPL. I bought Hiletgo stuff on Amazon before and it's all been fine. BTW, schematic says internal LED is on IO2 on physical pin 15 not Pin 15. You would refer to it as Pin 2. That may be the problem with the motor pins too.

androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by androiddrew » Thu Apr 15, 2021 6:53 pm

stanely wrote:
Wed Apr 14, 2021 11:44 pm
I think you need something like this, https://git.runcible.io/embedded/microp ... wm/main.py
I actually had a servo_main.py file that I renamed to main.py when I uploaded it. https://git.runcible.io/embedded/microp ... vo_main.py.

I did resolve the issue. It was neither the code nor the binary. Turns out I did not correctly have the ground of the servo and ground of the board set in my breadboard...I was one pin off. The PWM signal of course is in reference to the board's ground. In the setup I had on the Hiletgo bread board it was inadvertently disconnected, while on my separate ESP32 DEVKITV1 it was correctly connected.

Thank you for looking at my code. I appreciate it guys!

androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Re: Help. ESP32 WROOM-32D board doesn't work with pins or PWM

Post by androiddrew » Thu Apr 15, 2021 6:55 pm

stanely wrote:
Wed Apr 14, 2021 11:52 pm
Try adding some print statements in your code so you can see what it's doing in the REPL. I bought Hiletgo stuff on Amazon before and it's all been fine. BTW, schematic says internal LED is on IO2 on physical pin 15 not Pin 15. You would refer to it as Pin 2. That may be the problem with the motor pins too.

Yes, in my frustration I neglected to refer back to the documentation, and was instead using the physical pin number when attempting to toggle the LED.

Post Reply