Show Posts
Pages: 1 2 3 [4] 5 6 ... 15
46  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 03, 2013, 06:24:38 am
I really appreciate your fast reaction
However, excuse me,I have to bother you again, the shortcut CTRL+I prints a tabulator!
Could you add this in the configuration file, something like
openserialmonitorshortcut=M (that means CTRL+M)
openserialmonitorshortcut=I (that means CTRL+I)
So everyone with different location-specific settings can define his own shortcut.
47  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 02:50:49 pm
I also implemented parsing the result, i.e. getting the Date and the Message:

Quote
    String  buf = "";
    String  msg = "";
    boolean tak = false;
    while (client.connected())
    {
      while (client.available())
      {
        char c = client.read();
        //Serial.print(c); // verbose?
        buf += c;
        if (tak)
          msg = buf;
        if (c == 10)
        {
          buf.trim();
          if (buf.indexOf("Date:") == 0)
            Serial.println("DATE = " + buf);
          if (buf == "") //empty line -> message
            tak = true;         
          buf = "";
        }
      }
    }
    client.stop();
    msg.trim();
    Serial.println("MESSAGE = " + msg);
    Serial.println("Disconnecting.");

48  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 02:05:47 pm
Now it works!
( my account was .org )
Both using my email address and my user name worked (as the no-ip username)
The answer is "nochg <ipaddr>"
49  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 02, 2013, 01:18:40 pm
In general I don't like pressing three keys at once, even if ctrl+alt = altgr, it is easier to use something like ctrl+?

In this case I would like to use CTRL + M

And in your picture it is show "open serial monitor" can be set to true/false, but this is only the action (upload OR upload+monitor) for the arrow next to "verify". I am refering to the keyboard shortcut.

50  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 12:43:43 pm
The prefix http:// should be omitted.

And I found on this forums, the issue has been already discussed and here is the solution
http://arduino.cc/forum/index.php/topic,95456.msg720162.html#msg720162

My problem was that I did not always use the same MAC address so that my router had too many ones to save and it is restricted to grant internet access to only the first 5 ones connected or kind of similiar, so I had to flush this and it worked again.
51  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 02, 2013, 12:15:06 pm
Can you replace the shortcut CTRL+ALT+M (upload and then open the serial monitor) with something else?
 because it prints the greek letter ยต .
52  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 11:59:15 am
Yes, and I tried using http prefix
Code:
char server[] = "http://dynupdate.no-ip.com";
and then the output is

[NOIP-DUC]

Getting IP address from DHCP ...
My IP address: 192.168.2.124

Connecting to http://dynupdate.no-ip.com ...
Connected.

Disconnecting.

53  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 11:50:07 am
After having done more debugging, I realized I cannot even connect to dynupdate.no-ip.com

I use this to check:
Quote
  if (client.connect(server, 80))
  {
    Serial.println("Connected.");
    
    while (client.connected())
    {
      while (client.available())
      {
        char c = client.read();
        Serial.print(c);
      }
    }
    client.stop();
  }
  else
    Serial.println("Error connecting!");


My code:
Code:
// NO-IP, Dynamic Update Client, 02.FEB.13

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

byte mac[] =
{
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
char server[] = "dynupdate.no-ip.com";

EthernetClient client;

void setup()
{
  Serial.begin(9600);

  Serial.println("[NOIP-DUC]\n");
  Serial.println("Getting IP address from DHCP ...");

  if (Ethernet.begin(mac) == 0)
  {
    Serial.println("Failed to configure Ethernet using DHCP !");
    while (1)
      ;
  }

  //Give some time to initialize:
  delay(2000);

  Serial.print("My IP address: ");
  Serial.println(Ethernet.localIP());
  Serial.println();

  Serial.print("Connecting to ");
  Serial.print(server);
  Serial.println(" ...");

  if (client.connect(server, 80))
  {
    Serial.println("Connected.");
   
    while (client.connected())
    {
      while (client.available())
      {
        char c = client.read();
        Serial.print(c);
      }
    }
    client.stop();
  }
  else
    Serial.println("Error connecting!");
}

void loop()
{
  if (client.available()) // this cannot be reached by now
  {
    char c = client.read();
    Serial.print(c);
  }

  if (Serial.available())
  {
    char c = Serial.read();
    client.print(c);
  }

  if (!client.connected())
  {
    Serial.println();
    Serial.println("Disconnecting.");
    client.stop();
    while (1)
      ;
  }
}

Serial output
[NOIP-DUC]

Getting IP address from DHCP ...
My IP address: 192.168.2.124

Connecting to dynupdate.no-ip.com ...
Error connecting!

Disconnecting.

54  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 11:34:25 am
Ok, thanks.

Now I am trying to use the API described here http://www.noip.com/integrate/request

Code:
// NO-IP, Dynamic Update Client, 02.FEB.13

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

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "dynupdate.no-ip.com";

EthernetClient client;

void setup()
{
  Serial.begin(9600);

  Serial.println("[NOIP-DUC]\n");
  Serial.println("Getting IP address from DHCP ...");

  if (Ethernet.begin(mac) == 0)
  {
    Serial.println("Failed to configure Ethernet using DHCP !");
    while (1)
      ;
  }

  Serial.print("My IP address: ");
  Serial.println(Ethernet.localIP());
  Serial.println();

  Serial.print("Connecting to ");
  Serial.print(server);
  Serial.println(" ...");
  client.connect(server, 80);
 
  // checking for answer?
 
  Serial.println("OK. Sending request...\n");
  client.println("GET /nic/update?hostname=mytest.testdomain.com&myip=1.2.3.4 HTTP/1.0");
  client.println("Host: dynupdate.no-ip.com");
  client.println("Authorization: Basic base64-encoded-auth-string");
  client.println("User-Agent: Bobs Update Client WindowsXP/1.2 bob@somedomain.com");
 
  Serial.println("ready?!");
 
}



void loop()
{
  if (client.available())
  {
    char c = client.read();
    Serial.print(c);
  }

  if (Serial.available())
  {
    char c = Serial.read();
    client.print(c);
  }

  if (!client.connected())
  {
    Serial.println();
    Serial.println("Disconnecting.");
    client.stop();
    while (1);
  }
}


Why don't I get any answer? It just disconnects after ~5 seconds.
55  Using Arduino / Networking, Protocols, and Devices / Re: Webserver with dyn DNS on: February 02, 2013, 10:51:34 am
Ok, thank you.
I will monitor the behaviour as from now.
Maybe I have some chanches making the arduino ethernet (as a client ) doing the request to update the new ip.
If someone is interested in this, too, there is an API http://www.noip.com/integrate/request

Can the Ethernet be Client and Server on the same time?
Will I first have to stop the server then start the client then do the update, then stop the client and restart the server (?)
56  Using Arduino / Networking, Protocols, and Devices / Webserver with dyn DNS on: February 02, 2013, 09:53:18 am
Hello,

to reach my Arduino webserver in the www without knowing my IP address, I used a dyndns service (no-ip in my case) and I know that my ISP will assign my a new IP regularly when I switch off and then on my router again (reset) because then I reconnect.
My question is: Does my ISP also assign me a new IP  if I always let my router on?
Then I would not need to update my IP with the so called DUC (dynamic update client) tool.

Thank you
57  Topics / Robotics / Re: Arduino Act like a USB keyboard on: January 18, 2013, 02:18:49 pm
It works with Arduino UNO as well.
I tested it successfully with mine using UnoJoy.
58  Using Arduino / Interfacing w/ Software on the Computer / Re: fast transmission of much data on: January 13, 2013, 09:40:47 am
Ok, I have edited my reply

I forgot that v1 or v2 or even both could be 13 or 10 which is interpreted as the delimiter for new data.
A solution would be to use [0..254] for any data and "255" for the delimiter. Then I could send , with two bytes :
(254,254) is the highest value then : 254* 255^1 + 254* 255^0 = 65,024

And I always send 250 datas, so with this encoding 500 bytes .
59  Using Arduino / Interfacing w/ Software on the Computer / Re: fast transmission of much data on: January 13, 2013, 09:24:30 am
Ok, I have "modified" it like this:

addition to "Arduino pseudo code":
Code:
   int  val = 54123; //example to check  (data[x]);
    byte v1  = val / 256;
    byte v2  = val % 256;
    Serial.write(v1);
    Serial.write(v2);
    Serial.println("");
A byte cannot be lost , I think , because the sole problem is, that the transmission might be too fast, and so the buffer gets overwritten of new outgoing data. This wont happen because I do not send the next array's element until the last has really arrived.

I forgot that v1 or v2 or even both could be 13 or 10 which is interpreted as the delimiter for new data.
A solution would be to use [0..254] for any data and "255" for the delimiter. Then I could send , with two bytes :
(254,254) is the highest value then : 254* 255^1 + 254* 255^0 = 65,024
60  Using Arduino / Interfacing w/ Software on the Computer / Re: fast transmission of much data on: January 13, 2013, 09:05:27 am
Hello,
now I have changed the baudrate and am still using serial.println (maybe last thing I am going to change)
But these data are not each similar, so I think + and - can even be more than the value itself (e.g. 1000;900;100 - it is 1000,minus100,minus800 - last data (minus800) is more to send  than 100)

Additionally, it is important to know *when* Arduino can send the next array's element. Otherwise it will always send and maybe too fast , thus the buffer will be overwritten and causes data loss!
So, my idea is the following:

Arduino pseudo code:
Code:
for i=0 to datalength-1
send(data[i]);
while (Serial.read()!=123); // wait until the data arrived

windows program pseudo code:
Code:
-loop-
readin(data);
if validdata then (
workwithdata(data);
send(123); // ok got that data, send next one
)

what do you think?

And , I already though about encoding decimal digits to use the byte range
I would use two bytes then, example (255,255) is the highest value then : 255 * 256^1 + 255 * 256^0 = 65,535 and this is enough - so each transmission then needs two bytes



Pages: 1 2 3 [4] 5 6 ... 15