Go Down

Topic: Question about: Arduino control over the Internet (Read 2415 times) previous topic - next topic

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!


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).

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:

Papa G

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.

Oct 29, 2012, 10:16 pm Last Edit: Oct 29, 2012, 10:28 pm by brettzky10 Reason: 1
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: [Select]
   /* 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>"  
 // 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 } ); });});"  
   "<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>";    
Thanks in Advance



Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131