-->
Page 18 of 19

Re: Getting Started Guide

PostPosted: Sun Jan 22, 2017 6:50 am
by bugs
After flashing, the ESP creates its own access point which has no connection with your network.
Forget the pc and router for now.

Using moble phone (or tablet) connect to the ESP access point - your phone may give a warning about no internet access - this is correct and to be expected.
Now open browser on the phone and got to 192.168.4.1 where you will find the ESP settings page.
Your screenshot of this looks wrong because the first "Name:" (Station mode connect to your router) must be the SSID of your wifi network - nothing to do with the ESP.
I suggest you leave the IP address blank for now as typing on a phone is not easy. This assumes that your router will hand out the next available IP when the ESP connects.
Now hit the Save button.

Restart the ESP and it /should/ connect to your network and be available from the PC.
Once there, you can fill in the rest of the settings if you wish to use a fixed IP but remember to add the subnet mask - normally 255.255.255.0 , the default gateway - which is your router IP and the port - usually 80.

If you are using an Android phone I recommend Wifi Analyser to see if the ESP is on its own channel 1 or has joined your network. Also the Fing application shows the IP addresses of all units connected to the network so you can see if the ESP made it.
Having a serial connection to the ESP and a terminal program (or just watch the new flasher screen) helps to see what is going on.

Re: Getting Started Guide

PostPosted: Sun Jan 22, 2017 8:19 am
by Electroguard
I'm coming late to your problem, and not even attempting to dig back through your symptoms and assumptions, but instead will say what I would do to get a node working on the network - just bear in mind it's from memory.
I'm using Win7 with a usb wifi adapter. I have an isolated wifi router (no internet connection).

The very first thing to do is check that your wifi router can be connected to in your computers list of available wifi connections (don't allow to reconnect automatically).
Then check that your browser (I'm using firefox because it manages disconnections more gracefully than chrome) can connect to your wifi routers admin page. While you're there, check if DHCP server is enabled, and make note of its range of available IP addresses. Also make note of the default gateway address (cos that's where all network traffic is gonna get shoved to by default), then log off and disconnect wifi when done.

Having proved all the wifi is working, let's focus on the Esp_Basic node. When in doubt, go back to basics and start with a clean slate - cos it's all so quick and easy to do with Esp_Basic, and it removes all doubts and question marks.
V3 A65 is currently the latest, and very stable until overloaded, so run the flasher as administrator, set the top left Comm port and Flash Size as appropriate, click top right Connect and note the red square changes to green, set your esp into flash mode, then click the big Format Flash button.
It only takes a couple of seconds to pop up an OK window, but BEWARE and don't be tempted to immediately reboot the esp back into flash mode again, because I've noticed the esp's blue led gives a brief blink about 10 seconds after format completion, which means it was probably doing something pretty important during that time which would most likely have unwelcome consequences if interrupted.
So reformat, wait 12 seconds, then reboot the esp back into flash mode, then click the big Firmware Flash button to reflash the firmware.
Reflashing will take a lot longer, but when done will briefly do some internal housekeeping, then eventually trigger an automatic esp reboot up into the default AP mode with IP address 192.168.4.1, which can all be confirmed in the serial monitor window.
Browse to it, and confirm you are starting with a clean slate by checking your Edit window is empty, then paste in a simple blinky test script or something, and save it.
Now go to the Settings page and MAKE NOTE OF THE DEFAULT SETTINGS, including the check boxes and empty fields. It's obvious that once you start CHANGING ANY OF THE SETTINGS you will be altering the esps default behaviour, which may not be what you are expecting, so it's very important to be able to return to definite known defaults when things go wrong.
IMPORTANT CAVEAT: There is an important exception to returning to defaults, which is after you've had the esp connected to a wifi router (which is of course the main intention). You may find that the esp keeps persistently logging back on to a previously connected wifi router using 'gost' details even after you've changed Station Mode (Connect to router) Name field back to blank default. To prevent the persistent connections, enter some non-blank fake name in the Station Mode Name field, which will cause the esp to fail to connect and default back to AP mode.
You might need to enter the correct Name but enter an incorrect password to get the required failed connection result. When you've stopped the unwanted persistent connections you can return the Name and Pass fields back to their blank default.

So by now you should know that the Station Mode (Connect to router) Name and Pass fields are the connection details for connecting to a wifi router.

After you are logged on to a router you can browse to the esp's IP address, which you would either have entered manually in Settings, or will be a DHCP address from the router, which you can discover by reading the serial monitor messages during connection.

I would recommend not changing the AP mode (brocast out its own ap) Name unless you have good reason, cos this is your friendly AP welcome home whenever you are having connection problems. Win7 wifi connections windows also has the unfortunate habit of remembering all previous names of the available device and making them all available for connecting to each time... not just the latest assigned name.

A word of warning:
If your nodes have been assigned DHCP addresses by the wifi router, then those nodes are registered with that router which can put them in touch with each other.
If you assign IP addresses manually, then manual nodes aren't in the club and may be ignored by all.
To illustrate that, consider a couple of wifi nodes that you have manually assigned addresses to and which don't connect to a wifi router. Without a default gateway steering them to an all-seeing router, the nodes are effectively blind to anything else on the same subnet. To put your 2 nodes in touch with each other, you could manually set each nodes default gateway address to point to the other nodes IP address, causing them to speak to each other by default. It should be clear that if you start manually assigning things you need to know what you're doing else expect unwanted consequences, so better to let DHCP take care of things if possible.

I wouldn't recommend ticking the 'Run default.bas at startup' box unless your program is fully debugged and ready to be deployed, because it has the effect of automatically running the script and causing automatic wifi connection, making it difficult to break the cycle... which can be done by pressing the gpio00 flashing button straight after reconnection to prevent the script autorunning (don't just hold it in during reboot though, else the esp will go into flashing mode, and possibly corrupt the script).

Hopefully there will be something above which can help you resolve your problems.

Re: Getting Started Guide

PostPosted: Sun Jan 22, 2017 12:51 pm
by forlotto
Also to note if you did connect to your router with its SSID with no password....

Simply download fing if you have an android phone connect to the same wifi router your esp is setup for.

Open fing and run a scan.

Alternatively you can log into your router and view all IP's connected to it by visiting router connection page.

Once you find the esp's IP you simply navigate to that IP and you should see the normal espbasic page or you can navigate to whatever.esp.ip/edit to bring up the editor straight away.

Hope you get it running stick with it you are not that far off the beaten path when you get to this point you are close very close to getting to the basic. Just a small learning curve.

Re: Getting Started Guide

PostPosted: Sun Jan 22, 2017 3:40 pm
by flywire
This worked for me:
bugs wrote:After flashing, the ESP creates its own access point which has no connection with your network.
Forget the pc and router for now.

Using moble phone (or tablet) connect to the ESP access point - your phone may give a warning about no internet access - this is correct and to be expected.
Now open browser on the phone and got to 192.168.4.1 where you will find the ESP settings page.
... the first "Name:" (Station mode connect to your router) must be the SSID of your wifi network - nothing to do with the ESP.
... This assumes that your router will hand out the next available IP when the ESP connects.
Now hit the Save button. ...

I looked up the IP address on my router and connected straight to http://192.168.15.107 on my PC. I was unhappy for a moment when it wouldn't connect to the internet again but I stepped away from my computer for a while and when I came back the Esp and internet were both working. :D :D

I was so close. I appreciate your assistance.