Page 1 of 2
want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Wed Aug 23, 2017 10:51 am
by emiliakowalski
Hello,
I want all gpio should be off while reset or restart esp. but unable to put all 4 gpio at low while restart, in wifisocket firmware.
where to change in below please let me know.
<<<<<<<<<<<<code>>>>>>>>>>>>>>>>>>>>>
https://github.com/SUPLA/supla-espressi ... fisocket.c
or i need to change in this
https://github.com/SUPLA/supla-espressi ... esp_gpio.c
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Wed Aug 23, 2017 12:36 pm
by pzygmunt
Remove all RELAY_FLAG_RESTORE flags.
Add here
https://github.com/SUPLA/supla-espressi ... ket.c#L112
supla_esp_gpio_hi(B_RELAY1_PORT, 0);
supla_esp_gpio_hi(B_RELAY2_PORT, 0);
supla_esp_gpio_hi(B_RELAY3_PORT, 0);
supla_esp_gpio_hi(B_RELAY4_PORT, 0);
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Mon Aug 28, 2017 8:31 pm
by emiliakowalski
hi did not work out
<<<<<<<<<<<<existing code>>>>>>>>>>>>>>>>>>>>>>>>>>
supla_relay_cfg[0].gpio_id = B_RELAY1_PORT;
supla_relay_cfg[0].flags = RELAY_FLAG_RESTORE_FORCE;
supla_relay_cfg[0].channel = 0;
#ifdef __BOARD_wifisocket_x4
supla_relay_cfg[1].gpio_id = B_RELAY2_PORT;
supla_relay_cfg[1].flags = RELAY_FLAG_RESTORE;
supla_relay_cfg[1].channel = 1;
supla_relay_cfg[2].gpio_id = B_RELAY3_PORT;
supla_relay_cfg[2].flags = RELAY_FLAG_RESTORE;
supla_relay_cfg[2].channel = 2;
supla_relay_cfg[3].gpio_id = B_RELAY4_PORT;
supla_relay_cfg[3].flags = RELAY_FLAG_RESTORE;
supla_relay_cfg[3].channel = 3;
#endif
}
<<<<<<<<<<<<<<<<<<<<<<<modified code>>>>>>>>>>>>>>>>>>>>>>>>>
supla_relay_cfg[0].gpio_id = B_RELAY1_PORT;
supla_relay_cfg[0].channel = 0;
#ifdef __BOARD_wifisocket_x4
supla_relay_cfg[1].gpio_id = B_RELAY2_PORT;
supla_relay_cfg[1].channel = 1;
supla_relay_cfg[2].gpio_id = B_RELAY3_PORT;
supla_relay_cfg[2].channel = 2;
supla_relay_cfg[3].gpio_id = B_RELAY4_PORT;
supla_relay_cfg[3].channel = 3;
#endif
supla_esp_gpio_hi(B_RELAY1_PORT, 0);
supla_esp_gpio_hi(B_RELAY2_PORT, 0);
supla_esp_gpio_hi(B_RELAY3_PORT, 0);
supla_esp_gpio_hi(B_RELAY4_PORT, 0);
}
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 7:38 am
by emiliakowalski
hello please let me know what i am doing wrong.
Thankyou
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 8:28 am
by pzygmunt
Those relays are operated by hi or lo signal ?
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 10:41 am
by emiliakowalski
with native code it was like when start or reset or restart two gpios high and two gpios low what i wanted that it should be low or off when restart or reset the esp but it is still 2 gpios high and 2 low at startup.
what to do
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 10:43 am
by emiliakowalski
but can you let me know is my code right
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 10:48 am
by pzygmunt
Your code looks right
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 11:13 am
by emiliakowalski
so where is the issue
Re: want to all 4 gpio off while restart esp (wifisocket firmware
Posted: Tue Aug 29, 2017 11:26 am
by pzygmunt
Hardware ?