We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Vladimir Djukovic
Last Updated: 2013-09-01
Package Version: 1.0.0.0
Example: 1.0.0.0
Category: Communication
Downloaded: 1362 times
Not followed.
License: MIT license
Demo - test; Simple embedded FTP server application in LAN environment based on PIC18F devices; Can be useful for special purposes. More on project blog page.
Do you want to subscribe in order to receive notifications regarding "FTP Server" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "FTP Server" changes.
Do you want to report abuse regarding "FTP Server".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1378075968_ftp_server_mikroc_pic.rar [696.80KB] | mikroC PRO for PIC |
|
CLIENT - SERVER mode of operation characteristics:
The main point is to allow a PC connected over Ethernet to the server
to access the server's file content and to download it.
Blosk schematic :
PC FTP client software - command line interface:
- Standard command prompt FTP service:
- Only active mode connection (server initiates data channel opening):
- Supported FTP client actions on the file content: RETR command only
- in other words this embedded FTP service at the moment provides
an opportunity for a client machine to download the file content stored in the server's storage
memory.
Server default IP address: 192.168.0.1
Primary intended to be directly connected via Ethernet cable to the Network
Interface Card of a PC at a distance. As in the previous block schematic.
Code is written to serve for that needs.
Provide file accessing to only one client machine at the same time:
two static allocated socket in code: Control(port service 21), and Data (port 20) socket:
There is no working guarantee in a "real" LAN (noted some file content
loses while it is being downloaded)
Transfer speed low: max noted 7 kb/s
FTP process "state machine" should be improved to provide all flexibility.
In this code examples the FTP timeout is not appllied, but it change nothing
for testing purpose.
STORAGE characteristics:
- supported file system: only FAT16 (FAT); 8.3 file name format.
- only root directory handling.
- up to several files (seven/eight max). Care should be taken - do not allow to much files to
be present in the storage at the same time, in otherwise it shall cause server fail
while receives a directory listing command from client. The main point here is that the directory
listing content must be no more than 512 bytes in size (TCP Tx buffer size). Used library for this is the compiler's MMC FAT library -there is no routine that returns the directory listing pointer while reading its content, than directly print directory content to an output medium while the listing is being read - byte by byte (ascii by ascii).
HARDWARE CONFIGURATION:
Tools/Components:
EasyPICv7development system:http://www.mikroe.com/easypic/ Serial Ethernet board: http://www.mikroe.com/add-on-boards/communication/serial-ethernet/
mikroSD Card board: http://www.mikroe.com/add-on-boards/storage/microsd-card/ StartUSB for PIC board: http://www.mikroe.com/startusb/pic/
74HCT244 3-state bus driver IC: http://pdf.datasheetcatalog.com/datasheet/philips/74HC_HCT244_CNV_2.pdf
1. FTP server with PIC18F4620/ENC28J60 + MMC SD card 2GB. Only as an example for FTP server code. MMC storage already contains previously stored files (eg. via a card reader) . Since the transfer speed is only about 7kb/s, it is not recommended to test another file formats out of the group of file formats that can be considered as documents (txt files, short pdf..)
2. Configuration with two subsystem counterparts.
- FTP Server as in 1.
- Subsystem with PIC18F2550 for working with server's storage memory content (arranging the file
content in MMC card memory space - after that the file content can be accessed by a client machine)
Additional information can be found in MMC_2550_storage.h file.
This configuration could be useful for some spwecial purposes: eg. the user can write its own
firmware for PIC18F2550 to serve for file storing into the server's storage space (MMC card)
or any other actions applied on the file content. Files themselves can be generated by the firmware
itself or e.g. to be obtained through UART, USB connection from another machine, etc.
Use compiler's MMC FAT Library for this purpose.
This part is still under development but as a prototype like here can be usefull for purposes where
few files are to be present in a storage at any given moment, while letting their content to be retrieved by another (client) computer through FTP/TCP/IP/Ethernet (application-session/transport/network/connection)
MAIN LIBRARIES USED:
- Network Ethernet Library: http://www.libstock.com/projects/view/107/network-ethernet-library
- MMC Library (compiler)
SCHEMATICS: