-
Notifications
You must be signed in to change notification settings - Fork 636
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
Configuring TX/RX pins for sensor use. #1661
Comments
Right. You change And it is a good idea to detach the sensor when flashing again. |
Thanks. I am using PlatformIO on Windows 10 to build the modified binaries for flashing. Do I add I am looking to add something like the BME280 Digital Sensor Temperature Humidity Barometric Pressure Sensor Module to my Sonoff basic V2 that controls my shed light. |
Either way. If you do not mind modifying original files. We also support optional definitions file at |
Great. I've been looking at custom.h files. From what I understand, entries in custom.h override any other pre defined settings. E.G. change GPIO pin associations. Is that correct? I had a play disabling some of the build options to reduce the size of a binary for a RGB magic home controller. It was coming out at 501KB and wouldn't load via web OTA. It's now around 470KB and loads fine. I did this by adding various entries in the hardware.h file. I'll look at using custom.h instead. I'm trying to work out if it's worth adding my own environment entries to platformio.ini files which then have -DUSE_CUSTOM_H in the build entry? |
default settings will not be applied if you define settings beforehand (see .h #ifndef #define ... #endif constructs). custom is at the top of all.h, so it is loaded first. if something is missing #ifndef, compiler will show warning about redefinitions. it depends. if you use system environment to set platformio build flag defaults, all envs will use them and load default wifi, mqtt etc. settings |
@mcspr Thanks for your help. The first set of temp probes have arrived so I'll see what I can get working over the next few weeks. I guess when V2 of espurna is ready, some of these configurations will all be done from the web gui? |
Right. Which reminded me (once again) to actually do it. #1680 for basic support, without handling edge case like this when we use serial pins and need to disable debugging from runtime. I just wonder what kind of safeguard to put there to start up serial debugging back. Maybe new button action... |
Like you said, I guess a button would work. Maybe a reboot button option that disables the TX/RX GPIO mapping and re-enabling debugging on restart. The toggle would allow one or the other option to be enabled but not both. I guess it creates a problem with the firmware if serial debugging is enabled and something else is connected to one of the serial GPIOs? |
I managed to get the custom.h file working. I've added a DALLAS 1 wire temp sensor to a SWA1 WiFi switch to one of the serial pins. I have also got a BME280 environmental sensor connected to a Sonoff Basic V2 across GPIO 1 and 3 (TX/RX). It is working but with some issues. See #1672 |
I have been reading various posts that suggest I can compile a Sonoff Basic V2 to use the TX or RX pins for temperature sensors.
What I'm not sure about, some posts say using them will disable the use of serial data. Does that stop the Sonoff being reflashed using the header pins or do you just disconnect the sensor to allow flashing again.
The text was updated successfully, but these errors were encountered: