gpio_viewer icon indicating copy to clipboard operation
gpio_viewer copied to clipboard

ESPHome functionality

Open JoeAverge9 opened this issue 2 years ago • 31 comments

Would it be possible to enable this within the ESPHome project? https://www.esphome.io/

JoeAverge9 avatar Jan 05 '24 15:01 JoeAverge9

I also found a similar request going the other way. Not sure where the best place for this request should be. https://github.com/esphome/feature-requests/issues/2546

JoeAverge9 avatar Jan 05 '24 15:01 JoeAverge9

I don't know ESPHome. Are you creating a sketch when working with ESPHome ?

thelastoutpostworkshop avatar Jan 05 '24 16:01 thelastoutpostworkshop

I don't know ESPHome. Are you creating a sketch when working with ESPHome ?

ESPHome is a declarative framework for programing ESP32 and ESP8266 dev boards

JoeAverge9 avatar Jan 05 '24 16:01 JoeAverge9

Can you import libraries ?

thelastoutpostworkshop avatar Jan 05 '24 16:01 thelastoutpostworkshop

Can you import libraries ?

I do not know for sure but depending on what you declare in the YAML config I believe this happens during the compile process before upload.

JoeAverge9 avatar Jan 05 '24 16:01 JoeAverge9

I will have a look at their documentation, if they don't allow third party libraries, there is not much I will able to do

thelastoutpostworkshop avatar Jan 05 '24 16:01 thelastoutpostworkshop

ESPHome does allow importing external components using the 'external' component:

  • https://esphome.io/components/external_components.html

@thelastoutpostworkshop : Would be great if I knew what to import.

I am willing to test this and contribute to documenting.

T.

trantoriana avatar Jan 07 '24 13:01 trantoriana

Thanks a lot for the info and sure I will need help for testing.

thelastoutpostworkshop avatar Jan 07 '24 13:01 thelastoutpostworkshop

It looks like the source needs to be rearrange in a specific format to allow ESPHome to import such a 'component', as per:

  • https://esphome.io/guides/contributing#contributing-to-esphome

Perhaps core developers of ESPHome are willing to contribute turning GPIOViewer into such a component.

Fingers crossed

trantoriana avatar Jan 07 '24 14:01 trantoriana

Yes and some people open issues on it, on the ESPHome repository

thelastoutpostworkshop avatar Jan 07 '24 14:01 thelastoutpostworkshop

It appears, that IDF is needed for ESPHome, currently GPIOViewer library is based on the Arduino Framework. So a port to IDF is needed, I do not know at this point the amount of work this port will required.

thelastoutpostworkshop avatar Jan 07 '24 17:01 thelastoutpostworkshop

If i'd only knew what this means, but it seems possible to create a arduino based library as component in IDF.

At least, that is what it looks like they done here:

  • https://github.com/sukesh-ak/Arduino-Library-with-IDF

Perhaps a similar method can be used here ??

trantoriana avatar Jan 07 '24 20:01 trantoriana

Thanks I will look into it

thelastoutpostworkshop avatar Jan 07 '24 21:01 thelastoutpostworkshop

Yes, you can.

oka4henry avatar Jan 16 '24 17:01 oka4henry

So, is it possible to use GPIO Viewer with ESPHome?

platte-73 avatar Jan 17 '24 14:01 platte-73

I think so, if someone wants to submit PRs for it, you are welcomed.

thelastoutpostworkshop avatar Jan 17 '24 23:01 thelastoutpostworkshop

First, this is an awesome capability. Second, I am +1 for the functionality being on ESPHome. Has anyone started the effort yet? I am on board to help.

tache avatar Feb 06 '24 20:02 tache

Nobody submitted PRs for this yet, your are welcome to contribute.

thelastoutpostworkshop avatar Feb 06 '24 23:02 thelastoutpostworkshop

Going to give it a go, but got to get up to speed on ESPHome component development and then off to the races.

tache avatar Feb 07 '24 06:02 tache

Thanks, I do not know how much of a learning curve it is.

thelastoutpostworkshop avatar Feb 07 '24 11:02 thelastoutpostworkshop

I really like this functionality and I really hope someone makes it come to pass. Not much good on coding mysel sadly 🤔

erazor666 avatar Feb 11 '24 21:02 erazor666

+1

mikulik86 avatar Feb 12 '24 07:02 mikulik86

+1

AJ-Github-Account avatar Mar 02 '24 11:03 AJ-Github-Account

wow this would be so helpful

playerfreak avatar Mar 05 '24 12:03 playerfreak

Yes, GPIOViewer in ESPHome would be a perfect addition! Hope someone gets it working :-)

Joo01 avatar Mar 06 '24 09:03 Joo01

This looks great, just found it and am also interested in the possibility with ESPHome. In the meantime, for a particular problem I’m having, I was thinking I’d temporarily re-flash the affected device. It’s not like the config for that device will go away in ESPHome.

Jaharmi avatar Mar 10 '24 17:03 Jaharmi

I was able to add this to ESPHome.

esphome:
  libraries:
    # A library from PlatformIO
    - thelastoutpostworkshop/GPIOViewer

However, I don’t think this results in the “#include” being set and the Web server running on port 8080. I may be wrong, as the ESPHome device I was testing already had a Web server on port 80. (This also meant it had the other required libraries installed.)

Jaharmi avatar Mar 11 '24 02:03 Jaharmi

I was able to add this to ESPHome.

esphome:
  libraries:
    # A library from PlatformIO
    - thelastoutpostworkshop/GPIOViewer

So you have this addon working in esphome just with 4 lines of code only? I cant reach 80 or 8080 port of my esp to view gpio states

MrC0nst avatar Apr 22 '24 06:04 MrC0nst

This example works only with inpit pins https://github.com/dvb6666/esphome-components/blob/main/examples/test-gpio-viewer.yaml

MrC0nst avatar Apr 22 '24 16:04 MrC0nst