Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Networking, Protocols, and Devices / Re: send UDP from arduino ethernet on: March 09, 2014, 02:34:03 am
So, Do you know if there are any way to send a server on internet but not wiht its IP address remote?    I want to send udp traffic to its domain name. For example:(it does not work , just an idea)

IPAddress remoteIP("www.testudp.com");
unsigned int remotePort = 8888;

how I can do that?
2  Using Arduino / Programming Questions / Re: gps sketch o library on: February 14, 2014, 11:30:55 pm
there are any way to combine  gps and gprs and I can receive in a web server ?  any idea ?
which devices works with tinygps?
How should be connected?
I cannot understand what is tinygps, How it works?
I could combine tinygps library  and gprs function of arduino , I want to work with gsm shield

thanks
3  Using Arduino / Networking, Protocols, and Devices / send UDP from arduino ethernet on: January 25, 2014, 12:00:46 am

how I can send udp packages to specific host in my network , if I change Udp.remoteIP( ) to 192,168,1,XX I have a mistake, only I want to send and not recive.

Code:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>

EthernetUDP Udp;
byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x5C, 0x18};
IPAddress ip(192,168,1,15);
unsigned int localport = 8888;

void setup(){
  Serial.begin(9600);
  Serial.println("****************");
  Serial.println("Puerto Serial OK");
  Ethernet.begin(mac,ip);
  Serial.print("IP : ");
  Serial.println(Ethernet.localIP());
  Udp.begin(localport);
}

void loop(){
  Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());   [glow=yellow,2,300][b]//  I want to specify a host[/b][/glow]
  Udp.println("Mensaje UDP");
  Serial.println("Mensaje UDP");
  Udp.endPacket();
  delay(5000);
}

4  Using Arduino / Programming Questions / gps sketch o library on: January 22, 2014, 11:00:20 pm

anyone know about of sketch or library with gps and arduino?
5  International / Hardware / Re: Problema GPS+Sensor de temperatura on: January 22, 2014, 10:38:29 pm

sube el codigo para revisarlo porque al  parecer todo esta bien.
6  Using Arduino / Networking, Protocols, and Devices / Re: arduino ethernet like server and javascript [SOLVED] on: January 09, 2014, 12:13:08 am
sorry if my english is not good , I am learning.
thanks JimboZA for help me . I attach the code for anyone have the same question . It code works good and you need write just numbers not letters.
arduino ethernet---html5---mac---ip---
Code:

#include "SPI.h"
#include "Dhcp.h"
#include "Dns.h"
#include "Ethernet.h"
#include "EthernetClient.h"
#include "EthernetServer.h"
#include "EthernetUdp.h"
#include "util.h"

byte mac[] = {0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX}; 
IPAddress ip(192,168,1,XX);
EthernetServer server(80);

void setup() {
pinMode(9,OUTPUT);
digitalWrite(9,0);
Serial.begin(9600);
Serial.println("**********************");
Serial.println("puerto serial iniciado");
Ethernet.begin(mac,ip);
server.begin();
Serial.print("ip server: ");
Serial.println(Ethernet.localIP());

}

void loop() {
EthernetClient client = server.available();
if(client){
Serial.println("new client");
boolean currentLineIsBlank = true;
while(client.connected()){
if(client.available()){
char c = client.read();
if(c == '\n' && currentLineIsBlank){
client.println("<!doctype html>");
client.println("<html>");
client.println("<head>");
client.println("<title>Arduino Server</title>");

client.println("<script type='text/javascript'>");
client.println("function validardato(){");
client.println("var verificar = true;");
client.println("var dato = /^[0-9-,-.]*$/;");
client.println("if(!dato.exec(document.frm_test.num_txt.value)){");
client.println("alert('Campo no valido');");
client.println("verificar = false;");
client.println("}");
client.println("if(verificar == true){");
client.println("alert('Campo valido');");
client.println("}");
client.println("}");
client.println("window.onload = function(){");
client.println("document.frm_test.num_but.onclick=validardato;");
client.println("}");
client.println("</script>");

client.println("</head>");
client.println("<body>");
client.println("<center><h1>Arduino Ethernet</h1></center>");
client.println("<center>");
client.println("<form name='frm_test'>");
client.println("<input type='text' name='num_txt'>");
client.println("<input type='button' name='num_but' value='Ingresar Dato'>");
client.println("</form>");
client.println("</center>");
client.println("</body>");
client.println("</html>");
break;
}
if(c == '\n'){
    currentLineIsBlank = true;
}else if(c != '\r'){
    currentLineIsBlank = false;
}
}
}
delay(1);
client.stop();
Serial.println("cleinte desconectado");
}
}



7  Using Arduino / Networking, Protocols, and Devices / arduino ethernet like server and javascript on: January 08, 2014, 02:04:27 am

anyone know if I can work with js code on the arduino ethernet like server?

thanks
8  Using Arduino / Project Guidance / Re: turn on/off a led from sms message on: November 05, 2013, 09:28:36 am
only there are examples about make a call, send sms, control the screen but I want to read the sms message and compare with a text written in my code and be able to turn on/off a led in my board. There are a library about it, but I do not know how I can read the sms and compare it. 
9  Using Arduino / Project Guidance / Re: turn on/off a led from sms message on: November 04, 2013, 10:13:33 pm

which link are you talking about?
10  Using Arduino / Project Guidance / turn on/off a led from sms message on: November 04, 2013, 05:12:04 pm

someone knows some library or code which I can implement in my project , I want to turn on/off a led in my board from a sms message, I am not using the Arduino GSM Shield, I am using this one:

http://www.elecfreaks.com/wiki/index.php?title=EFCom_GPRS/GSM_Shield

I do not have any idea about  how I can read the messagge for later compare with a char/string ( It does not know either) and be able to control the led.

sms: turn on ------------------------>  my board : led on
sms: turn off ------------------------>  my board : led off
11  Using Arduino / Programming Questions / read file .h and .cpp with avr Studio? on: October 29, 2013, 08:29:09 pm
could read these files include libraries for arduino with avr studio program?

How I could do it?

maybe, I need another program?

thanks
12  Using Arduino / Project Guidance / turn on an LED by sms commands on: October 29, 2013, 12:31:55 am
anyone knows some library that allows me to read a sms message and compare it to a String or Char to turn on an LED for SMS commands

sms : turn on ----> led on

sms: turn off ----> led off
13  Using Arduino / Programming Questions / problems with ds1307 and arduino uno on: October 09, 2013, 06:50:53 pm

I am using this code :
Code:
#include <Wire.h>

//
// Maurice Ribble
// 4-17-2008
// http://www.glacialwanderer.com/hobbyrobotics

// This code tests the DS1307 Real Time clock on the Arduino board.
// The ds1307 works in binary coded decimal or BCD.  You can look up
// bcd in google if you aren't familior with it.  There can output
// a square wave, but I don't expose that in this code.  See the
// ds1307 for it's full capabilities.

//#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68

// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
  return ( (val/10*16) + (val%10) );
}

// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
  return ( (val/16*10) + (val%16) );
}

// Stops the DS1307, but it has the side effect of setting seconds to 0
// Probably only want to use this for testing
/*void stopDs1307()
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0);
  Wire.send(0x80);
  Wire.endTransmission();
}*/

// 1) Sets the date and time on the ds1307
// 2) Starts the clock
// 3) Sets hour mode to 24 hour clock
// Assumes you're passing in valid numbers
void setDateDs1307(byte second,        // 0-59
                   byte minute,        // 0-59
                   byte hour,          // 1-23
                   byte dayOfWeek,     // 1-7
                   byte dayOfMonth,    // 1-28/29/30/31
                   byte month,         // 1-12
                   byte year)          // 0-99
{
   Wire.beginTransmission(DS1307_I2C_ADDRESS);
   Wire.write(0);
   Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock
   Wire.write(decToBcd(minute));
   Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set
                                   // bit 6 (also need to change readDateDs1307)
   Wire.write(decToBcd(dayOfWeek));
   Wire.write(decToBcd(dayOfMonth));
   Wire.write(decToBcd(month));
   Wire.write(decToBcd(year));
   Wire.endTransmission();
}

// Gets the date and time from the ds1307
void getDateDs1307(byte *second,
          byte *minute,
          byte *hour,
          byte *dayOfWeek,
          byte *dayOfMonth,
          byte *month,
          byte *year)
{
  // Reset the register pointer
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_I2C_ADDRESS, 7);

  // A few of these need masks because certain bits are control bits
  *second     = bcdToDec(Wire.read() & 0x7f);
  *minute     = bcdToDec(Wire.read());
  *hour       = bcdToDec(Wire.read() & 0x3f);  // Need to change this if 12 hour am/pm
  *dayOfWeek  = bcdToDec(Wire.read());
  *dayOfMonth = bcdToDec(Wire.read());
  *month      = bcdToDec(Wire.read());
  *year       = bcdToDec(Wire.read());
}

void setup()
{
  byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
  Wire.begin();
  Serial.begin(9600);

  // Change these values to what you want to set your clock to.
  // You probably only want to set your clock once and then remove
  // the setDateDs1307 call.
  second = 00;
  minute = 20;
  hour = 18;
  dayOfWeek = 2;
  dayOfMonth = 9;
  month = 10;
  year = 13;
  setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);
}

void loop()
{
  byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;

  getDateDs1307(&second, &minute, &hour, &dayOfWeek, &dayOfMonth, &month, &year);
  Serial.print(hour, DEC);
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.print("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.print(year, DEC);
  Serial.print("  Day_of_week:");
  Serial.println(dayOfWeek, DEC);

  delay(2000);
}

But I can read the correct time:

from serial monitor
45:45:0  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:45:0  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165
45:165:85  165/165/165  Day_of_week:165

14  Using Arduino / Networking, Protocols, and Devices / testing the link with arduino ethernet. on: October 03, 2013, 08:14:59 pm

there are any way to testing continuously the link of internet with arduino ethernet.

thanks for some code or tutorial that I can to implement
15  International / Hardware / Funciona el atmega328 con el modulo ethernet WIZNET WIZ810MJ? on: September 24, 2013, 01:33:36 pm

talvez alguien a hecho la prueba de cargar el programa del web server al arduino uno y luego trabajar con el modulo WIZNET WIZ810MJ en una placa propia sin la necesidad de comprar el arduino ethernet o el shild ethernet? esta idea prodria funcionar o talvez se necesecita algo mas de hardware? cual seria la diferencia entre una opcion y otra? si alguien sabe de algun tutorial o alguien lo ha probado porfavor si me puede indicar como es la conexion y que seria necesario para su funcionamiento.

gracias por sus comentarios
Pages: [1] 2 3 ... 9