Resolving the ESP connection problems

So I finally got fed up with the flaky state-machine so I decided it was time to hook the ESP to a FTDI device. I should have done this some time ago, as I found out some very interesting things...

First off, the ESP chip obviously has some flash memory because it remembers the last access point it was connected to. To the extent that it will reconnect at power up (or being sent AT+RST) without intervention! So my state machine was going through the motions and the reconnect was borking it, as the messages from the reconnect where causing all kinds of problems for the state transitions as they came in at a non-deterministic time after start up.

It also properly handles disconnect/reconnect from/to the AP. So that's good, it's one less thing to worry about.

The new state machine will take this into consideration. With a 10 second wait after start up to see if it reconnects. If it does, the microcontroller will advance directly to the "OPENING" state where it opens and starts listening on a socket. With an unconfigured device (or unavailable access point) it wil configure itself as an AP and open a socket on port 80 and serve a simple page to a passing browser to accept an SSID/password for the real network it needs to connect to, on receipt it will try a reset and start over. Or at least, that's the plan

There will be a command to put it back into this mode too from the configured mode

Subject: