[GH-ISSUE #983] Letting code to be executed when waiting connection via portail #836

Closed
opened 2026-02-28 01:27:16 +03:00 by kerem · 4 comments
Owner

Originally created by @matthieuweber on GitHub (Dec 16, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/983

Hello,

I would like to know if there is an option to let's some code to be executed when waiting connection configuration via portal.

I explain:

My Wemos D1R1 (ESP8266) with WifiManager talks with an PIC µcontroller with TTL serial port.
Sometimes PIC ask Wemos D1R1 its status.

This works only when Wemos D1R1 is in access point mode or if the portal was used to successfully connect to my internet box.

If web portal waits for user to connect to the internet box, I can't execute any code... So I cannot tell the status to my PIC µcontroller.

I tried wifimanager.setConfigPortalBlocking but I get error : setConfigPortalBlocking not belong to wifimanager class....

I tried with a timeout => Works but I have no opportunity to connect via the portal anymore...

Thanks !

Matthieu

Originally created by @matthieuweber on GitHub (Dec 16, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/983 Hello, I would like to know if there is an option to let's some code to be executed when waiting connection configuration via portal. I explain: My Wemos D1R1 (ESP8266) with WifiManager talks with an PIC µcontroller with TTL serial port. Sometimes PIC ask Wemos D1R1 its status. This works only when Wemos D1R1 is in access point mode or if the portal was used to successfully connect to my internet box. If web portal waits for user to connect to the internet box, I can't execute any code... So I cannot tell the status to my PIC µcontroller. I tried wifimanager.setConfigPortalBlocking but I get error : setConfigPortalBlocking not belong to wifimanager class.... I tried with a timeout => Works but I have no opportunity to connect via the portal anymore... Thanks ! Matthieu
kerem closed this issue 2026-02-28 01:27:16 +03:00
Author
Owner

@tablatronix commented on GitHub (Dec 16, 2019):

Use the examples

<!-- gh-comment-id:566052980 --> @tablatronix commented on GitHub (Dec 16, 2019): Use the examples
Author
Owner

@matthieuweber commented on GitHub (Dec 16, 2019):

Thanks Tablatronix,

You mean this one : AutoConnectWithFeedbackLED.ino
=>I modify tick() function to respond to external uart commands ?

Thanks,

Matt

<!-- gh-comment-id:566072873 --> @matthieuweber commented on GitHub (Dec 16, 2019): Thanks Tablatronix, You mean this one : AutoConnectWithFeedbackLED.ino =>I modify tick() function to respond to external uart commands ? Thanks, Matt
Author
Owner

@matthieuweber commented on GitHub (Dec 16, 2019):

Great ! It's works !

I modified tick() function from AutoConnectWithFeedbackLED.ino to scan UART port and launch a parsing function, so it responds to PIC asks..

`
void tick()
{
//toggle state
int state = digitalRead(BUILTIN_LED); // get the current state of GPIO1 pin
digitalWrite(BUILTIN_LED, !state); // set pin to the opposite state

// Get commands and data from the heater system mainboard via TTL USART (5V RS232 like port):
while(Serial.available() > 0)
{
#ifdef _DEBUG__MSG_VIA_UART
Serial.println("UART chars received!");
#endif
Buff_rs232[Buff_rs232_index] = Serial.read(); // Store received chars into Buff_rs232 chart
if (Buff_rs232[Buff_rs232_index++] == (unsigned char)'\n') Command_ready = 1;
}

// Parse commands stored into Buff_rs232[]
Parse_command();
}
`

<!-- gh-comment-id:566177163 --> @matthieuweber commented on GitHub (Dec 16, 2019): Great ! It's works ! I modified tick() function from AutoConnectWithFeedbackLED.ino to scan UART port and launch a parsing function, so it responds to PIC asks.. ` void tick() { //toggle state int state = digitalRead(BUILTIN_LED); // get the current state of GPIO1 pin digitalWrite(BUILTIN_LED, !state); // set pin to the opposite state // Get commands and data from the heater system mainboard via TTL USART (5V RS232 like port): while(Serial.available() > 0) { #ifdef __DEBUG__MSG_VIA_UART_ Serial.println("UART chars received!"); #endif Buff_rs232[Buff_rs232_index] = Serial.read(); // Store received chars into Buff_rs232 chart if (Buff_rs232[Buff_rs232_index++] == (unsigned char)'\n') Command_ready = 1; } // Parse commands stored into Buff_rs232[] Parse_command(); } `
Author
Owner

@tablatronix commented on GitHub (Dec 17, 2019):

There is a non blocking example in the development branch

<!-- gh-comment-id:566319411 --> @tablatronix commented on GitHub (Dec 17, 2019): There is a non blocking example in the development branch
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#836
No description provided.