Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Esp8266 webserver weak signal causing crashes

Status
Not open for further replies.

dr pepper

Advanced Member level 1
Advanced Member level 1
Joined
Mar 15, 2010
Messages
428
Helped
35
Reputation
70
Reaction score
41
Trophy points
1,308
Location
lancs
Activity points
4,171
I have a Esp8266 on a machine monitoring the water flow & temperature for water cooled brakes.
It works for a couple of days, but then crashes.
If I run the code on a Esp on the bench near the router it works fine.
The signal according to the Esp is around -82dB, googling signal strength tells me that this can cause wifi to drop packets.
Is there a way I can tweek the webserver code to cope with this, or do I need a massive antenna, I allreay have a +9dB whip.
 

It depends on what happens when it crashes. Is it in a total state of chaos or has the WiFi just lost the connection? Possibly another device is swamping it's signal.

Most likely it is just the WiFi, the trick is to periodically check whether it is connected and if not, restart the link again. You can do that as part of normal program flow or by a timed action, maybe checking once every few second, it depends on what the rest of your code is doing.

Brian.
 

What channel is your link on ? Is that channel high noise environment ?


Comment on baord design -


You are setting output power -


If using coax cable to antenna using good quality low loss cable ?


Regards, Dana.
 

I am using if (!wificonnected) reconnect();
Or something similar, it tries to reconnect if a connection is lost.
I'm not sure exactly whats happening on the esp8266 as I cannot connect to its serial in the application.

Its a module with a esp8266 chip and a u.fl. connecter, I'm using a 6" pigtail to a chassis mount sma socket, with a 9db whip on the other end of the steel control panel the esp is in, the router is about 120 meters away, but theres a steel wall partially in the way, and this is a noisy industrial environment, there is a container full of ac and dc drives overhead of my office where the router is.
 

Sounds like you have an environment equivalent to dropping the module
with a weight on it into the Mariana trench :)

One way around noise problems and limited transmit power is thru protocol,
like some of the digital modes Amateur Radio operators use at VLF and various
bands. Another way is via a repeater to span the distance and problems.



Regards, Dana.
 

I am using if (!wificonnected) reconnect();
Or something similar, it tries to reconnect if a connection is lost.
That is a good strategy but be careful where you place it in your code. Many applications use it to ensure a connection is established at start up but then assume it stays connected. Try using a timed routine so that those commands are called regularly, maybe every 10 or 30 seconds. If the WiFi is still connected it will return almost immediately so little processing time is lost but it it find the connection has dropped it should then re-establish it.

Brian.
 

Vlf is actually one of my interests, I've built several rx'ers.

Seems wifi.begin() can be passed the channel you want to operate on, I'll see if I can get some software to look at the traffic on the wifi xhannels and see if any are quiet, only thing is 'traffic' may not be the issue, not sure if interference will show on such software.

My program checks the connection in the moin loop, so its doing it all the time, it works on other programms I've done.

The esp ap seems a good solution so far.
 

My program checks the connection in the moin loop, so its doing it all the time, it works on other programms I've done.

You don't need to perform the reconnection task by yourself, it can be done in background with the WiFiEventHandler, as can be seen here:

It works for a couple of days, but then crashes.

I would bet there is something else happening, the ESP8266 Wifi library is very sensitive in the sense that anything can stuck the code leading to the infamous exception stack, which can be seen in the serial termial every time the code crashes, serial which you saddly cannot make use of; anyway, the most comon cause is a blocking delay in the code.
 
Last edited:


Ok, so would I be right is saying if wifi connection is lost just call wifibegin() again, or are you saying once you've called it then it will reconnect itself, I'm guessing the former.
I didnt know there was a stack decoder available, I guess I could disable the use of serial within the program, then the stack will be the only comms, and put an uno or something in there with a sd card or something to record what happens.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top