Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: mawg on April 08, 2011, 04:56:53 am

Title: Any programmers here? Can I have logic in my web pages?
Post by: mawg on April 08, 2011, 04:56:53 am
Following my previous question (viewtopic.php?f=24&t=2033&p=19873#p19873 (http://dangerousprototypes.com/forum/viewtopic.php?f=24&t=2033&p=19873#p19873)), I am wondering if I can actually make any logical programming at all.

Or, thos rephrase that - what is the "webserver" capable of? Does it just serve stati HTML pages (presumably also wiith CSS)?  It appears that there is no PHP interpreter.

Is there any other way of programming some CGI?  For instance if the user requsts htpp:// (http://htpp://)<wbplatform>/info?product=X  can I some react differently based on the value of X?
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: dpropicweb on April 08, 2011, 06:26:10 am
You seem to be missing the big picture still. You are dealing with an 80MHz/40MIPS  microcontroller with limited memory and no operating system. This is not a fully-fledged, multi-gigahertz microprocessor-based computer with an operating system and oodles of memory. There is therefore no drop-in PHP interpreter or SQL database.

Of course you can do logical programming... you just have to write the C/asm code yourself and incorporate it into the stack's cooperative multitasking architecture without exhausting the available memory (especially RAM).

As for CGI programming, have you not looked at the Microchip stack demos? For a fairly complex example, check out the vending machine demo, but there are simpler ones.
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: honken on April 08, 2011, 07:13:57 am
The microchip tcp/ip webserver supports both get and post arguments through a user supplied callback function, so yes. If you implement that other behaviour through this function.
The demo pages has a form that let you turn less on and off.

But I assume you want to serve up a totally different page with that request.  It could be done, somewhat ugly, with a huge variable substitution.
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: ian on April 08, 2011, 07:56:49 am
Have you considered a Beagle Board or similar? They are 3-4x more expensive that the Web Platform, but provides a robust embedded system that can (I think) run Linux with php, SQL, etc.
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: mawg on April 09, 2011, 03:28:13 am
[quote author="Trev"]Of course you can do logical programming... you just have to write the C/asm code yourself and incorporate it into the stack's cooperative multitasking architecture without exhausting the available memory (especially RAM).

As for CGI programming, have you not looked at the Microchip stack demos? For a fairly complex example, check out the vending machine demo, but there are simpler ones.[/quote]

Thanks, Trev, I've just got excited about having a new toy. Of course, if I want Apache/Php/MySqlite I'll get an embedded Linux board.  I just wanted to see how far I can push this one. I will go look at the Microchip docs as you suggest. I appreciate the feedback
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: mawg on April 09, 2011, 03:29:35 am
[quote author="honken"]The microchip tcp/ip webserver supports both get and post arguments through a user supplied callback function, so yes. If you implement that other behaviour through this function.
[/quote]

Whoo hoo!  Great news. Thanks.  I'm to read the friendly manual right now! I appreaciate the help
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: mawg on April 09, 2011, 03:34:11 am
[quote author="ian"]Have you considered a Beagle Board or similar? They are 3-4x more expensive that the Web Platform, but provides a robust embedded system that can (I think) run Linux with php, SQL, etc.[/quote]

Yes, I am looking at few options on cheap board and trying to balance out what can be down for how much, so that I can have a range of options.

Thanks for your help
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: pppd on April 10, 2011, 08:03:16 pm
You can also consider a second-hand NSLU2 device. It has a 266MHz ARM CPU, 32MB RAM, 2 USB ports, UART, a few GPIO pins, and you can easily get I2C, and a few other things :) It shouldn't be more than $50.
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: megabug on April 10, 2011, 08:41:02 pm
or a much much better seagate dockstar (than the NSLU2)! It has a 1GHz ARM CPU in it and rocks! :) (I am using these for some stuff around here... Webhosting, NAS, Webcamserver)
Title: Re: Any programmers here? Can I have logic in my web pages?
Post by: pppd on April 10, 2011, 08:45:49 pm
Thanks for the tip :) I might upgrade my old NSLU2 one day.. although it does its job just fine.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01062072664session_write_close ( )...(null):0
20.01092204240ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01092205016Database_MySQL->query( ).../DatabaseHandler.php:119
40.05702343736Database_MySQL->error( ).../Db-mysql.class.php:273