-->
Page 1 of 2

Status reporting

PostPosted: Sat Jul 30, 2016 4:40 am
by Oldbod
Sort of related to error handling, I'm wondering if there is a simple way to check if esp has connected to a network, or has a connection open to another device. I' guessing you could check ip address, but if device has a static ip...
Wget?

Re: Status reporting

PostPosted: Sat Jul 30, 2016 7:41 am
by Mmiscool
I suppose it is time to change the connect and ap commands in to functions that can return a value.

Will see about doing some thing like this tonight.

Re: Status reporting

PostPosted: Sat Jul 30, 2016 9:48 pm
by forlotto
rather simple open up cmd in windows

type the following and hit enter:

Code: Select allping 192.168.x.x


Do this with a device that it on the same network I believe all os models windows, linux, android, ios, osx have this feature built in ping will tell you exactly how to check this you could also just make a batch file to do this automatically in windows ...

If I am understanding you correctly this is very simple to do often things that will block your device is virus scanners or security tools.

Be sure that if you are accessing your device remotely that you forward both ports 80 and 81 to external port 80 on your router.

Hope this helps I am interested though to see what mmiscool cooks up not sure what he is thinking along the lines of doing but either way there is a ton of ways to skin this cat if I am understanding you correctly.

Re: Status reporting

PostPosted: Mon Aug 01, 2016 3:46 am
by Oldbod
Sorry, thought I'd already replied to this but must have messed it up!

Mmiscool - that would be brilliant, amazes me how fast responses are here, far better than any request system I've encountered elsewhere. And I've been doing IT stuff for a very long time.

Forlotto - I agree about ping being a really useful tool in a lot of circumstances! I'm sorry I didn't really explain what prompted the initial post - an espbasic user had posted on the forum about performance issues and it made me think. The issue is when the esp is acting more-or-less automomously, and we only have access to stuff at the esp8266basic interface driven by the program.

It seemed to me possible (without knowing how esp8266basic or the user's code worked) that one possible cause was the esp trying to write to a non-existant connection. If say your esp is operating as a thermostat, you might want to prioritise turning heat off over updating thingspeak, but also extend your logging so you could apply the data later. Imagine using your dimmer to keep light levels in a room constant, where some of the light came from a window. If you can't update the dimmer output because you're waiting for some logging action to timeout, and as a result it all gets too bright, result unhappy....
I worked on something similar for a friend's immersion heater that if the control loop took more than a millisecond to execute it was too long.

Where IP networks are involved, the vast potential variance makes it harder to do things to a timetable. As you say, many ways to get round it...all good fun!