Shop OBEX P1 Docs P2 Docs Learn Events
Propeller as an HTTP server -No Spinneret Required! — Parallax Forums

Propeller as an HTTP server -No Spinneret Required!

ProcessingData...ProcessingData... Posts: 208
edited 2011-09-01 05:36 in Propeller 1
This July, I wrote a Spin Object that would allow you (through Python) to use any Propeller Chip with a Serial connection to a computer to act as an HTTP server.
Original Thread

It was thrown together in about 45 mins, and had quite a few bugs in it, as I found out.

These past few weeks I have revisited the code, adding support for GET variables, removing several bugs in the code, putting more comments into the code, and compiling a windows executable file of the Python script, so that users without Python can use it.

I've also added a brief explanation of HTTP (Hyper Text Transfer Protocol).

The only thing needed is a Computer with a Serial Port and Browser, and a Propeller with a Serial connection.

The Web page included with this Demo Server has a visitor counter, and a Form demonstrating how to use GET variables.

Cheers!

~ Proccessing Data

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-08-30 12:39
    Nice! Any chance we can get you to MIT license this project? I'd like to include it in some materials I'm working on.

    Who knows.. maybe I help it get a little more attention. ;)

    OBC
  • ProcessingData...ProcessingData... Posts: 208
    edited 2011-08-30 14:01
    Sure, OBC!

    I've updated the code in the attached .zip to have an MIT license.
  • TonyWaiteTonyWaite Posts: 219
    edited 2011-08-31 05:10
    Hi,
    This looks very useful indeed - thank you for its contribution!
    T o n y
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-08-31 07:46
    I assume "through Python" and a serial connection requires a PC doing this.

    Maybe I make wrong assumptions but right mow this looks to me as replacing the tiny spineret webserver through a "big" PC.
    Wouldn't it be easier to use the PC directly as it is part of the system?

    Maybe I'm just not able to see the advantage of it. Except for the fun to let a propeller do the task.

    best regards

    Stefan
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2011-08-31 12:27
    @StefanL38: The Propeller gives the website pins to work with, so you can control things with it that you would not be able to with just a PC. This allows you to use the website as the "control panel" for the Propeller. At least, from my understanding.
    ProcessingData showed me how this worked at UPENE. It's pretty cool, I'll have to give it a run.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-08-31 14:33
    This looks pretty useful. Using the web browser can be the interface to the prop saves us having to write that part of the interface. The ability to do this directly on the prop connected serially to the PC allows the separation of the prop application and the Ethernet application for the wiz5x00.

    That is, once the ethernet portion is up and running, and installed, we can experiment with the prop part back on the bench without consuming another spinneret board.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-31 19:16
    The Propeller gives the website pins to work with, so you can control things with it that you would not be able to with just a PC. This allows you to use the website as the "control panel" for the Propeller. At least, from my understanding

    The Python program is replacing the functionality of the WIZnet ethernet controller that the Spinneret uses...

    Spinneret: Propeller <--> Serial Connection <--> WIZnet Ethernet Controller <--> Ethernet Connection
    PD's Prg: Propeller <--> Serial Connection <--> Python Ethernet Controller <--> Ethernet Connection

    There are pros / cons to each method.
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-09-01 00:35
    OK I understand now.

    May I suggest to change the headline from Propeller as an HTTP server -No Spinneret Required!
    (which leads me to the conclusion that the prop will "serve" webpage-contents)

    to

    controlling/displaying propeller-IO-pins from a webpage through a python-bridging software

    keep the questions coming
    best regards

    Stefan
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-09-01 05:36
    Well, the Propeller really is serving the content. When you load server.spin into eeprom, it also loads index.html into eeprom. This is what get served by the Propeller when it receives a request. The Python program is acting as an ethernet interface between the Propeller and web browser, which is basically what the WIZnet does.
Sign In or Register to comment.