Skip to content
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

GPIO Digital Interrupts using CDev report incorrect timestamps #86

Closed
CrazyIvan359 opened this issue Dec 20, 2020 · 0 comments · Fixed by #88
Closed

GPIO Digital Interrupts using CDev report incorrect timestamps #86

CrazyIvan359 opened this issue Dec 20, 2020 · 0 comments · Fixed by #88
Labels
bug Something isn't working GPIO GPIO Module

Comments

@CrazyIvan359
Copy link
Owner

CrazyIvan359 commented Dec 20, 2020

Describe the bug

On OrangePi Zero LTS running Armbian, CDev GPIO interrupt events are reporting timestamps representing system uptime in nanoseconds, instead of epoch nanoseconds. This results in MQTTany thinking that the debounce period has already elapsed and the debounce routine returns immediately. While this does not stop interrupts from working, it does render the debounce setting meaningless.

Expected behavior

Current epoch nanoseconds is on the order of 1.6×1018 (1,600,000,000,000,000,000).

Environment

  • MQTTany version: v0.12.0 and up
  • Platform: OrangePi Zero LTS running Armbian 20.08.2 (5.8.6-sunxi)

Logs

Example from OrangePi with incorrect timestamp:

[TRACE] [gpio    ] [core.gpio.pin.digital   ] Rising edge detected on pin GPIO00 with timestamp 1212347.025238s

Example from RPi3B+ with correct epoch timestamp with microsecond precision:

[TRACE] [gpio    ] [core.gpio.pin.digital   ] Rising edge detected on pin GPIO09 with timestamp 1608487231.162014s
@CrazyIvan359 CrazyIvan359 added bug Something isn't working GPIO GPIO Module labels Dec 20, 2020
@CrazyIvan359 CrazyIvan359 linked a pull request Dec 20, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GPIO GPIO Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant