Pages: [1]   Go Down
Author Topic: Question about: Arduino control over the Internet  (Read 2160 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I want to communicate with arduino from the internet with a phone, tablet or pc (web application platform), to read your inputs and write their outputs, for it arduino be programmed as a server? they need knowledge or language I can use to develop this webapp? jquery mobile?

Sorry for my English, I'm a little lost, I've only programmed in C and not know anything about web development.

Thank you!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
for it arduino be programmed as a server?
Yes. It serves up the page that you want to see/change (usually containing a form, with one or more submit buttons, whose action sends a modified GET request to the server).

Quote
they need knowledge or language I can use to develop this webapp?
Simple html, generally using a form. This place has some good information, and great examples and stuff to try:
http://www.w3schools.com/html/html_forms.asp

Logged

Dallas, TX
Offline Offline
Sr. Member
****
Karma: 10
Posts: 318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like and use Arduinos for most of my sensor applications but I've never been a fan of it for applications involving communication over a network. I have the original Ethernet shield, which was and is expensive, and I also have a version of the Ethernet Arduino, which is a slightly better value, but still pretty expensive.

The Arduino Ethernet library has evolved into a fairly useful package but, for learning, abstracts the underlying code too much to be very useful as a teaching aid.

Personally, I think the combination of a basic Arduino board, say a 3.3V Pro 328, and something like the Raspberry Pi are a much more economical approach to learning how to serve up web pages with physical data.

The recommended Raspberry Pi linux distribution comes standard with apache2 server, gcc toolchain, Python, etc. You can use that to make creating a web server as easy or as complicated as you want and get the kind of early success that's important for maintaining your interest. If you get a 3.3V Arduino, the interface is a simple 3 wire connection between the two UART's or you can use USB if you need to separate the data collection from the data serving by several feet.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been trying to integrate a jquery mobile server on my arduino+ethernet shield, I have no knowledge of javascript/html/css, but following the Webduino library I have had some success with adding sliders to the code. I really want to be able to control outputs in jquery using click buttons but I don't how to integrate it (input type, id, ui..)  using the code I have from the webduino site.
Code:
{
    /* store the HTML in program memory using the P macro */
    P(message) =
  "<!DOCTYPE html><html><head>"  
  "<meta charset=\"utf-8\"><meta name=\"apple-mobile-web-app-capable\" content=\"yes\" /><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\"><meta name=\"viewport\" content=\"width=device-width, user-scalable=no\">"
  "<title>Mixim Drink Maker</title>"  
  "<link rel=\"stylesheet\" href=\"http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css\" />"  
  "<script src=\"http://code.jquery.com/jquery-1.6.4.min.js\"></script>"  
  "<script src=\"http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js\"></script>"  
  "<style> body, .ui-page { background: black; } .ui-body { padding-bottom: 1.5em; } div.ui-slider { width: 88%; } #red, #green, #blue { display: block; margin: 10px; } #red { background: #f00; } #green { background: #0f0; } #blue { background: #00f; } </style>"  
  "<script>"
  // causes the Arduino to hang quite frequently (more often than Web_AjaxRGB.pde), probably due to the different event triggering the ajax requests    
    "$(document).ready(function(){ $('#red, #green, #blue').slider; $('#red, #green, #blue').bind( 'change', function(event, ui) { jQuery.ajaxSetup({timeout: 110}); /*not to DDoS the Arduino, you might have to change this to some threshold value that fits your setup*/ var id = $(this).attr('id'); var strength = $(this).val(); if (id == 'red') $.post('/rgb', { red: strength } ); if (id == 'green') $.post('/rgb', { green: strength } ); if (id == 'blue') $.post('/rgb', { blue: strength } ); });});"  
  "</script>"
  "</head>"
  "<body>"  
    "<div data-role=\"header\" data-position=\"inline\"><h1>Mixim Drink Maker</h1></div>"    
    "<div class=\"ui-body ui-body-a\">"      
    "<input type=\"range\" name=\"slider\" id=\"red\" value=\"0\" min=\"0\" max=\"255\"  />"      
    "<input type=\"range\" name=\"slider\" id=\"green\" value=\"0\" min=\"0\" max=\"255\"  />"      
    "<input type=\"range\" name=\"slider\" id=\"blue\" value=\"0\" min=\"0\" max=\"255\"  />"    
    "</div>"  "</body>""</html>";    
  
  server.printP(message);
  }
Thanks in Advance
« Last Edit: October 29, 2012, 04:28:58 pm by brettzky10 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/forum/index.php/topic,129122.0.html
Logged

Pages: [1]   Go Up
Jump to: