Integral Web-pages

   Connecting
When the firmware boots up on the ESP device it automatically 'serves up' some integral web pages for users to connect to.
By default, the device configures itself as an AP (Access Point) at IP address 192.168.4.1 with a wifi SSID called ESP(plus MAC address).

A device on the same wifi network can connect to the ESP SSID and browse to the ESP IP address to open the default Output webpage,
If the wifi connection is broken, as for instance happens if the ESP reboots, any browser connections to the ESP will obviously be broken.
If the wifi connection is not configured to reconnect automatically, then the connection will remain broken until manually reconnected again.
The Output and Editor pages both have connection indicators which show green when connected but turn red when disconnected.

The red box shows the browser has lost connection with the ESP device... check for wifi SSID connection, then try clicking Reconnect button.

Whenever things are not behaving as expected, the first thing to check is that the browser has not lost connection to the ESP and turned red.
If the browser has lost connection, check if there is still wifi connection to the ESP, and if no ESP SSID is available, try rebooting the ESP device.
 


   Integral Web Pages
The default Output web page is where all script HTML output is sent to - it includes several menu buttons for opening various integral web pages:

Output Page
The first button on the Output page allows opening a 2nd copy of the Output page if wished.
Why would you want 2 Output pages at the same time ? ... mainly for testing purpose:
Annex-Wifi Basic allows up to 5 simultaneous connections - the computer Toolkit uses one, the Editor uses one, and the1st Output page uses one.
But more than 1 device can be connected, so it's possible to have eg: a computer plus a smartphone plus a tablet all connected to the ESP device at the same time - the ability to open a 2nd Output window allows testing of multiple connections and alternative window sizes and resolutions etc.
TIP: The  ONHTMLRELOAD command defines a branch label where the program will jump to when a reload of the Output html page is requested or a new client connects to the page ... this offers opportunity to cater to different individual users on different devices.


Editor Page


If the 'Connection' box turns red it is because the browser Editor page has lost connection with the ESP device - nothing you then do will register with the disconnected ESP, so anything you do (including any edits or other changes) will all be lost when the device is Reconnected.

To avoid losing unsaved edits after losing connection, do Select All and Copy, then Paste back again AFTER browser reconnection.

After a disconnection the Editors link to the source file is lost, so after reconnecting you must either Open or Save the file to re-link it to the editor.

It is possible to click within the displayed 'File to Run' window and edit the filename if wished, then Save to that new filename.

The 'Advanced' checkbox allows loading another file into the editor window while still keeping the existing file loaded in the background and able to Run and Stop and view the results in the Output window. The original background file will need to be reloaded when Advanced is unticked.

Clicking the line numbers on the left will toggle red breakpoint, giving ability to Run or SingleStep the script up to the breakpoint(s).

The Syntax Highlighting toolbar icon allows to toggle syntax highlight on or off for the currently selected script Language syntax.

The 2 right-hand toolbar icons permit to insert or remove block comments for the selected lines (great for quickly switching out blocks of code).

The divider above the wlog (web log) window can be dragged down (using a right-hand drag handle) to change the ratio of the 2 windows.
The wlog window displays all system errors as well as browser output traffic - the checkbox underneath allows turning off wlog entries if preferred.

The 2 Variable windows allow specifying a variable name and monitoring associated variable value using the Get Variables button.
The Clear RAM button recovers all memory being used by variables.

The Immediate window permits executing commands without a script - eg: CLS then press Enter key to immediately clear the Output page.
Place cursor at the end of any history line the press Enter to execute that instruction again with having to retype it all back in.

NOTE: If the device connection is broken and remade, do a file Save or Open of the current editor file to re-register it again with the ESP.
NOTE: Leaving the Editor page, then returning back to it, will lose any unsaved edits, and return the editor to its default settings.

Run, Pause, Stop
These 3 buttons control the script operation - if the script is stopped Run starts it, if paused Run will un-pause it. 
These same buttons are also available from the Editor page, as are the File Manager and Config buttons. 
NOTE: all the Output page controls can be turned off from the Config page to provide a clean uncluttered user output screen if wished.
NOTE: uploading a different version of any web page does not automatically run it, so you should close the old, then open the new.

NOTE: F2 button opens a context-sensitive Online Help page in the browser, which jumps to whichever Annex instruction the cursor is over.
Use the Help Search window to find all related help information about a particular topic, eg: serial
TIP: Use the context-sensitive help for debugging typo errors - Online Help will not jump to a mis-spelled Annex instruction it cannot recognise.


Config Page


'Station Mode' Name and Pass are for credentials needed to logon to a wifi router.
'Ap Mode' Name and Pass specify the SSID credentials needed for logon to the Annex-Wifi Basic Access Point.  
IP address, Subnet mask and Gateway are for a hard-coded static IP address - leave blank for DHCP client and 192.168.4.1 AP.
HTTP Port is normally port 80, but can be changed if blocked by firewalls etc.
'Protected Access' requires that the appropriate credentials be entered to gain access to any Annex-Wifi Basic served web pages.
'Time Zone' is the relative time offset from GMT, probably the same as your computers time zone.
'NTP Server' is for specifying an alternative Time Server IP address or name (currently uses pool.ntp.org and time.nist.gov)
'OTA url' is the url that is displayed when you 'Start OTA Server' from the 'OTA' tab of the computer utility tool.
'Menu bar Disable' checkbox allows preventing any controls from being displayed on the user Output screen.
'Run Default.bas at startup' checkbox allows the device to autorun the 'default.bas' script at power-on or reboot.
'Save' button saves any changed settings to '/_root/config.ini' to be read at power-on and reboots.
'Format' button wipes out all SPIFFS file entries to leave an empty filing system.
'Restart' button causes the ESP device to reboot, therefore connections will obviously be broken.
'OTA Update' button invokes Over The Air firmware update with the bin file pointed to by 'OTA url' if the OTA server is started. 
 

File Manager Page

Delete allows to delete individual files from SPIFFS.
View allows to display individual web pages, text files, stylesheets, javascripts.
Rename can rename individual files, or rename their paths to effectively move a file to a different folder.
Repair Disk uses some undocumented magic to do a chkdsk equivalent to the SPIFFS filing system, and can even repair corrupted SPIFFS.
Upload allows selecting individual files for uploading from computer.

NOTE
: these File Manager file operations only work on single files - so use the File Manager Tab in the Computer Tool for multiple file operations.