want to all 4 gpio off while restart esp (wifisocket firmware

emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

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
User avatar
pzygmunt
Posts: 18284
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

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);
emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

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);



}
emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

hello please let me know what i am doing wrong.

Thankyou
User avatar
pzygmunt
Posts: 18284
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Those relays are operated by hi or lo signal ?
emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

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
emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

but can you let me know is my code right
User avatar
pzygmunt
Posts: 18284
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Your code looks right
emiliakowalski
Posts: 74
Joined: Mon Jul 03, 2017 2:50 pm

so where is the issue
User avatar
pzygmunt
Posts: 18284
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Hardware ?
Post Reply

Return to “Help”