Tachyon 5.6 - Easynet: Wrong output fo ifconfig
Hi,
We have build EASYNET in the following way:
1 - Load EEPROM with kernel (TACHYON5r6.SPIN with PropellerTool (6MHZ))
2 - Paste EXTEND.FTH
( SYSTEM REBOOTS WHEN DONE )
3 - FORGET TOOLS (HIT THE ENTER TWICE)
4 - Paste EASYFILE.FTH (&27.24.26.25 SDPINS ( SD8 ))
5 - RECLAIM
6 - Paste EASYNET.FTH (&17.20.19.18 WIZPINS ( P8 ))
7 - Paste FTP.FTH
8 - Paste HTTP.FTH
Afterwards we changed gateway and sip as follows:
&192.168.040.006 GATEWAY
&192.168.040.201 SIP
Then we get the following output from ifconfig:
The position of the run time is wrong. It starts one position to late.
There are no values for TXRD, TXWR, RXRD, RXSZ and IR.
The status is '14 14', but it should be something like '14 LISTEN'.
We have build EASYNET in the following way:
1 - Load EEPROM with kernel (TACHYON5r6.SPIN with PropellerTool (6MHZ))
2 - Paste EXTEND.FTH
( SYSTEM REBOOTS WHEN DONE )
3 - FORGET TOOLS (HIT THE ENTER TWICE)
4 - Paste EASYFILE.FTH (&27.24.26.25 SDPINS ( SD8 ))
5 - RECLAIM
6 - Paste EASYNET.FTH (&17.20.19.18 WIZPINS ( P8 ))
7 - Paste FTP.FTH
8 - Paste HTTP.FTH
Afterwards we changed gateway and sip as follows:
&192.168.040.006 GATEWAY
&192.168.040.201 SIP
Then we get the following output from ifconfig:
ifconfig -->
NETWORK STATUS:
LINK *UP*
HARDWARE: WIZnet W5500 V4
SRC IP &192.168.40.201
MASK &255.255.255.0
GATEWAY &192.168.40.6
MAC 02.FF.C5.24.6C.54.
SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR
#1 02:04:02 TCP 21 0 0000.0000.0000.0000.0000. 00 14 14 &0.0.0.0
#3 02:04:02 TCP 10001 0 0000.0000.0000.0000.0000. 00 14 14 &0.0.0.0
#4 02:04:02 TCP 80 60246 0000.0000.0000.0000.0000. 00 14 14 &192.168.40.171
ok
The position of the run time is wrong. It starts one position to late.
There are no values for TXRD, TXWR, RXRD, RXSZ and IR.
The status is '14 14', but it should be something like '14 LISTEN'.
Comments
The reason that the status was not displaying LISTEN is simply because these more handy but verbose messages were removed for taking up code space, however I have restored them for diagnostic purposes. The second 14 in your output was simply printing the value rather than the label and IP.
Maybe not related to your testing but I had performed a RECLAIM on HTTP and FTP modules and inadvertently removed the necessary ?FTP and ?HTTP headers since they were marked private and were reclaimed. I fixed up a couple of other minor things and posted a new binary just for the IoT5500+P8 module. You can download the latest version from the Dropbox V5 binaries folder or just download the attached version I just tested.
The RD/WR values are simply there for diagnostics and due to W5500 quirks and IIRC you can't actually read these registers unless the socket connection is established. Tachyon maintains shadow registers which are updated when it writes to the physical register.
From my source notes:
Here's an FTP output:
220 WELCOME TO THE TACHYON WIZNET FTP SESSION! 213 133590 550 Modification time not available 150 Accepted data connection for TIGER.JPG SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #2 00:01:34 TCP 44464 32840 AB02.AB02.0000.0000.0000. 13 00 closed 226 File successfully transferred SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #1 00:01:34 TCP 21 57124 4EFE.4EFE.007B.007C.0001. 16 00 closed SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #1 00:01:34 TCP 21 57124 0000.0000.0000.0000.0000. 00 14 LISTEN ...
and the ifconfig:
... ifconfig -->
NETWORK STATUS: LINK *UP* HARDWARE: WIZnet W5500 V4 SRC IP &192.168.0.99 MASK &255.255.255.0 GATEWAY &192.168.0.1 MAC 02.FF.59.59.D2.D6. SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #1 00:06:13 TCP 21 57276 0000.0000.0000.0000.0000. 00 14 LISTEN #2 00:06:13 TCP 45328 34330 AAF4.AAF4.0000.0000.0000. 03 00 closed #3 00:06:13 TCP 10001 55296 0000.0000.0000.0000.0000. 00 14 LISTEN #4 00:06:13 TCP 80 44676 0000.0000.0000.0000.0000. 00 14 LISTEN ok
and a diagnostic look at the FTP socket registers:
... FTP .SOCKET --> SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #1 00:07:31 TCP 21 57276 0000.0000.0000.0000.0000. 00 14 LISTEN ok ... 0 $40 WIZ @SKT DUMP --> 0000.0000: 01 00 00 14 00 15 18 03 73 40 CE 20 C0 A8 00 65 ........s@. ...e 0000.0010: DF BC 05 B4 00 00 80 00 00 00 00 00 00 00 02 02 ................ 0000.0020: 08 00 00 00 00 00 00 00 00 00 00 00 FF 40 00 00 .............@.. 0000.0030: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ok ... 0 $40 WIZ @RX DUMP --> 0000.0000: 55 53 45 52 20 61 6E 6F 6E 79 6D 6F 75 73 0D 0A USER anonymous.. 0000.0010: 50 41 53 53 20 6D 6F 7A 69 6C 6C 61 40 65 78 61 PASS mozilla@exa 0000.0020: 6D 70 6C 65 2E 63 6F 6D 0D 0A 53 59 53 54 0D 0A mple.com..SYST.. 0000.0030: 46 45 41 54 0D 0A 50 57 44 0D 0A 54 59 50 45 20 FEAT..PWD..TYPE ok ... 0 $40 WIZ @TX DUMP --> 0000.0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0000.0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0000.0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0000.0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ok ... 0 $40 WIZ @COMMON DUMP --> 0000.0000: 00 C0 A8 00 01 FF FF FF 00 02 FF 59 59 D2 D6 C0 ...........YY... 0000.0010: A8 00 63 00 00 00 00 04 00 13 88 10 28 00 00 00 ..c.........(... 0000.0020: 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 BD 00 ................ 0000.0030: 00 00 00 00 00 00 00 78 25 04 00 00 00 00 00 00 .......x%....... ok
"I get invalid propeller image! this is very bad "
I try the one on dropbox and on you comment.
Building manual works
We have meanwhile changed my comment from yesterday.
Now it is better readable.
I have downloaded the binary of your comment from today.
But I get
Checksum Error!
Byte 5 (Checksum) is incorrect.
when I try to open EASYNET-IOT.binary with the Propeller Tool.
When I download EXTEND.FTH, EASYFILE.FTH, EASYNET.FTH, FTP.FTH and HTTP.FTH
and paste them manually, building works also here.
Changing gateway and sip with
&192.168.040.006 GATEWAY
&192.168.040.201 SIP
I can use telnet in a teraterm window with IP 192.168.040.201 and port 10001.
In that window I can use forth for instance
1 2 + .
But after a while the teraterm window disappears.
I can also use http in a firefox window to read the contents of a file on the sd card.
With
192.168.40.201/EASYFILE.FTH
I get the contents of the that file in firefox.
Although the whole contents is already there,
it is still loading for the file until a timeout is reached.
During that time I can read the next file with
192.168.40.201/EASYNET.FTH
I get the contents of that file,
but every time it is still loading although the contents is already there.
If you use Filezilla for FTP be sure to use site manager to setup the server as plain FTP as quickconnect does not do this.
For simple FTP try typing ftp://<your ip> into your browser and it should list the files and from there you can download any files.
I can also download files from the SD card with simple FTP and Filezilla.
But when I upload a small file (00189513.HTM) with Filezilla,
the file has in the end a size of 67108864 and is not readable any more on the SD card.
It may have to do with the same problem I mentioned yesterday,
that I can use http in a firefox window to read the contents of a file on the sd card.
With
192.168.40.201/EASYFILE.FTH
I get the contents of the that file in firefox.
Although the whole contents is already there,
it is still loading for the file until a timeout is reached.
The 3rd problem, which I also mentioned yesterday, is,
why a telnet session in teraterm (with IP 192.168.040.201 and port 10001) disappears after a while.
Does anyone know, what has to be done to solve one or more of those porblems?
I will check what this timeout is on Firefox. The FTP side looks fine and I can click on a file in the directory listing and it loads up fine.
The telnet session has a timer on it but we can change that easily. You can even just type in "0 contmr TIMEOUT" to prevent this background from timing out and executing a disconnection request.
On the other hand, Filezilla downloads the file and closes correctly.
Uploading a File using Filezilla ends quickly and normally, but shows a 64MB file size. This file can not be accessed on a Windows computer.
The FTP STOR command calls FMAKE$, but I see for some reason I decided to create a 64MB file by default. Not a big deal when you have Gigabytes to work with. Originally I made it 1MB but if you start storing a larger file it then has to allocate clusters which I only like to do with the newly created file to keep all the files unfragmented. So perhaps I may change that default to a user specified default otherwise 1MB, but I will need to check why it zapped the MBR. In fact, on TAQOZ the filesystem can't write to the MBR unless it has special permissions.
--- Open or create a file pub FMAKE$ ( name -- flg ) --- create default 1MB file if it doesn't exist FOPEN$ NOT IF 64 MB FILE$ FCREATE$ FOPEN$ THEN ;
"0 contmr TIMEOUT"
the telnet session is not timed out any more.
Today I have downloaded the changed sources from DropBox
and have tested the upload of a file of size 5 KB with filezilla onto the SD card again to find out,
if the situation has changed meanwhile.
Now the uploaded file has a size of 1048576 instead of 67108864 last week.
This is the output of the serial session in a tera term window:
220 WELCOME TO THE TACHYON WIZNET FTP SESSION! 550 File not available SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #2 00:00:00 TCP 46732 62120 0C64.0C64.0000.05B4.05B4. 07 18 FIN WAIT &192.168.40.171 SKT HH:MM:SS MODE PORT DEST TXRD TXWR RXRD RXWR RXSZ IR STATUS IP ADDR #1 00:00:00 TCP 21 62119 2197.2197.0053.005C.0009. 16 00 closed
If I try again for some times, then I get the following output:
220 WELCOME TO THE TACHYON WIZNET FTP SESSION! 150 Accepted data connection for PRNT2255.HTM Propeller .:.:--TACHYON--:.:. Forth V5r6 NEON 560190920.1700 CODE:$5342 = 20802 bytes NAME:$550E = 7922 bytes DATA:$7950 = 1088 bytes FREE: = 460 bytes Data Stack (0) CARD: SU08G SD03.80 #77E9.E903 2010/1 !C0FF.80AF 1,611us FAT: #5C98.7460 MSWIN4.1 IOT5500 FAT32 7,944,011,776 bytes (32kB clusters) *** Tachyon Forth EASYNET Network Servers and EASYFILE File Server *** CARD: SU08G SD03.80 #77E9.E903 2010/1 !C0FF.80AF 1,602us FAT: #5C98.7460 MSWIN4.1 IOT5500 FAT32 7,944,011,776 bytes (32kB clusters) CARD: SU08G SD03.80 #77E9.E903 2010/1 !C0FF.80AF 1,602us FAT: #5C98.7460 MSWIN4.1 IOT5500 FAT32 7,944,011,776 bytes (32kB clusters) IOT5500 EXTEND .FTH EASYFILE.FTH EASYNET .FTH 00189169.HTM 00189513.HTM PRNT0105.HTM PRNT0155.HTM PRNT1155.HTM PRNT1255.HTM PRNT2255.HTM
The original file has a size of 5109.The file is still not readable on a Windows system.
An od -b on a linux system shows:
$ od -b PRNT1155.HTM 0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 * 1447000 370 377 377 017 377 377 377 377 377 377 377 017 377 377 377 017 1447020 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 * 4000000
It seems, that the contents of the original file is not uploaded to the destination file on the SD card.
BTW, Preallocating 1MB is not a waste, it is just practical. Even if we were to create 1,000 files then that would still only take up 1GB on the card and the smallest card I can buy is 16GB. However I will look at some other ways of doing this by creating new files at the end of the used memory and letting them grow while STOR is saving to it.