Memotech Network File Transfer

Modern, Memotech inspired, hardware projects
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Memotech Network File Transfer

Post by Dave »

AndyKey wrote: 14 Oct 2018 20:35 And note that the above write-up has links to the detail of the NFX network code, and the VGA Videowall (as it stands so far)...
See this thread for details of the Memotech MTX network hardware first demonstrated at Memofest 2018
http://mtxworld.dk/memorum/viewtopic.php?p=2675#p2675

<Time Passes . . . .>

Here we are, some 2 years later. Martin has kindly sent me one of his NFX prototype boards to play with. Thanks to Martin's hardware and Andy's coding, it's a really neat gadget! Here it is serving a web page over my network to a Windows 10 PC.
webpage.jpg
webpage.jpg (44.93 KiB) Viewed 7711 times
The device runs an http server, meaning that it can serve web pages and respond to curl commands for copying files to/from the MTX and a PC. As great as it is though, the capabilities of http are pretty limited, for example, you can't get a remote directory listing. To make it really useable, an basic ftp server would be needed so you could list files etc. I think that the hardware would support that, even on a 4MHz MTX, but writing something like that would be way beyond me!

So, I'm making a request to any coders out there that might be able to build a basic ftp server on top of Andy's great foundation. (Andy has been pretty quiet of late so I'm assuming that he wouldn't have the time or possibly inclination to look at this.) Even just support for an ftp directory listing would be a great addition.

The other issue for me is that the NFX Test program uses a fixed IP address which sits right in the middle of the DHCP range that I use on my network. Ideally, the program would allow to select a different IP address, subnet mask and default gateway. There's a couple of ways to do that, for example, either by just changing the hard coded addresses or allowing parameters to be passed on the command line or read from a configuration file. I had hoped to be able to do that bit myself, but I am struggling to see how to recompile the source files under SDCC for Windows, so any help with that would be much appreciated too.

regards
Dave
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Memotech Network File Transfer

Post by Bill B »

I thought that this discussion needed a more meaningful title :) Except that changing the subject line does not change the title of the thread :( It might have been better to have started a new one.

There are many possible protocols that can be used to transfer files over a network:
Each of these protocols have different capabilities and complexities.

I would suggest that one of the first things to do would be to define a set of requirements.

One obvious question is should the MTX be the server, or should it be a client? In many ways I would have thought the more obvious approach would be to make the MTX the client, so that the MTX user could load or save files to a network server in a similar way to loading or saving files to a disk.
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Memotech Network File Transfer

Post by Dave »

Hi Bill,

Thanks for joining in - I thought my post might have fallen on deaf ears. As you say though, the thread title probably didn’t help.

As for requirements, at least mine anyway, are to be able to copy files to and from the MTX over the network. Andy has made a great start, but, for the reasons I mentioned, http has too many limitations to make it really useful for two way transfer. The obvious protocol for me was ftp, after all, that’s what it’s for. If there are better options though, I’d be open to change.

As for client or server, I thought server, but probably only because I’m used to using a PC as the client. I also guessed that creating a server may have more need for resources than a client, but that was just a guess. I also thought, that as Andy had already developed the core network functions in NFX, it might be relatively easy (though not for me), to drop another protocol into NFX, rather than start from scratch. As you say though, saving or loading from the MTX akin to a disk drive makes sense.

Regards
Dave

p.s. - moved thread to New Hardware
User avatar
1024MAK
Posts: 757
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: Memotech Network File Transfer

Post by 1024MAK »

To me, it makes more sense if the MTX is the client.

Firstly because normally the majority of the time the data flow will be from PC or website to MTX, and secondly, servers normally are the devices that have the large capacity mass storage media system(s).

There are of course various ways of doing the communication, both from the physical link hardware and the software side.

In another forum, for another 8 bit machine, a member came up with a bit-bashed (three wire) serial link that runs at high speed and can either copy files directly to the 8 bit machines memory or to the local floppy disk. On the 8 bit machine, a ROM based machine code program runs and uses an existing I/O port (with some extra external diodes and resistors) for communication. All that is needed on the PC is a suitable ‘standard’ terminal program that supports RS232 serial ports or USB to RS232 serial adapters. The next level up makes the link a filing system, so that the 8 bit machine sees the PC as a large disk drive. Obviously now a custom program has to run on the PC. I mention this, because as I understand it, it’s possible to carry RS232 serial data over USB and over ethernet.

If a local ethernet is being used, FTP is the most obvious choice, but with suitable software HTTP/HTTPS can be used. You would type a command line on the MTX and the PC would then send the requested file. Or alternatively a menu or search driven system could be used.

However, the actual practical problem with having custom software is finding a willing volunteer who has a reasonable understanding of how to do it and has enough spare time to do the coding...

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer in Somerset later in the year :D

Not as many MTXs as Dave! :lol:
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Memotech Network File Transfer

Post by Dave »

Mark,

Your last paragraph restates the reason for my original post.

I should also perhaps expand on my “requirements” . . .

As well as the ability to transfer files to/from the MTX, the software should be based on TCP/IP, more than likely building on Andy’s work. As I said earlier, Andy has done a lot of work already, having already created the “physical” and “network” layers.

In my simplistic view, it would be easier to “drop in” an additional ftp server service into the existing NFX code than to reinvent the basic transport layers. Of course, all options are available, it just seemed logical to add to, rather than replace, the existing NFX program.

Regards
Dave
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Memotech Network File Transfer

Post by Bill B »

Network clients are generally slightly easier to write. A client is typically only dealing with one transfer at a time and so can often be single threaded, whereas a server has to support multiple connections so almost has to be multi-threaded.

However, given that Andy has already written the HTTP server it does make sense to try and make use of this. Dave's main missing feature is the lack of a directory listing. Now many unsecured web servers, if asked for a location that does not have an index page, will return a directory listing with download links for each of the files. So adding that feature may be sufficient. One approach would even be a sub-program, run after each file transfer, which writes an "index.html" file containing a directory listing.

Has the design of the NFX been published anywhere? Would need this to make our own or to add emulation to MEMU.

One other option, in keeping with the Memotech, would be a NODE Ring over UDP. Doing that for MEMU has been on my "long list" of projects for some time.
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Memotech Network File Transfer

Post by Dave »

Hi Bill,

Yes, as you’ll know, Andy’s NFX code is multi-threaded. Four I think, used for chargen, echo and two for http. The first two are good for testing, but could perhaps be replaced by others (e.g. ftp).

As you say, the big missing is the ability to get a file list from the MTX, so if that alone could be “easily” added, that would be great. The ability to talk to the MTX with the full functionality of my Windows GUI ftp client would be the dream solution, but likely unachievable.

I have a NFX page in progress, I will complete the hardware write up shortly.

For adding to MEMU, would the NFX ROM code be enough? (NFX is basically a slimmed down CFX with a NFX ROM instead of the CFX one and the WizNet gadget https://www.wiznet.io/product-item/w5100/). That might be difficult though, as there would likely be a need to emulate the WizNet hardware too?

Regards
Dave
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Memotech Network File Transfer

Post by Bill B »

Thanks for the link to the W5100 data. That is a lot to emulate, a 32K address space!

Andy's source may include sufficient information on the hardware interface, I will have to take a look.
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Memotech Network File Transfer

Post by Bill B »

Nothing to test this on, so I am coding blind :shock: However try the attached.

This version of NFX.COM has (in theory) two differences from Andy's one:
  • On start-up it reads an optional configuration file NFX.CFG containing one to four lines:
    • IP address - Defaults to 192.168.1.123 if no configuration file.
    • Subnet mask - Defaults to 255.255.255.0 if not specified.
    • Gateway address - Defaults to 192.168.1.1 if not specified.
    • MAC address - Defaults to 00:08:DC:4E:46:58 if not specified.
  • GET / (for example "curl http://192.168.1.123/") should return a directory listing.
If this works it is probably worth removing the echo and chargen services and using all four available sockets for HTTP.
Attachments
nfx_200829.zip
NFX.COM program & source
(33.22 KiB) Downloaded 402 times
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Memotech Network File Transfer

Post by Dave »

Hi Bill,

thanks a lot !

the directory listing is returned (in html format) :D

I could not see the syntax for the config file, so I tried to look in the sourse and failed miserably, can you tell me the format for the network entries in the config file please? (I could not find any reference to it in the source)

Update : found it! But it does not appear to be working, still trying . . . .

Bill, can I query this pleases . . .
net_fcb.type[0] = 'C';
net_fcb.type[0] = 'F';
net_fcb.type[0] = 'G';

regards
Dave
Post Reply