Pages: [1] 2   Go Down
Author Topic: Can not perform ChatServer and ChatClient, help me!  (Read 1319 times)
0 Members and 1 Guest are viewing this topic.
universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

...
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:

...
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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address
Code:
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.
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Code:
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address
Code:
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?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
IPAddress ip(192,168,1, 99);
unless you already have 99 machines on your network.
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So, in my ChatServer, I write:
Code:
...
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:
...
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?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No. There was no need to change these:
Code:
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:
// Enter the IP address of the server you're connecting to:
IPAddress server(1,1,1,1);
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So, I should write for ChatServer:
Code:
...
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:
...
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?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


« Last Edit: May 04, 2012, 05:23:02 am by creativen » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

universe
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
I'm enjoying my Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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?
Logged

Pages: [1] 2   Go Up
Jump to: