Skip to content

PulseIn not implemented for ESP8266 #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jerryneedell opened this issue Mar 26, 2018 · 7 comments
Closed

PulseIn not implemented for ESP8266 #716

jerryneedell opened this issue Mar 26, 2018 · 7 comments

Comments

@jerryneedell
Copy link
Collaborator

jerryneedell commented Mar 26, 2018

When trying to use a DHT22 on an ESP8266 - this error is returned:

>>> import dht22_test
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dht22_test.py", line 7, in <module>
  File "adafruit_dht.py", line 190, in temperature
  File "adafruit_dht.py", line 143, in measure
  File "adafruit_dht.py", line 106, in _get_pulses
NotImplementedError: 

https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/adafruit_dht.py#L106

I did not see an issue for this so I am just creating this to track it.
edited to add link to pulsio code: https://github.com/adafruit/circuitpython/blob/master/ports/esp8266/common-hal/pulseio/PulseIn.c#L37

@jerryneedell
Copy link
Collaborator Author

It is also not implemented for the nrf52. Changed title.

@jerryneedell jerryneedell changed the title PulseIn not implemented for ESP8266 PulseIn not implemented for ESP8266 and NRF52 Mar 26, 2018
@tannewt tannewt added this to the 3.0 milestone Mar 26, 2018
@tannewt tannewt modified the milestones: 3.0, 4.0 May 24, 2018
@nickzoic
Copy link

nickzoic commented Jun 6, 2018

I've started working on this over at https://github.com/nickzoic/micropython/tree/circuitpython-nickzoic-716-pulseio-esp8266 ... still super sketchy at the moment and missing a lot of the API features.

@tannewt
Copy link
Member

tannewt commented Jun 7, 2018

@nickzoic Looks like a good start! You may be interested in my pending changes here too: master...tannewt:pulseio_too_fast

It's adding some handling for gracefully failing when the input signal causes the interrupt to swamp the main code.

@nickzoic
Copy link

nickzoic commented Jun 7, 2018

Interesting. I'm not sure if there's an equivalent for the '66 port, but there's possibly less need for it since communications are UART based ...
I was wondering about the pulse buffer overflow condition: perhaps it'd make more sense to pause if the ring buffer overflows and resume when you pop the ring buffer. At the moment it over-writes the earliest pulses, but quite often you're interested in the start of a packet ... and it'd also solve the swamping problem.

@nickzoic
Copy link

nickzoic commented Jun 8, 2018

OK, PulseIn in that branch is looking pretty good now, and can reliably receive IR remote control signals and can be used by the adafruit_dht library to interface to a DHT11.

PulseOut is on ongoing effort mostly because of the terrible state of ESP8266 PWM and microsecond timers.

tannewt pushed a commit that referenced this issue Jun 13, 2018
Switch to ets_delay_us but the PWM is still way too slow to be useful.
tannewt added a commit that referenced this issue Jun 13, 2018
…eio-esp8266

Implement pulseio.PulseIn and PulseOut for ESP8266 #716
@tannewt tannewt modified the milestones: 4.0.0 - Bluetooth, 4.0 Beta Jul 10, 2018
@dhalbert
Copy link
Collaborator

split off nrf52 issue into #1043.

@dhalbert dhalbert removed the nordic label Jul 17, 2018
@dhalbert dhalbert changed the title PulseIn not implemented for ESP8266 and NRF52 PulseIn not implemented for ESP8266 Jul 17, 2018
@sommersoft
Copy link

Closing since ESP8266 is fixed by #926, and nRF is split out.

Thanks @nickzoic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants