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 output in inverted mode starts in low level (ON) and toggling it always causes writing 0 (ON) to the correspondent pin #464

Open
3 tasks done
fantasmisiciliani opened this issue Apr 9, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fantasmisiciliani
Copy link

fantasmisiciliani commented Apr 9, 2023

Perform all steps below and tick them with [x]

  • Check the related part of the Documentation
  • Update openHASP to the latest version
  • Reproduce the issue and describe all steps

Describe the bug

I tested some GPIO outputs with relay type and inverted mode: on boot they start in low level (ON) and, when I toggle them, the function gpio_set_output_value() always writes 0 to the pin for both states ON and OFF.
I have a WT32-SC01 Plus with openHASP 0.7.0-rc2 flashed.

To Reproduce

1- Set up a GPIO output with relay type and inverted mode, restart the plate.
2- Measure the pin voltage level or call the command output## with no payload (## is the pin number)
3- Toggle it and measure the pin voltage or insert in the function gpio_set_output_value() an instruction that logs the value written on the digital output

Expected behavior

  • High level (OFF) (EDIT: or last state) on the pin on boot.
  • Low level on the pin when the output is turned ON and high level when it is turned OFF.

Screenshots or video

Here's a screenshot of the serial console (IP and MAC addresses are deleted), the code was modified only to introduce some LOG_WARNING:
bug_screenshot

@fantasmisiciliani fantasmisiciliani added the bug Something isn't working label Apr 9, 2023
@fvanroie fvanroie self-assigned this May 3, 2023
fvanroie pushed a commit that referenced this issue May 17, 2023
@fantasmisiciliani
Copy link
Author

fantasmisiciliani commented Sep 24, 2023

Tested 0.7.0-rc8 f28627c and I confirm that switching an output in inverted mode now works as expected.
But on boot it is still at ON state, that it means LOW level in case of cold boot and last logic level in case of warm boot (hardware output and firmware states not matching, see issue #476).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants