Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

How to control you hardware from a webpage

Posted by Jon Newcomb on December 10, 2010
....using FreeRTOS, Ajax, prototype.js, HTTP POST and a static filesystem

Hello folks,
A while back I searched for AJAX under FreeRTOS and didn’t find anything, so I thought I’d start a thread to share with the community what I have so far..
I have started a project that uses AJAX calls to send and receive JSON data to update a web page / control hardware. Uses HTTP Post
I make use of the FreeRTOS / prototype.js / Protosockets / uIP 1.0 / AT91SAM7X
PHP is emulated on the target.

If you are interested in this sort of thing.. Consider joining me to work on the device it is going into..
www.jnewcomb.com/cv

There is no external filesystem used. All the JavaScript libraries are compressed – and using content encoding in the response header, the web browser decompresses them on the fly. It saves lots space!
You can see all the types of HTTP Headers I have used.. cache connection and so on..

So far.. this a hosted version of what I have done – and got working in FreeRTOS / uIP
http://www.jnewcomb.byethost33.com/perm/10_12_10_Pfe5kSnapshot

The zip file is the uIP webserver and associated html files
http://www.jnewcomb.byethost33.com/perm/10_12_10_Pfe5kSnapshot/share.zip

I use XAMPP to develop the HTML, then when I’m happy I use of makefsdata.pl and then hardcode the PHP support into the target – so the supplied PHP files are for your test server, not your target.

I can’t support the project, but if you are trying something similar, consider it as a push in the right direction. Check back from time to time as depending on feedback, I wish to update the files in the links.
It’s not a whole project as such, just the directories where I have made modifications.

As uIP works within its own thread, you must be careful when linking events generated within uIP to your application. Critical sections can be used for reading and writing to variables shared across tasks..
The uip_post.c is used as the link between uIP and your FreeRTOS application code

uIP also has relevant discussions, search for AJAX.
https://list.sics.se/sympa/arc/uip-users/

Enjoy..
Jon.

RE: How to control you hardware from a webpage

Posted by Dave on December 14, 2010
Very nice. Did you make many changes to uIP itself? I don't see uip.c in the share.zip archive. Could you add it?

RE: How to control you hardware from a webpage

Posted by Jon Newcomb on December 16, 2010
Dave, It does not change uIP.c 1.0 - as its all an extension of the webserver application.
Its the webserver application makes calls to uip_post.c where the handlers are located. That goes with application code.. (that’s why there is a lots of undefined function calls...)

Anyway, I have updated the webserver and zip file to the latest release I have, see above links.
Switching development to other things for now..

If anyone else is reading and likes what they see... please consider joining me where I work - and take part in its development..
http://www.jnewcomb.com/cv

RE: How to control you hardware from a webpage

Posted by Jon Newcomb on December 16, 2010
Forgot to mention, the page now supports coloured tags that change from red to green depending on state..
click of checkboxes updates LEDs.
You can look at the hosted demo above using Firefox with the Firebug plugin to see the underlying AJAX calls


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists