Show Posts
Pages: [1] 2 3 4
1  International / Français / Re: Aidez avec Client Port setup dans l'EthernetClient on: February 12, 2014, 01:09:58 pm
Le sucis ets celui ci:
Les connections de mes nonos sur le serverur ne peuve pas etre reconu induviduallement par le serveur car il identifie le meme IP et le meme Port pour chaque de mes nonos. Ils ne peuvent pas etre connectés tous au meme temps.

quel "id unique"? C'est le suivant?
La connection TCP est identifiée seulement par:
1) le protocol (ex: TCP ou UDP)
2) IP du client + Port du client
3) IP du serveur + Port du serveur

extrait d'un article http://www.tcpipguide.com/free/t_TCPPortsConnectionsandConnectionIdentification.htm
The overall connection between these devices can be described using this socket pair:
(41.199.222.3:80, 177.41.72.6:3022)
2  International / Français / Re: Aidez avec Client Port setup dans l'EthernetClient on: February 12, 2014, 09:10:38 am
skywodd et infobarquee:
Je n'utilise pas le HTTP protocol, mais le TCP connection toute simple. Comme j'ai deja expliqué:

Tous les 10 Arduinos (IP: du 192.168.1.100 au 192.168.1.110) sont connectés sur l'internet en utilisant un seule router avec l'address WAN example 89.125.48.78.
Le serveur (IP: 46.58.111.32) peut recevoir les connections, mais les arduinos ne peuvons pas etre diferenciés. Ils ont le meme port et l'IP.

Pour example l'Arduino sketch je utilise mois est le TelnetClient.pde
C'est ca le probleme et il me faut le TCP. Pas le HTTP.

Merci a l'avance!
3  International / Français / Re: Aidez avec Client Port setup dans l'EthernetClient on: February 12, 2014, 07:48:40 am
skywodd:  j'utilise le TCP protocol pour les connections. Quoi faire?

Merci
4  International / Français / Re: Aidez avec Client Port setup dans l'EthernetClient on: January 14, 2014, 06:45:42 am
Merci pour ta réponse, mais le connect(IP,Port) est pour definir le serveur destinateur de la connection.
Imagine t'a 20 arduinos avec 20 IP diferentes a la maison.

192.168.1.100
192.168.1.101
...
192.168.1.119
192.168.1.120

Tous le duinos sont connectés sur l'internet en utilisant un seule router avec une seule address WAN example 89.125.48.78.
Le serveur sur l'inernet peut voir seulement le suivant:

89.125.48.78
89.125.48.78
...
89.125.48.78
89.125.48.78

Comment les duinos peuvent etre identifiés l'un de l'autre?
Ce qu j'ai besoin est comment esque je peut distinguer les cliénts?

Peter


5  International / Français / Aidez avec Client Port setup dans l'EthernetClient on: January 14, 2014, 04:18:32 am
Bonjour,

J'ai environs 20 arduinos connectés sur l'internet et ils envoient des datas sur mon serveur.
Le problen est que memme si chaque arduino a unique IP, la librarie done automatiquement le meme Port a tous: 1024

Les connections de chaque arduino sur le serverur ne peuve donc pas etre reconu induviduallement car le serveur identifie le meme WAN et le meme Port pour chaque connection.

J'ai lu un post sur le Forum ici qu'il me faut changer l'EthernetClient.cpp Ligne 53

Y-a-t il quelqun qui peut m'aider a trouver une sollution?

Marci a tous!
Peter
6  Using Arduino / Programming Questions / Help with Client Port setup in Ethernet library on: January 14, 2014, 04:01:51 am
Hello,

I need to have about 20 arduinos connected to the internet and sending some data to my server.
Every arduino has its IP address, but Ethernet library gives the same Port (1024) to all of them.

When these arduinos connect to the server. The server see the source WAN IP and the same Port for all of them. Server can't distinguish / identify each arduino. Connected Arduino is disconnected by the server imediately when a next Arduino wants to connect.

I have read about this problem in other topic  Ethernet Shield (Wiz5100) Probles with reoccuring requests
where I read I need to change EthernetClient.cpp Line 53

Does this issue is already solved somehow?

Thank you for any answer or advice.
Petr
7  Using Arduino / Networking, Protocols, and Devices / remote robot JSON configuration on: February 05, 2013, 04:05:36 am
Hello,

If someone knows, I wish to get an advice on the remote robot JSON configuration I need to do over TCP/UDP.
I did JSON configuration file - easy exemple:

{ "servo1max"=130, "servo1min"=60, "servo1init"=90, "LED1init"=1 }

I send this file to robot to setup several variables. Several setup files are possible for one robot and I choose what I send to robot without any need to upload the code to robot.

Are there already any known standards? that I can get inspiration from or just to use them for my robot? I know about some for permanent online setup and data processing, but I do need now one step initial robot setup remote configuration.

Many thanks,
Petr
8  Using Arduino / Programming Questions / Re: Switch / Case with multiple variables? on: September 23, 2012, 03:29:03 pm

when I recieve UDP command, I use switch in following way to join several possibilities to one result:

Code:
    if(packetBuffer[0] == 'R' || packetBuffer[0] == 'r') switch_value = 0; //reset
    if(packetBuffer[0] == 'W' || packetBuffer[0] == 'w') switch_value = 1; //speed up
    if(packetBuffer[0] == 'S' || packetBuffer[0] == 's') switch_value = 2; //speed down

    switch (switch_value) {
    case 0:
      servoPos = 90;           // tell servo to go to position servoPos
      servoMove(servoPos);
      led_blink();
      break;
    case 1:
      if( servoPos >= 10 && servoPos <= 165) {
      servoPos = servoPos+5;           // tell servo to go to position servoPos
      servoMove(servoPos);
      }
      led_blink();
      break;
    case 2:
      if( servoPos >= 15 && servoPos <= 165) {
      servoPos = servoPos-5;           // tell servo to go to position servoPos
      servoMove(servoPos);
      }
      led_blink();
      break;
    default:
      // if nothing else matches, do the default
      // default is optional
9  Using Arduino / Programming Questions / WiShield UDP on: June 20, 2011, 03:45:49 am
Hello,

at present. I wish to switch from Ethernet shield (EtSh) to Wishield. I use UDP connection on the EtSh and it's functions provided by udp.h library. What are equivalent functions for wishield?

ie: ethernet functions:
Udp.readPacket( packetBuffer,UDP_TX_PACKET_MAX_SIZE, IP, Port);
Udp.sendPacket( packetBuffer, IP, Port);

What are wishield equivalent functions? The UDPapp has only wifi.run() and I didn't find answer.

Need to correct this for wishield :

Code:
void loop()
{
  WiFi.run();
  int packetSize = Udp.available();
  if(packetSize)
  {
    Udp.readPacket( packetBuffer,UDP_TX_PACKET_MAX_SIZE, IP, Port); //EtSh function
    for(int i=0;i<4;i++) Serial.print( IP[i]);
    Serial.println();
    Serial.println( Port);
    Serial.println( packetBuffer);
    Udp.sendPacket( packetBuffer, IP, Port); //EtSh function
  }
}

Thank you!
Peter
10  Using Arduino / Programming Questions / Re: getRequest to a server on: June 08, 2011, 04:37:24 pm
Thanks, the code works now. Thank you!
11  Using Arduino / Programming Questions / Re: getRequest to a server on: June 08, 2011, 12:16:21 am
OK, it is good news it is working on your arduino. Now the prblm is on my SW/HW side then.

Can you please confirm/sudgest:
 I use arduino 22 and library inside, ethernet shield, I connect to router

Thanks, Peter

12  Using Arduino / Programming Questions / Re: getRequest to a server on: June 07, 2011, 04:34:21 pm
of course...

Code:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,178 };
byte server[] = { 88, 146, 119, 160 }; // soupis.cz
Client client(server, 80);

void setup() {
  Ethernet.begin(mac, ip);
  Serial.begin(19200);
  delay(500);
  Serial.println("connecting...");
  if (client.connect()) {
    Serial.println("connected");
    client.print("GET /data/DEMO_MODE/system/phpCommunication/?mode=5&user=test&pass=test HTTP/1.1\n\r");
    client.print("Host: soupis.cz\n\r");
    client.print("Connection: close\n\r");
    client.print("\n\r");
  }
  else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;)
      ;
  }
}
13  Using Arduino / Programming Questions / Re: getRequest to a server on: June 07, 2011, 03:32:53 pm
maniacbug: I formulated the request, but have got the answer herebellow. Mabye shal I use another HTML than 1.0 or 1.1 ? How to ask server what does it accepts?

Code:
HTTP/1.1 400 Bad Request
Date: Tue, 07 Jun 2011 20:29:48 GMT
Server: Apache
Content-Length: 285
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache Server at parkovani Port 80</address>
</body></html>
14  Using Arduino / Programming Questions / Re: getRequest to a server on: June 07, 2011, 03:28:43 pm
PaulS: what happens with directories? ... it is not working
15  Using Arduino / Programming Questions / Re: getRequest to a server on: June 07, 2011, 01:55:42 pm
Thank you friends for your sudgestions. Unfortunately I am missing something, because I get answer with following header:

Code:
[size=6pt]HTTP/1.1 301 Moved Permanently
Date: Tue, 07 Jun 2011 18:54:00 GMT
Server: Apache
Location: http://parkovani/?mode=5&user=test&pass=test
Cache-Control: max-age=7200
Expires: Tue, 07 Jun 2011 20:54:00 GMT
Content-Length: 319
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://parkovani/?mode=5&amp;user=test&amp;pass=test">here</a>.</p>
<hr>
<address>Apache Server at parkovani Port 80</address>
</body></html>[/size]

Here is the code:

Code:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,178 };
byte server[] = { 88, 146, 119, 160 }; // soupis.cz
Client client(server, 80);

void setup() {
  Ethernet.begin(mac, ip);
  Serial.begin(19200);
  if (client.connect()) {
    Serial.println("connected");
    client.print("GET /data/DEMO_MODE/system/phpCommunication/?mode=5&user=test&pass=test HTTP/1.0\n\r\n\r");
  }
  else {     Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {     
    char c = client.read();     
    Serial.print(c);
  }
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;)
      ;
  }
}
Pages: [1] 2 3 4