FTPserver.bas is intended to be run on a Maximite computer to make file transfering easier.
It was developed on a Colour Maximite 2 and has been tested on an ARMite F407.
 
It uses a subset of the FTP commands and has been tested with Total Commander on Windows and Android as well as gFTP on Linux.
It requires a ESP32 running the standard AT command set firmware. Tested with V2.1.0.0
It requires a serial port connection as well as one handshake line.
For handshaking, GPIO14 (RTS) needs to be connected to any user defined IO pin (default pin is 36)
If you are using an ESP32-S2 series chip, this will be different.
I included a 1k resistor in series to prevent issues if other software uses the RTS pin as an output.
Don't use pins 37 or 40 on the CMM2

I had difficulties getting the ESP8266 running due to problems when the data stream is closed.

The program creates a file FTPserver.ini in the program folders with your preferences.
The easiest way to configue the program to suit your installation is to run the program then quit (using <ESC>). This will create the text file which you can then edit.

By default, the program assumes that your WiFi is already configured. If not, Option 'W' will try and connect using the SSID and password in the ini file.
Once you have the ESP32 connecting on startup, you may wish to change the SSID and password to a generic name to protect your true password from prying eyes.

Current state of commands implemented:

USER 	any username is accepted and password requested.
PASS 	any password is accepted
CWD  	change working directory
CDUP 	change up one level
QUIT 	gracefull exit and go back to waiting for connection
PORT 	client specifies port for data.(Active mode)
TYPE 	A (ASCII) and I (Image or binary) are both accepted but are really both binary.
		No second paramater accepted
RETR	retrieve. send file from the server
STOR	store. send file to the server.
RNFR	rename from
RNTO 	rename to. These work as a pair of commands
ABOR	Abort file transfer
DELE	delete file or folder. No protection against trying to delete a non-empty folder.
RMD		delete a folder. No protection against trying to delete a non-empty folder.
MKD		Make directory. create new folder.
PWD		Print name of current working directory.
LIST	List files in current folder. Includes 'fake' permissions and size and date formatted.
		Does not accept a path or file name so only current directory available.
SITE	SITE CHMOD accepted but faked and success reply sent
NOOP	OK responce sent

FEAT	returns "SIZE" as the only feature
SIZE	returns size of given file.
SYST	system. returns "215 UNIX emulated by MMBasic"


PASV 	Passive mode NOT supported (you can't have two servers enabled)
MODE	not supported default is 'stream'
STOU	not supported
APPE	not supported
ALLO	not supported
REST	not supported
NLST	Not supported
STAT	not supported
HELP	not supported
