OpenSprinkler / OpenSprinkler-Firmware

OpenSprinkler Unified Firmware for OpenSprinkler, OpenSprinkler Pi, and OpenSprinkler Beagle.
http://www.opensprinkler.com
GNU General Public License v3.0
476 stars 286 forks source link

GPIO station disabled on D1 Mini #311

Closed agnoam closed 3 months ago

agnoam commented 3 months ago

I have built the firmware on D1 Mini using the provided platformIO configurations. When I logged in to the UI, everything was working fine until I tried to set up a station over a specific GPIO pin.

How can I choose a specific GPIO?

rayshobby commented 3 months ago

This is because there are no free GPIO pins on the official OpenSprinkler 3.x hardware. All available GPIO pins on ESP8266 have been assigned to certain functions. The free pins are defined here: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/defines.h#L360 if you are using your own hardware and there are any spare pins, you can add them to the list, they will show up on the UI. But you will need to also change the firmware to disable the functions of these pins. For example, if you don't use any sensors, the PIN_SENSOR1 and PIN_SENSOR2 can be released as free GPIO pins, but you need to define those pins as 255 so the firmware won't initialize those pins as sensor pins.

iofirag commented 3 months ago

This is because there are no free GPIO pins on the official OpenSprinkler 3.x hardware. All available GPIO pins on ESP8266 have been assigned to certain functions. The free pins are defined here: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/defines.h#L360 if you are using your own hardware and there are any spare pins, you can add them to the list, they will show up on the UI. But you will need to also change the firmware to disable the functions of these pins. For example, if you don't use any sensors, the PIN_SENSOR1 and PIN_SENSOR2 can be released as free GPIO pins, but you need to define those pins as 255 so the firmware won't initialize those pins as sensor pins.

" you can add them to the list" - what list? is there an option to support the GPIO by adding them to the mention list without ignore any sensors?

rayshobby commented 3 months ago

The PIN_FREE_LIST I don't understand how you can use the same GPIO pin for multiple purposes? Are you asking how to use a pin both as a sensor pin as well as a free pin for GPIO station? That's not possible.

agnoam commented 3 months ago

@rayshobby, can you give me a reference to the place to disable the flow sensors for the ESP8266?

rayshobby commented 3 months ago

How many GPIO zones are you looking for? If you need one, I suggest you start with the RFTX (radio-frequency transmitter) pin, assuming you are not using a RF transmitter: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/defines.h#L418 change it to 255, so that effectively disables RFTX. That can free up pin 15, and you can add it to the PIN_FREE_LIST: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/defines.h#L360 i.e. #define PIN_FREE_LIST {15} This way GPIO 15 can be used for GPIO station.