Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature Request] GPIO support in MeshCore

Aperta
#3,522 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c
Ambito
cli, embedded-iot

Direzione di ricerca

Start by reading src/MeshCore.h, especially the existing MainBoard GPIO methods, then trace the common CLI and board subclasses for the roles and board types mentioned in the proposal. The issue proposes GPIO defines, analog and digital access, and new CLI commands, but leaves compatibility and implementation details open; done would mean agreeing on the interface and supporting the requested pin operations across board roles.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I need to access GPIO pins on my meshcore nodes. I guess that this is something that others also want, and I can write an implementation of this if the proposal is acceptable. The idea is that we expose new CLI commands that lets you set/retieve the values of a GPIO-pin. This is something that I want to implement on all roles.

I want to make some new defines:

GPIO_IN
GPIO_OUT
GPIO_DAC
GPIO_ADC

These defines is a comma-separated list of GPIO-pins that is accessible using the CLI. If a define is not present, then there will be no corresponding GPIO for that type.

Then I want to extend mesh::MainBoard in src/MeshCore.h with some new member functions. These should be overridden at the board type (ESP32 etc).

class MainBoard {
    public:
    virtual bool setGPIO(int pin, bool newState) = 0; // returns true if the pin was set
    virtual bool setDAC(int pin, float value) = 0; // returns true if the pin was set
    virtual bool getGPIO(int pin); // return the value, or false if the pin does not exist
    virutal float getADC(int pin); // returns the value, or 0
}

I know that getGpio() and setGpio() is defined in MainBoard already, and probably it would be a good idea to use them. I just don't know the consequence yet of using these.

I have not a GPIO-init function here. I think that can be handled by the MainBoard subclass own setup/begin() function.

Then change the common CLI, add some new commands.

set gpio 1 1
get gpio 1
set gpio 2 3.43

If the GPIO is analog, use float values, for digital use 0 or 1.

Any thoughts?

Lingua principale
C
Stelle
3.9k
Fork
1.5k
Merge medio
1g 1h
PR unite (30g)
26

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di meshcore-dev/MeshCore

Tutte le issue di meshcore-dev/MeshCore

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.