Reading RC servo pwm input on ESP32S3?

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
_joshu
 
Posts: 4
Joined: Fri Mar 24, 2023 11:32 pm

Reading RC servo pwm input on ESP32S3?

Post by _joshu »

I'm trying to read a remote control PWM on an Unexpected Maker FeatherS3 (ESP32S3) in CircuitPython using pulseio.PulseIn. I never see anything, however. Am I barking up the wrong tree?

Code: Select all

import pulseio
import board

print("starting")
pulse1 = pulseio.PulseIn(board.IO33)

while True:
    if pulse1.paused == True:
        pulse1.resume()
    if len(pulse1) > 0:
        print(list(pulse1))
        pulse1.clear()

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by mikeysklar »

There were issues with PulseIn on the ESP32-S3 based chips.

Are you running the latest CircuitPython 8.x and libraries? The most recent patch went in on Jan 24th.

https://github.com/adafruit/circuitpython/issues/5909
https://github.com/adafruit/circuitpython/pull/5912

User avatar
_joshu
 
Posts: 4
Joined: Fri Mar 24, 2023 11:32 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by _joshu »

Yes, I am current: Adafruit CircuitPython 8.0.3 on 2023-02-23; FeatherS3 with ESP32S3

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by mikeysklar »

Can you install the current latest stable CircuitPython 8.0.4 and latest libs?

This is probably an issue with pin number naming. IO33 might also go by

Code: Select all

board.D5
If the problem persists you can reports issues with the CircuitPython github repo or Unexpected Maker discord. You just need to be current release before doing so.

User avatar
_joshu
 
Posts: 4
Joined: Fri Mar 24, 2023 11:32 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by _joshu »

Ok. I did this with a fresh board. Upgraded to 8.04 ("Adafruit CircuitPython 8.0.4 on 2023-03-15; FeatherS3 with ESP32S3"). No libs needed so not installed.

Wired it to a different pin by accident (board.D12), and this code does not ever emit anything. Otherwise identical code (different IO pin) works fine on 8.0.4 on a Pico. I guess I will open an issue.

Code: Select all

import board, pulseio
p = pulseio.PulseIn(board.D12)
print(p.paused)
while True:
    if len(p) >0:
        print(p[0])
        p.clear()

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by mikeysklar »

Okay, thank you for doing the update and trying another pin.

I don't have this board on hand to confirm, but it would be a good idea to do what I mentioned in the last post.

1) Ask if this is a known issue on the Unexpected Maker discord.

2) Open an issue with the CircuitPython github repo.

User avatar
_joshu
 
Posts: 4
Joined: Fri Mar 24, 2023 11:32 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by _joshu »

https://github.com/adafruit/circuitpython/issues/7817

I did ask on the discord at the beginning; they didn't think it was their issue.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Reading RC servo pwm input on ESP32S3?

Post by mikeysklar »

Thank you for opening the issue. It looks like you are getting some response and testers trying to reproduce the pwm input issue.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”