Hello people.
I'm really a beginner who just learned basics about web development, but
I need to develop a simple system in which I can control Arduino relay switch on
a simple smartphone App, developed with html5 and cordova(phonegap).
Anyone knows any simeple example for this kind of project?
I searched on google and tried several examples but none of them shows what I want.
Ahh, I am going to use Arduino UNO R3, Arduino Ethernet shield, wifi network.
I've done one HTML5 Arduino project using javascript, but it was just sending a temperature value from the analog value of a thermistor. I'm thinking that an UNO with 2K of SRAM is pretty weak for anything serious.
Websockets & javascript
Ray
If the purpose is only to turn on/off a relay you don't really need html5 just a small html page, with link towards on and off in it, depending on the current status of relay.
http://.../relay1 turns relay on, http://../relay0 turns it off.
If the page is small and the program simple, HTML output can be stored as progmem strings, at least 10 kbytes should be available in program flash
So it can be done but rudimentary.
The problem with HTML5, complicated pages with images and big javascript libraries is it becomes problematic:
- with space on a very small device that must implement the HTTP server.
- with the number of simultaneous connected sockets, ESP8266 as I recall will be able to respond to 4 or 5 simultaneous connections, a complex page with many images and JS libraries in separate files, the browser may try to open multiple sockets to grab all page components simultaneously.
If you move the HTML images and libraries on a separate HTTP server on a PC or PI, then you may also move all http and app logic complexity on that server and use a simpler, single-line communication between HTTP server app and arduino.