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

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

Wed Aug 23, 2017 10:51 am

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: 4353
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Wed Aug 23, 2017 12:36 pm

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

Mon Aug 28, 2017 8:31 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

Tue Aug 29, 2017 7:38 am

hello please let me know what i am doing wrong.

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

Tue Aug 29, 2017 8:28 am

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

Tue Aug 29, 2017 10:41 am

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

Tue Aug 29, 2017 10:43 am

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

Tue Aug 29, 2017 10:48 am

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

Tue Aug 29, 2017 11:13 am

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

Tue Aug 29, 2017 11:26 am

Hardware ?
Post Reply