Search for: Log In Register OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Change Firmware to control stations directly via GPIO pins (relays) This topic has 6 replies, 3 voices, and was last updated 3 months, 4 weeks ago by vamp. Viewing 7 posts - 1 through 7 (of 7 total) Author Posts March 14, 2021 at 9:48 pm #69430 TobascoParticipant Hi, after my beloved OS Bee died and I couldn’t fix it, I decide to set up a new one based on an “ESP8266 WIFI 4 Channels Relay Module AC/DC ESP-12F Development Board”. The flashing, WiFi connection and OLED Display works already, now I want to change the firmware to control the 4 relays via the GPIO pins GPIO16 (D0) GPIO14 (D5) GPIO12 (D6) GPIO13 (D7) May you give me a hint, which part of the code I have to change so that Station 1 to 4 is linked to this GPIO pins? salute Thomas March 15, 2021 at 11:00 am #69440 TobascoParticipant Hi, I solved my problem by replacing apply_all_station_bits() with custom code to control the GPIO pins for the relays: void OpenSprinkler::apply_all_station_bits() { const uint8_t stationGPIO[] = {16, 14, 12, 13}; for (uint8_t i = 0; i < 4; i++) { pinMode(stationGPIO[i], OUTPUT); digitalWrite(stationGPIO[i], station_bits[0] & 1 << i ? HIGH : LOW); } } salute Thomas September 22, 2022 at 12:16 pm #73967 GompkaParticipant Hello Thomas, can you elaborate on which file in the firmware this line of code should be changed? Is it in opensprinkler.h? September 22, 2022 at 12:25 pm #73968 TobascoParticipant Ho Gompka, it’s in the file OpenSprinkler.cpp, just search for void OpenSprinkler::apply_all_station_bits() { You can find a fully working variant for the ESP8266 WIFI 4 Channels Relay Module on my Github account (with more information about the hardware setup): https://github.com/ThFischer/OpenSprinkler-for-ESP12F_Relay_X4#readme salute & happy engineering Thomas September 22, 2022 at 12:33 pm #73969 GompkaParticipant Thanks for the quick reply, I will definitely take a look at the github. I was running a raspberry pi which failed and figured I would move to esp8266 since I have plenty of them. September 22, 2022 at 12:35 pm #73970 TobascoParticipant Good choice! A Raspberry PI is kind of oversized just to run Opensprinkler. There is also another branch where I used a normal NodeMCU Lua Lolin V3 and a 8Ch Relay board: https://github.com/ThFischer/OpenSprinkler-for-ESP12F_Relay_X4/tree/NODEMCU_74HC595/NodeMCU-74HC595#readme November 25, 2022 at 9:15 am #74383 vampParticipant Hello there I dont know how is the maintainer this github branch, (maybe Gombka?) but refer this forum theme. https://github.com/solideus/OpenSprinkler-ESP8266-WIFI-4-Channels-Relay-Module-AC-DC-ESP-12F-Development-Board My question is: Are you plan to update to (11) your code? The Weather check error, that fix the 11 version is also affect to me. It would be good that update it. Thanks a lot!! Author Posts Viewing 7 posts - 1 through 7 (of 7 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Change Firmware to control stations directly via GPIO pins (relays)