Go Down

Topic: Can not perform ChatServer and ChatClient, help me! (Read 1 time) previous topic - next topic

creativen

Hello, I found problems when I tried to do experiment with ChatServer and ChatClient using 2 of my PC (Notebook and Netbook)

I am using Arduino UNO and Arduino Ethernet Shield and pile those up.
Then I have connect my Notebook to UNO using RS-232 and my Ethernet shield to Netbook using LAN cable.
Then I compile ChatServer in my Notebook then I upload it, then I compile ChatClient in my Netbook.
Then I open for the serial monitor of Notebook, but it show none.

Is there any wrong with my cable connection? or my steps?
Or I lose some step to do? Telnet?

I get the code of ChatServer (http://arduino.cc/en/Tutorial/ChatServer)and ChatClient (http://arduino.cc/en/Tutorial/ChatClient).
I insert mac address same with my Ethernet Board mac address.

This what I insert in my ChatServer:
Code: [Select]


...
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xFE, 0xAC }; //same with the sticker
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address
IPAddress gateway(192,168,1, 1);
IPAddress subnet(255, 255, 0, 0);
...


This what I insert in my ChatClient:
Code: [Select]


...
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xFE, 0xAC }; //same with the sticker
IPAddress ip(192,168,1, 42); // same with my Netbook LAN IP address
...


Anyone can help me? I'm really newbie in Networking and Microcontroller

Vielen Dank.

dxw00d

Code: [Select]
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address
Code: [Select]
IPAddress ip(192,168,1, 42); // same with my Netbook LAN IP address

Are you saying those are the IP addresses of your notebook and netbook?

They should be the IP address you are giving your Arduino, and must be different (in the last number) to any other device on your network.

creativen

Quote
Code: [Select]
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address
Code: [Select]
IPAddress ip(192,168,1, 42); // same with my Netbook LAN IP address

Are you saying those are the IP addresses of your notebook and netbook?

Yes, this is IP address of Ethernet adapter Local Area Connection of my notebook and netbook.




They should be the IP address you are giving your Arduino, and must be different (in the last number) to any other device on your network.


I GIVE IP address to my Arduino Ethernet Shield? any number?

dxw00d

Yes, the sketch is not using DHCP, so you need to set the IP address. It should be on the same subnet as your existing machines, so the first three numbers should be the same (192,168,1) and the last number needs to be unique on your network, and preferable outside your router's DHCP scope. I would try
Code: [Select]
IPAddress ip(192,168,1, 99);
unless you already have 99 machines on your network.

creativen

So, in my ChatServer, I write:
Code: [Select]

...
IPAddress ip(192,168,1, 77);
IPAddress gateway(192,168,1, 77);
IPAddress subnet(192, 168, 1, 77);
...


and in my ChatClient, I write:
Code: [Select]

...
IPAddress ip(192,168,1,77);

// Enter the IP address of the server you're connecting to:
IPAddress server(1,1,1,1);
...


am I right?

dxw00d

No. There was no need to change these:
Code: [Select]
IPAddress gateway(192,168,1, 1);
IPAddress subnet(255, 255, 0, 0);


Unless you are trying to connect to the APNIC Debogon Project in Australia, you probably need to change:
Code: [Select]
// Enter the IP address of the server you're connecting to:
IPAddress server(1,1,1,1);

creativen

So, I should write for ChatServer:
Code: [Select]
...
IPAddress ip(192,168,1, 77); // this is for the Arduino IP Address
IPAddress gateway(192,168,1, 1);
IPAddress subnet(255, 255, 0, 0);
...


then for the ChatClient:
Code: [Select]

...
IPAddress ip(192,168,1,77);

// Enter the IP address of the server you're connecting to:
IPAddress server(1,1,1,1);


Am I right?
if so, what should I do to chat?

dxw00d

Do you have two Arduinos? Both the ChatServer and ChatClient have to run on an Arduino/Ethernet shield.

creativen

I only have one Arduino UNO and one Arduino Ethernet Shield, I pile those up.

My notebook connect to the UNO using RS 232 then my Arduino Ethernet Shield connect to my Netbook using straight LAN cable.


Quote
Both the ChatServer and ChatClient have to run on an Arduino/Ethernet shield

How to run both of them? compile it? or upload it?
I have upload the ChatServer to Arduino UNO but I can not upload the ChatClient to Arduino Ethernet Shield since it only connect via LAN cable no RS 232.

dxw00d

You can't run both at the same time. Both of those sketches need an ethernet shield, they aren't designed to run over serial.

creativen

#10
May 04, 2012, 12:20 pm Last Edit: May 04, 2012, 12:23 pm by creativen Reason: 1
Quote
You can't run both at the same time

Run?You mean compile it?or upload it?
I think if I use my notebook to upload the ChatServer to Arduino then upload again the ChatClient, so the ChatServer will be replaced..
What do you think?

Quote
Both of those sketches need an ethernet shield, they aren't designed to run over serial.


Is there something wrong with my device connection?



dxw00d

What are you actually trying to achieve?

You can upload either of the sketches to the Arduino/Ethernet shield. If you upload one, then the other, the second will overwrite the first.

creativen


What are you actually trying to achieve?

You can upload either of the sketches to the Arduino/Ethernet shield. If you upload one, then the other, the second will overwrite the first.


What I am trying to achieve is I can chat between this two of my netbook and notebook using ChatServer and ChatClient.

Hmm, how I can upload the sketch to Ethernet Shield since I use only LAN cable to connect it to my netbook?

Quote
Both the ChatServer and ChatClient have to run on an Arduino/Ethernet shield

How you do this?Can you tell me the steps?

dxw00d

Quote
What I am trying to achieve is I can chat between this two of my netbook and notebook using ChatServer and ChatClient.


You can't do that with only one Arduino and Ethernet shield.

You can't upload a sketch to the Ethernet shield. The sketch runs on the Arduino that the shield is attached to.

You would need two Arduinos, each with an Ethernet shield.

creativen

Code: [Select]
Chat  Server

A simple server that distributes any incoming messages to all
connected clients.  To use telnet to  your device's IP address and type.
You can see the client's input in the serial monitor as well.
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)


But when I see the sketch comments, it seems like I just need an Arduino and an Ethernet Shield.
What do you think?How about the "Telnet" things?maybe we forgot that?

Go Up