Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: mawg on March 24, 2011, 04:23:07 am

Title: Can it support any database?
Post by: mawg on March 24, 2011, 04:23:07 am
Am I being optimistic? Maybe hoping for SqlLite?

Otherwise, I'll just roll my own with PHP and flat text files, but yeurk!
Title: Re: Can it support any database?
Post by: ian on March 24, 2011, 07:55:40 am
Hi mawg,

As far as I know there are no databases that currently work on a PIC chip. Microchip's TCPIP stack uses a parser that looks for keys in processed web pages and inserts hardware values, but that's a long way from SQLlite :)

A more common datastructure for a microcontroller is a lookup table where the key translates to a position in the table, or a flat file with data saved in a known structure that can be parsed.

Please keep up updated on your project, it sounds interesting.
Title: Re: Can it support any database?
Post by: CSB on March 24, 2011, 10:46:21 pm
I'm not absolutely familiar with PHP, but if its name is not utterly meaningless, I can tell you that it won't be a viable solution either, unless you intend to write a PHP interpreter for the PIC.

I gave Microchip's HTTPPrint solution, but found it rather cumbersome and limited, so I eschewed it for AJAX, and have had success with my project using that technique. Your mileage may vary.
Title: Re: Can it support any database?
Post by: mawg on April 08, 2011, 04:58:47 am
[quote author="CSB"]I gave Microchip's HTTPPrint solution, but found it rather cumbersome and limited, so I eschewed it for AJAX, and have had success with my project using that technique. Your mileage may vary.[/quote]

Can you tell me how you are using Ajax? Insn't that PHP at the server end (and JavaScript at the client/browser)?

I would be very interested in having some logic run based on the HTTP request received at the webserver ...
Title: Re: Can it support any database?
Post by: CSB on April 08, 2011, 08:34:53 am
Okay, so if you want dynamic webpages, you have two options: Make those changes on the server side, or make them on the client side.

For the first option, there are a lot of options currently in use on the web, ASP, JSP, and PHP are just a few, however none of those have compact, and open sourced implementations which are available, much less ported to the platform. Microchip's HTTPPrint option is basically the only established option you have, though you could implement something yourself, and suit it to your application.

Since we're on an embedded platform, I'd be inclined to do the latter, and off load that work to the user's web browser. AJAX is basically the only option here, or really Javascript using XML HTTP Requests... despite its name, AJAX is sometimes not asynchronous, or involving XML formatted data. The main advantage of AJAX besides the above is that it can be used to incrementally update the view.

Since you've been very ineffective at describing what you're trying to do, I can't give you any specific advice, however: Will either of these options allow you to modify a database running on the PIC? Nope, since you can't run a database on the PIC. Could you effect the tables on a a database running elsewhere, though.

If you want to take input from an HTTP method, look at the Microchip Solutions Help File for the TCP/IP stack... look for executePost and executeGet, or similar...

( ! ) 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.00932053408session_write_close ( )...(null):0
20.00962184984ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00962185760Database_MySQL->query( ).../DatabaseHandler.php:119
40.05482324480Database_MySQL->error( ).../Db-mysql.class.php:273