Go Down

Topic: Operate from Blackberry/Android/Iphone-Ipad/Nokia/PC/Mac across the Globe W/O PC (Read 17 times) previous topic - next topic

Turkeybaster


i have to say very nice UI but very slow i tried to modify little bit like to use background-color grey instead of png i did a png reduce but still very slow.

can someone make faster...? any ideas?? can we add all the spare digital pins  too ? and how? i cant even change the led names if i do this i lost the on of png...

and something last nice round png but its more easy to draw a cicle or a square like RED on OFF and Green or Blue on ON ?????? thanks for your effort keep up.... bravo


yeah  I noticed it was slow too but I think it is browser dependant. I tried it on Dolphin browser for android and it was slow but using the stock android browser it was a little bit faster.

in terms of different buttons I found these

http://images.clipartof.com/small/1086756-Clipart-3d-Toggle-Switches-With-Chrome-Bases-Royalty-Free-Vector-Illustration.jpg

and

http://us.123rf.com/400wm/400/400/enki/enki1112/enki111200044/11768340-green-toggle-switch-on-metallic-surface.jpg

its tricky changing the buttons because the names need to match with the original files if you want to avoid mucking around with the code.

capper

Quote
Quote from: nikkpap on July 11, 2012, 02:42:49 AM
i have to say very nice UI but very slow i tried to modify little bit like to use background-color grey instead of png i did a png reduce but still very slow.

can someone make faster...? any ideas?? can we add all the spare digital pins  too ? and how? i cant even change the led names if i do this i lost the on of png...

and something last nice round png but its more easy to draw a cicle or a square like RED on OFF and Green or Blue on ON ?????? thanks for your effort keep up.... bravo

yeah  I noticed it was slow too but I think it is browser dependant. I tried it on Dolphin browser for android and it was slow but using the stock android browser it was a little bit faster.

in terms of different buttons I found these

http://images.clipartof.com/small/1086756-Clipart-3d-Toggle-Switches-With-Chrome-Bases-Royalty-Free-Vector-Illustration.jpg

and

http://us.123rf.com/400wm/400/400/enki/enki1112/enki111200044/11768340-green-toggle-switch-on-metallic-surface.jpg

its tricky changing the buttons because the names need to match with the original files if you want to avoid mucking around with the code.




For Image Animation (Sprite) use following Generator and feed them 2 separate PNG /JPG images 1. "ON" 2. "OFF" in a compressed ZIP file
http://spritegen.website-performance.org/


Change in "style.css" file on SD Card as per CSS generartor output... in following lines

Code: [Select]
/*
 Copyright 2010 Ovidiu Predescu <ovidiu@gmail.com>
 Date: December 2010
 */
div.light a {

margin-left: auto;
margin-right: 50;
background-image:url('toggle.png'); // "File Name for your SPRITED Image"
display: block;
float: right;
}

a.off { background-position: 0 0; width: 89px; height: 31px; } ]  // Position copied from output of the SPIRTE Generator
a.on { background-position: 0 -63px; width: 89px; height: 31px; }  // Position copied from output of the SPIRTE Generator




veseo

Hi Capper,

nice UI. I've developed an Ajax web interface where the page wasn't loaded from the webserver but straight from the mobile device.
In practise, the page is stored on the mobile device, when loaded it start to send JSONP requestes to the server, that is no longer a webserver but a Json server.
In that way the functionality is preatty the same, but the poor Arduino board isn't overloaded in RAM and can react much faster.

The post where I've placed the code is there, unfortunately is only in Italian. The webpage is the same of the TinyWebServer.
http://arduino.cc/forum/index.php/topic,83042.msg623721.html#msg623721

I've used this library in the Souliss project to build easily an universal interface. The interface was working but not nice enough on the UI side, if you are interested in, you can use your UI for that project.

Regards,
Dario.


Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

capper

Dear Veseo,

Thank you for being Torch-Bearer,

I must confess that I am not a good coder, but I am good at adaptation.

I was thinking to offload webpage from Arduino to any damn web-server as Arduino is not suitable for this kind of workload.

the Arduino sketch remains same for IDE 1.01 other than you have to substitute "Server" to "Ethernetserver" and "Client" to "EthernetClient".
Attached below Arduino sketch and  Htmlpart.zip.

1. Upload AjaxUI.ino to arduino
2. Extract htmlpart.zip to your Pc/Mac/Phone/Tablet
3. Open Index.htm in your browser give password 4587 and hit submit. (don't press enter/return)
4. connect LED on pin 9 and GND
5. Have Fun

Warm Regards

Capper

veseo

Out of the example in the post that I've linked, there is a full UI for the Souliss Home Automation that I've developed for the past releases. This UI is no longer maintained for time reason, bacause the project is focusing the time on others UIs (Android and Java).

If you are interested in reworking the UI, you can use the Souliss A2.1 release and figure out how was worked. Is working but not nice enough :)

Behind the UI there is a full home automation framework that runs over the ATmega.

Regards,
Dario.
Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Turkeybaster

wow Dario that's very impressive BRAVO!

what did you use to build the android application ?



veseo

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

shineangelic



what did you use to build the android application ?



We used standard Android SDK on Eclipse. App supports VPN communications, private and/or public address, so that network latency is tuned to connection speed. Much work is still to be done, but the app is working properly so far.
twitter: @shineangelic

edmakhuit

Hi guys:
I see  you have also problems with latency
I was testing very ways to do a Arduino Web Sever
with the library Tinywebserver ist actually very good.....but i would like to build other kind of controls like real time sliders and not only on/of buttons.

My issue is:

Is it posible   to send UDP messages between arduino and the  web based user interface with the Tinywebserver library??

I comunicate the arduino board with Internet in two ways:

The software tool VVVV: is there a node which made all the hard job for you and works great....but
VVVV works just for rapid prototyping but im not sure that  a "vvvv based user interface" could be a" end user" solution.

The other way is a PHP based web server. it works very nice and fast when you use UPD messages..but the problem the server is my PC not the Arduino Board....


anybody is working in the same Problem?
thanks


veseo

Hi,

the web browser user HTTP to access the webpage, so there is no way to drive HTTP over UDP with a standard browser. Maybe browser like Firefox has plugins that allow this mode.

Regards,
Dario.
Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

edmakhuit

Hi.
Thank you really much for your answer!
Im playing with your Soullis Proyect..Hey  guys you are really "Other stuff"
I wanted to make an Arduino  Stepper Motor Server..but obviusly with a friendly UI.. and Voila here came Souliss
I was testing all posible and existent tutorials and documentation but your proyect is the  best  example in Internet..
I really  appreciate your input..
Edy



sgconcept

Hi all,

I'm currently using tinywebserver with some relays to turn on & off stuff in my office.

I'm wondering how to input code to read sensors like LM35 and output it onto the html files used in tinywebserver.

I'm using this as reference:
Code: [Select]
/*
  Web  Server

A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)

created 18 Dec 2009
by David A. Mellis
modified 4 Sep 2010
by Tom Igoe

*/

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1, 177 };

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
Server server(80);

void setup()
{
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
}

void loop()
{
  // listen for incoming clients
  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();

          // output the value of each analog input pin
          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
            client.print("analog input ");
            client.print(analogChannel);
            client.print(" is ");
            client.print(analogRead(analogChannel));
            client.println("<br />");
          }
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}


But it uses client.println to display the data.

I need some help on this.

Nic

Turkeybaster

hi Capper

I want to intergrate XBEE communications through the webserver. Just one xbee to remote control 4 relays.

I have a working sketech that can remotely control the XBEEs using API commands but I want to know what section of the webserver would be appropriate to insert the xbee controls in.

I was thinking in place of having the buttons control pins on the arduino, the webserver directly dispatches the appropriate API commands to remotely control the relays. the code I have pasted below just toggles pin D1 on the remote xbee on and off. I want to be able to do that with this webserver.

Quote

//#include <Wire.h>

//frame for router D1 on 
byte Router_on[] = {0x7E,0x00,0x10,0x17,0x01,0x00,0x13,0xA2,0x00,0x40,0x79,0x5F,0x90,0xFF,0xFE,0x02,0x44,0x31,0x05,0x11};
//Frame for router D1 off
byte Router_off[] ={0x7E,0x00,0x10,0x17,0x01,0x00,0x13,0xA2,0x00,0x40,0x79,0x5F,0x90,0xFF,0xFE,0x02,0x44,0x31,0x04,0x12};


void setup()
{
  Serial.begin(9600);
 delay(5000);//delay of 5 seconds to ensure router and coordinator are joined to each other
 //delay not entirely necessary
}

void loop(){
   //after various trials serial.print(Router_on,20); kept causing the overloaded ambiguous error
   //Serial.write(Router_on,20); does it with no problems
   //the 20 tells the compiler how long the array is
   //Thank you PaulS from the Arduino forum for helping with this
   
  Serial.write(Router_on, 20);
  delay(2000);
  Serial.write(Router_off, 20);
  delay(2000);
  
  
}




also do you have any tips on how to reduce the latency with the buttons on the web app and actually controlling the pins on the arduino? what is causing the latency?


Thank you.

Turkeybaster

hey everyone.

I integrated my XBEE API commands into Cappers webserver. it works like a charm on my Etherten.

There is still an issue with the buttons taking awhile to load on regardless of the browser. I was wondering if using Data URI in place of CSS sprites will improve that latency. any suggestions will be great.

Go Up