ESPConnect | Easy WiFi Manager with Captive Portal
kandi X-RAY | ESPConnect Summary
kandi X-RAY | ESPConnect Summary
ESPConnect is a simplistic and easy approch to having a WiFi manager on your ESP MCUs. It is a lightweight library which let's you configure WiFi networks without any fuss. ESPConnect works with both ESP8266 & ESP32.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ESPConnect
ESPConnect Key Features
ESPConnect Examples and Code Snippets
Community Discussions
Trending Discussions on ESPConnect
QUESTION
I am not able to get the ttk.Progressbar
widget to work. May I know what is the issue and how I can fix it?
I know the Progressbar widget is functional; when I comment out self.sp_pbar.stop()
the progressbar runs but this happens after time.sleep(5)
completes which is not the desired behavior.
ANSWER
Answered 2019-Jan-30 at 14:06This is what you currently have in your code:
you set self.espconnecting = False
you call _connect_esp()
which calls _show_conn_progress()
which sets self.espconnecting = True
and starts the progressbar self.sp_pbar.start()
and then calls _update_conn_progress()
which checks the value of self.espconnecting
.
If self.espconnecting
is True
(which it currently is) connection continues and progress bar keeps rolling as expected.
If self.espconnecting
is False
progress bar is stopped self.sp_pbar.stop()
Before .after()
can make it's callback in 500ms, Control is passed back to _connect_esp
which sets self.espconnecting = False
.
Then .after()
calls _update_conn_progress()
which is meant to keep the bar rolling,
but(Here is your problem): what is the last value of self.espconnecting
? =False
hence, control branches to self.sp_pbar.stop()
, which stops the progrss bar. This is why when you comment that line out your code works as expected, because even if control branches there, there will be nothing to prevent the progress bar from working.
SOLUTION
Do not set self.espconnecting = False
in _connect_esp()
because before .after()
makes it's callback in 500ms, control would have been passed back to _connect_esp()
which sets self.espconnecting = False
which prevents your progress bar from working.
This means you have to find another means to 'end the connection', once it gets started.
N.B: I really don't see the need for time.sleep(5)
in the code.
Here is a possible way to go about the solving it:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ESPConnect
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page