HTTP server for the Propeller Chip
I'm currently working on an HTTP server based on the Propeller Chip and I would like to let you be part of this project.
It uses the TCP/IP stack PropTCP by Harrison Pham and fsrw version 2.4 by Tomas Rokicki and Jonathan Dummer.
Both objects are already included in the package.
Basically the server is doing these things right now:
- waiting for a get, post or head request
- if the request contains a filename, then check the sd card whether this file is available, send an HTTP header ("head" would stop here) and then send the file
or
- if no filename is specified, send back a list of files found on the sd card
So, you will see that there is a lot of space for improvements / extensions:
- speed improvements: currently the maximum bandwidth you can get is 850 kBit/s while overclocking the Propeller to 100 MHz
- PHP ?!?
- access to I/O-ports via web interface
- stability improvements, as there are some known bugs:
1. streaming music works fine with Windows Mediaplayer and Quicktime, but it won't work properly with the VLC mediaplayer or a portable device like the iPhone
2. if you try to save a file, the computer waits for the transmission to begin, but the server already started transmitting before you specified the location for the file to be saved
- compatibility improvements: currently I'm just testing this with Firefox, but I know that the Microsoft Internet Explorer has problems displaying the list of files
I'm trying to fix some bugs / add some new features aswell (for example: webpage access control, creating log files, etc.), but my studies are keeping me busy at the moment and I don't want to fail my exams
It uses the TCP/IP stack PropTCP by Harrison Pham and fsrw version 2.4 by Tomas Rokicki and Jonathan Dummer.
Both objects are already included in the package.
Basically the server is doing these things right now:
- waiting for a get, post or head request
- if the request contains a filename, then check the sd card whether this file is available, send an HTTP header ("head" would stop here) and then send the file
or
- if no filename is specified, send back a list of files found on the sd card
So, you will see that there is a lot of space for improvements / extensions:
- speed improvements: currently the maximum bandwidth you can get is 850 kBit/s while overclocking the Propeller to 100 MHz
- PHP ?!?
- access to I/O-ports via web interface
- stability improvements, as there are some known bugs:
1. streaming music works fine with Windows Mediaplayer and Quicktime, but it won't work properly with the VLC mediaplayer or a portable device like the iPhone
2. if you try to save a file, the computer waits for the transmission to begin, but the server already started transmitting before you specified the location for the file to be saved
- compatibility improvements: currently I'm just testing this with Firefox, but I know that the Microsoft Internet Explorer has problems displaying the list of files
I'm trying to fix some bugs / add some new features aswell (for example: webpage access control, creating log files, etc.), but my studies are keeping me busy at the moment and I don't want to fail my exams

Comments
http://forums.parallax.com/forums/default.aspx?f=25&m=385830
Right now I am rewriting the TCP stack to use the Spin object structure more effectively, which I think will save 1 to 2 K
of Hub RAM. I will also MIT license it when I'm done so it can go in the obex.
Once running properly in spin, it could be sped up in pasm. Yes, not enough room! But, overlays are fast - I have done a fast loader - and a mix of LMM as well could improve that speed many times over. But, best to get the code running nicely first up.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
I·want·to build a Web server based Home Automation unit.
http://forums.parallax.com/showthread.php?p=858942
The Home Automation will communicate via radio (RFM12) with actuators and sensors.#
ciao
Marcello
I think the most practical way would be:
1. If the URL ends with ..../cgi/SomeCommand it could be interpreted as a function call of a function that has to be implemented in SPIN. Simply make a hash value out of SomeCommand and have a case statement that calls the right function if the hash value is recognized.
2. If the URL ends with AnotherCommand.cog you can load the AnotherCommand PASM image from SD card and execute that.
3. If the URL ends with YAC.col you'd run a LMM image named YAC from SD card. (COL = COG in LMM format)
For 1. and 2. there is already code available : FemtoBasic, my COGOs ...
Some other suggestions:
You most likely want to have input fields. Rather than using any kind of name, the memory adress could be used where to store the value. Then a simple parser can scan the GET string and convert longs to long ... copy strings to the right buffer with adding string end byte. To avoid that any memory location can be overwritten, a simple range check should do.
At the moment I don't think that there will be much difference in terms of speed, because
I took another approach (which didn't work out):
I tried to use two buffers instead of one, with one cog writing the data from the sd card to the first buffer and another one sending the data of the second buffer and vice versa. To respect the different execution times of the two objects involved, I added a status byte, which showed each cog whether the data can be overwritten / can be send.
The problem was that this parallel processing was even slower than the sequential one.
So I guess you'll have to rewrite the included objects in pasm first.
As long as the data read from the sd card fills the webBuffer completely, the main part of the data transmission is actually very fast, because it can handle 4096 Bytes (or even more) with one loop:
___________________________________________________________________________________________
In the attachments you'll find a slightly modified version of the webserver:
- changed the list of files to html: it's now displayed correctly in the Microsoft Internet Explorer
This is what I almost expected...
I'm trying to use this in the webpage access control I'm working on. Reading the password which is contained in the body of the request, checking if it's right and then directing to another page (which would be "403 forbidden", if somebody tried to open it directly)