Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic wifi connection after reboot #259

Open
djGoofy opened this issue Jun 13, 2022 · 2 comments
Open

Automatic wifi connection after reboot #259

djGoofy opened this issue Jun 13, 2022 · 2 comments

Comments

@djGoofy
Copy link

djGoofy commented Jun 13, 2022

Hello,
is it possible that the Arduino automatically connects to a network after startup to which it was already connected. In my case is a router which starts at the same time as the Arduino. Unfortunately, I have to set up the connection every time. In addition, I have to try 3-5 times before a connection can finally be established. The error Connection Failed always comes first. otherwise everything works very well.

@lasselukkari
Copy link
Owner

Hello!

You can increase the time the device waits for the wifi connection at the startup here: https://github.com/lasselukkari/DuinoDCX/blob/master/DuinoDCX/Config.h#L25

The reason why it does not try create the connection if WiFI is not found at startup is that it made the whole thing really laggy. It will try to reconnect if the connection was there, but back when I was developing this it made the whole system unstable if it kept on trying to reconnect forever.

If the longer connection timeout does not solve the problem you may uncomment this line of code here:
https://github.com/lasselukkari/DuinoDCX/blob/master/DuinoDCX/DuinoDCX.ino#L400

It should then try to keep on connecting forever but may have unwanted side effects.

@djGoofy
Copy link
Author

djGoofy commented Jun 14, 2022

Thank you for the quick feedback. I'll be honest, I didn't expect the answer so quickly. I will test this in July.
Greetings from Germany

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants