-
Notifications
You must be signed in to change notification settings - Fork 16
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
Consider implementing WiFiManager for runtime configuration #2
Comments
I would be happy to investigate this if you would like. |
An excellent Idea! I have several esp8266 and nodelink r4 using the Alexa echo Dot. - works well The multiple wemos emulation code works great but hard coding the ssid, pw and device names makes it difficult to install at other locations etc. |
I've been doing some work on this in a forked repo. Worked nicely in some of my testing. Once I get it fully ironed out I'll send you a PR for your consideration, @CharlesJGantt. Thanks for this great project! |
Had a quick look at the code. Thanks for your work and sharing it to those of who are not so talented. Joe Canada |
Glad you liked it, @joeman2116. I'll probably do a little refactoring of the code to reduce duplication--less code to test and less to go wrong ;-) before the PR to @CharlesJGantt. |
cosmocracy Compiled your new test code and it uploaded fine. All looks perfect up to here -----------------------------Then udp errors------ UDP packet encountered, size: 391Found 'M-SEARCH' in request Basic udp error repeats over and over Joe |
I changed the ports as the original were in use..... |
@joeman2116, are those errors or just the logging I added when the device sees UDP multicasts? I was having trouble with autodiscovery at one point so I added the logging. I should probably either remove it or add some logging level setting. All worked ok though, right? |
I think they are just info but they wipe out the serial monitor because of repetition. When i tell alexa to discover devices Got UDP Belkin Request.. Sending response to 192.168.1.128 Sending response to 192.168.1.128 Sending response to 192.168.1.128 Sending response to 192.168.1.128 ending :urn:Belkin:device:controllee:1Belkin International Inc.Emulated Socket3.1415uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e6d0fca5-72221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to setup.xml ... ######## I get 4 of the above Are there default alexa device names? I looked at alexa after discover devices but did not see any new names Alexa name 1 etc How to i get to the config to change the device names , ssid etc I tried connecting to 192.168.1.4 - but no responses when connected to module Must be me...... Joe |
@joeman2116, pull the boot/flash jumper and put it in the flash position (even though you're not flashing). Then restart the LinkNode and it should start in "configuration" mode (with a new wifi AP called EchoBase-something. If you associate with and access the wifi config there will be four parameter slots at the bottom of the page where you can specify names. After you save those, put the jumper back to the boot position and restart the LinkNode. (Also, those XML snippets you're seeing are just from the autodiscovery probes that Alexa (or other UPnP clients) are sending). |
I think we can tighten down the logging so there will be an "info" level vs. "debug" so your console won't be overwhelmed with output when you're not in need of so much detail. |
I have the module in flash mode.
Rebooted - still dont see any wifi ap with ecobase - looked on 2 devices
- no ap
may need to clean module and reflash
…On Mon, Dec 26, 2016 at 12:39 PM, Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116>, pull the boot/flash jumper
and put it in the flash position (even though you're not flashing). Then
restart the LinkNode and it should start in "configuration" mode (with a
new wifi AP called EchoBase-something. If you associate with and access the
wifi config there will be four parameter slots at the bottom of the page
where you can specify names. After you save those, put the jumper back to
the boot position and restart the LinkNode. (Also, those XML snippets
you're seeing are just from the autodiscovery probes that Alexa (or other
UPnP clients) are sending).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY7e6udE4JjCkrT6kuGguUAVzsL2nks5rL-3bgaJpZM4LRaJz>
.
|
I'll have to scrutinize the WiFiManager code to see how long the AP stays up. I've had to retry scanning/connecting multiple times--this may be a wifi/channel issue. Try a restart? |
I'll troubleshoot more this week and make sure my code isn't the problem :) |
cosmocracy, Did a clean bin file on flash, then reflash with your code The issue now is I want to change info As a test again - i cleaned the module, did a reflash and echobase appeared. It appears once config settings are done... I cannot get the Config EchoBase AP back. Looking very close...... Thanks..... Joe |
Excellent testing--thank you for documenting this scenario I think it will help me debug. |
During the past few days I have noticed the linknode r4 stops being
accessible unless I reboot - poweroff/on.
I originally thought it was just an odd happening, but within 24 hrs or so
it stops responding. Very consistent.
I have another linknoder4 running beside it with the original linknode
code and it continues to run flawless day after day.
Once the new code is ironed out I will see if this issue gets cleared. If,
not I will load the same original linknode code to ensure it is not the
module etc..
Joe
…On Mon, Dec 26, 2016 at 5:45 PM, Eric Kramer ***@***.***> wrote:
Excellent testing--thank you for documenting this scenario I think it will
help me debug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY-kPxv3ADKPbjkRx4odOUbOdV5Yoks5rMDWQgaJpZM4LRaJz>
.
|
@joeman2116 Interesting. Did you happen to have the WifiManager-enabled Linknode hooked up to a serial monitor to see if there was anything being logged? I really wish there were a couple spare pins exposed on the Linknode so we could hook up either a small LCD display or at least a "heartbeat LED". Hmmm. |
Good idea, i will plug into computer and leave serial on to see if
something shows.
Joe
…On Thu, Dec 29, 2016, 4:46 PM Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Interesting. Did you happen
to have the WifiManager-enabled Linknode hooked up to a serial monitor to
see if there was anything being logged? I really wish there were a couple
spare pins exposed on the Linknode so we could hook up either a small LCD
display or at least a "heartbeat LED". Hmmm.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpYxrRbm3R8j1wqUb2-GMORBMRK44zks5rNBw-gaJpZM4LRaJz>
.
|
@joeman2116 Getting back to this now. Any word how your serial-monitored experiment is going? Thanks! |
Well,
I tried the serial monitor but did not see anything unusual.
I also exchanged the powersupply from a working linknode r4 but no change.
It just seems after x time it fails to respond to alexa .
The serial does not output nor does one see anything coming from alexa
Discover devices doe not retore the device either.
But as soon as i remove power and discover devices it returns and works .
The other linknode r 4 is a few feet a way from this one, but it continues
to work 24/7.
Joe
…On Sat, Dec 31, 2016, 11:38 AM Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Getting back to this now. Any
word how your serial-monitored experiment is going? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY4ZM1iZavIfPxJlX1h1iRj53CKmJks5rNnbtgaJpZM4LRaJz>
.
|
Ok, I'm about to commit a version with more logging statements. That might help pinpoint things. Thanks for your continued help from Up North, @joeman2116 :-) |
@joeman2116 Wondering if the problem is the underling WiFi library for the ESP8266. Looks like there is an issue being investigated with the most recent version: esp8266/Arduino#2186 In particular see this comment: esp8266/Arduino#2186 (comment) |
My pleasure to help anyway I can..
Joe
…On Sat, Dec 31, 2016 at 1:53 PM, Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Wondering if the problem is
the underling WiFi library for the ESP8266. Looks like there is an issue
being investigated with the most recent version: esp8266/Arduino#2186
<esp8266/Arduino#2186>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY_JYKVvwGho4BeJb81XnD2GjSJv6ks5rNpaIgaJpZM4LRaJz>
.
|
Added additional logging during startup and [re]connection. Working toward implementation of issue CharlesJGantt#2
@joeman2116 New commit 3bdaf05 in my repo that adds more logging and some additional reconnection tweaks. Give it a go when you have a moment? (I have a LinkNode running it now and will see what the serial logging shows) |
@CharlesJGantt Would you consider adding me to the project? I'd be interested in spinning up an "add-wifi-manager" branch and moving my commits to this/your repo. Thanks! |
I will definitely add you. I am traveling at the moment and will add you
when I get back to my PC.
…On Dec 31, 2016 1:05 PM, "Eric Kramer" ***@***.***> wrote:
@CharlesJGantt <https://github.com/CharlesJGantt> Would you consider
adding me to the project? I'd be interested in spinning up an
"add-wifi-manager" branch and moving my commits to this/your repo. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD7NQKlXSJ7lvaXmfDXilakepAvnEwV0ks5rNqdtgaJpZM4LRaJz>
.
|
@joeman2116 Another commit, 7b5f223, that adds further logging to help see what's going on. :-) |
I will burn the new code tommorrow.
Thanks
Joe
…On Sat, Dec 31, 2016, 3:34 PM Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Another commit, 7b5f223
<7b5f223>,
that adds further logging to help see what's going on. :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpYwWX09ZL7lT2oPdoZNTWdeXqdr0mks5rNq49gaJpZM4LRaJz>
.
|
Ok,
Flashed the linknoder4 with esptool with 4 blank.bins to be sure it clean.
I installed the new code.
Searched for wifi - found Echobase1
connected - 192.168.4.1 menu appeared
configured wifi
devices 4
saved
Serial monitor - good -
Disconnected power and put jumper to run mode (right hand side)
powered up waited about 15 secs then told alexa to discover devices
It connected and alexa found 4 devices - which turn on and off fine.
Now in monitor mode to see how it holds.
if all goes well for 24 hours or so then I will put linknode in flash mode
and change device names ssid etc - to see if re-config works consistently.
Happy New Year
Joe
…On Sat, Dec 31, 2016 at 10:28 PM, joe basque ***@***.***> wrote:
I will burn the new code tommorrow.
Thanks
Joe
On Sat, Dec 31, 2016, 3:34 PM Eric Kramer ***@***.***>
wrote:
> @joeman2116 <https://github.com/joeman2116> Another commit, 7b5f223
> <7b5f223>,
> that adds further logging to help see what's going on. :-)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AWDpYwWX09ZL7lT2oPdoZNTWdeXqdr0mks5rNq49gaJpZM4LRaJz>
> .
>
|
Test results with new code:
Initially, everything working, and very fast responses from Alexa.
After several hours this is what the serial reports and never gets out of
loop"
Disconnected while in loop(); Attempting reconnect...
tatus =
tatus =
tatus =
tatus =
tatus =
tatus =
tatus =
tatus =
tatus =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
iFi status =
Failure to establish connection after 10sec. Will reattempt connection in 2
sec
Disconnected while in loop(); Attempting reconnect...
Goes on forever and never gets a connect.
If I power off and rediscover devices - all returns to normal and it
connects fine
Joe
…On Sat, Dec 31, 2016 at 3:34 PM, Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Another commit, 7b5f223
<7b5f223>,
that adds further logging to help see what's going on. :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpYwWX09ZL7lT2oPdoZNTWdeXqdr0mks5rNq49gaJpZM4LRaJz>
.
|
@joeman2116 good work! I think we are closing in on this. I'll investigate adding more robustness to the reconnect handling. |
Eric,
Sounds good. Just did more testing and find if there is a disconnect for
whatever reason, it will try to reconnect but never does. As soon as i
power off then on it connects instantly and saved config is applied and
alexa talks with the devices... And communication is very very fast. ...
joe
…On Sun, Jan 1, 2017 at 11:23 PM, Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> good work! I think we are
closing in on this. I'll investigate adding more robustness to the
reconnect handling.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpYyQF5mKszIZh1390i6DiPo6vwvVdks5rOG2lgaJpZM4LRaJz>
.
|
Hmmmm, good research. One short-term option would be to trigger a quick reboot/restart after X attempts connecting. But the better fix is to get the reconnect working. On a related note, I have other ESP8266 projects--not using the LinkNode--that do periodically and spontaneously disconnect from wifi for 10-30sec at a time... but the code there reconnects fine. I'll see about porting some of that code to this project. |
Eric,
Yes, I have seen where a disconnect occurs or router reboots but reconnects
occur as soon as network is stable.
Certainly an auto reboot would be a nice feature if system wont reconnect
by other code. Even a nice backup last resort if regular code cant
reconnect after x amount of time...
When it works the response is amazingly fast. The second i tell Alexa to
turn on or off its done... If i use a group command to tell alexa to turn
on all relays its sound like a machine gun lol so fast....
Cool stuff
Joe
…On Mon, Jan 2, 2017 at 4:11 PM, Eric Kramer ***@***.***> wrote:
Hmmmm, good research. One short-term option would be to trigger a quick
reboot/restart after X attempts connecting. But the better fix is to get
the reconnect working.
On a related note, I have other ESP8266 projects--not using the
LinkNode--that do periodically and spontaneously disconnect from wifi for
10-30sec at a time... but the code there reconnects fine. I'll see about
porting some of that code to this project.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY5LIsEGuTlFJ_hnCFd7XmxRKsQzfks5rOVoHgaJpZM4LRaJz>
.
|
@joeman2116 Good news. Commit e875783 implements some improvements to connection robustness. Specifically, when a disconnect occurs the reconnect attempt is done in a slightly different manner. In my testing--I rebooted my router--it reconnected after only a couple of attempts:
|
Thanks for new code
Cleaned the linknode r4
Installed new code
Found the Echobase1
Entered ssid and pw
Saved
Rebooted
Discover devices
Serial monitor - looks good , alexa responses good
4 devices found - and turn off / on with a very quick response.
monitoring...
Joe
…On Mon, Jan 2, 2017 at 10:50 PM, Eric Kramer ***@***.***> wrote:
@joeman2116 <https://github.com/joeman2116> Good news. Commit e875783
<e875783>
implements some improvements to connection robustness. Specifically, when a
disconnect occurs the reconnect attempt is done in a slightly different
manner. In my testing--I rebooted my router--it reconnected after only a
couple of attempts:
Disconnected while in loop(); Attempting reconnect to SEVERUS...
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
Failure to establish connection after 10sec. Will reattempt connection in 2 sec
Disconnected while in loop(); Attempting reconnect to SEVERUS...
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
Failure to establish connection after 10sec. Will reattempt connection in 2 sec
Disconnected while in loop(); Attempting reconnect to SEVERUS...
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Disconnected
WiFi status = Connected
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWDpY3ZaNYqR4YWZnuMlH3YjZtxS_Fgbks5rObd2gaJpZM4LRaJz>
.
|
wifi disconnected then
linknode would not reconnect
serial monitor displays reconnect attempts over and over.
had to power off to restore to normal operation
Joe.
…On Tue, Jan 3, 2017 at 11:36 AM, joe basque ***@***.***> wrote:
Thanks for new code
Cleaned the linknode r4
Installed new code
Found the Echobase1
Entered ssid and pw
Saved
Rebooted
Discover devices
Serial monitor - looks good , alexa responses good
4 devices found - and turn off / on with a very quick response.
monitoring...
Joe
On Mon, Jan 2, 2017 at 10:50 PM, Eric Kramer ***@***.***>
wrote:
> @joeman2116 <https://github.com/joeman2116> Good news. Commit e875783
> <e875783>
> implements some improvements to connection robustness. Specifically, when a
> disconnect occurs the reconnect attempt is done in a slightly different
> manner. In my testing--I rebooted my router--it reconnected after only a
> couple of attempts:
>
> Disconnected while in loop(); Attempting reconnect to SEVERUS...
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> Failure to establish connection after 10sec. Will reattempt connection in 2 sec
> Disconnected while in loop(); Attempting reconnect to SEVERUS...
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> Failure to establish connection after 10sec. Will reattempt connection in 2 sec
> Disconnected while in loop(); Attempting reconnect to SEVERUS...
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Disconnected
> WiFi status = Connected
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AWDpY3ZaNYqR4YWZnuMlH3YjZtxS_Fgbks5rObd2gaJpZM4LRaJz>
> .
>
|
After I upload the code to my Linknode R4 and switch it to normal run mode it continuously flashes the power LED on the Linknode and on the ESP8266 . I am getting this in the serial window. ets Jan 8 2013,rst cause:1, boot mode:(3:7) I have searched for an explanation and have only found that the function wdt_disable() is no longer working but I can't seem to find that function in the code anywhere. Any ideas as to what is wrong? |
The WiFiManager project provides the ability to dynamically configure an ESP8266, including wifi SSID/credentials. WiFiManager also supports additional arbitrary config parameters which seems ideal for capturing the Alexa names associated with each of the relays. This would make the image more useful to end-users as it would not require changes to the .INO (and the entire Arduino IDE) just to configure a LinkNodeR4 once it has the initial image.
The text was updated successfully, but these errors were encountered: