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

Adding the button to a Wemos D1 mini relay #239

Closed
xoseperez opened this issue Oct 7, 2017 · 4 comments
Closed

Adding the button to a Wemos D1 mini relay #239

xoseperez opened this issue Oct 7, 2017 · 4 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: P.B. (Bitbucket: PieBru, GitHub: PieBru)


Hi, I point out this silly note as it might ease the life of newbies like me.

The Wemos D1 Mini relay is a very handy dev platform to test espurna before flashing on less accessible devices, at least because you don't have to press buttons to flash it and there is a handy hardware reset button.

The D1 doesn't came with an equivalent of the Sonoff button, but it's easy to add it by connecting a pushbutton between GND and D3 (GPIO0), like I did in the attached picture.

In Espurna 1.9.5 you must esplicitely enable it for the Wemos, but leaving it enabled without having connected the button doesn't give problems, so IMO this may be added permanently.

Add in hardware.h inside #elif defined(WEMOS_D1_MINI_RELAYSHIELD)

#!arduino
    // Buttons
    // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
    #define BUTTON1_PIN         0   // Connect a pushbutton between D3 and GND,
                                    // it's the same as using a Wemos one button shield
    #define BUTTON1_MODE        BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
    #define BUTTON1_RELAY       1

Add in hardware.ino inside #elif defined(WEMOS_D1_MINI_RELAYSHIELD)

#!arduino
        setSetting("btnGPIO", 1, 0);
        setSetting("btnRelay", 1, 1);

Cheers.
Piero

@xoseperez
Copy link
Owner Author

I agree. Will add it to the next release.

@xoseperez
Copy link
Owner Author

Pushed with 8dacb87. Now of dev, will be released soon.

@xoseperez
Copy link
Owner Author

Released with 1.9.6

@xoseperez
Copy link
Owner Author

Removing milestone: 1.9.6 (automated comment)

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

No branches or pull requests

1 participant