universe
Offline
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« on: May 04, 2012, 03:51:02 am » |
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: ... 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: ... 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #1 on: May 04, 2012, 03:57:20 am » |
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address 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
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #2 on: May 04, 2012, 04:02:27 am » |
IPAddress ip(192,168,1, 27); // same with my Notebook LAN IP address 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #3 on: May 04, 2012, 04:16:01 am » |
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 IPAddress ip(192,168,1, 99); unless you already have 99 machines on your network.
|
|
|
|
|
Logged
|
|
|
|
|
universe
Offline
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #4 on: May 04, 2012, 04:22:16 am » |
So, in my ChatServer, I write: ... IPAddress ip(192,168,1, 77); IPAddress gateway(192,168,1, 77); IPAddress subnet(192, 168, 1, 77); ...
and in my ChatClient, I write: ... 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #5 on: May 04, 2012, 04:29:28 am » |
No. There was no need to change these: 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: // Enter the IP address of the server you're connecting to: IPAddress server(1,1,1,1);
|
|
|
|
|
Logged
|
|
|
|
|
universe
Offline
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #6 on: May 04, 2012, 04:34:24 am » |
So, I should write for ChatServer: ... 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: ... 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #7 on: May 04, 2012, 04:51:55 am » |
Do you have two Arduinos? Both the ChatServer and ChatClient have to run on an Arduino/Ethernet shield.
|
|
|
|
|
Logged
|
|
|
|
|
universe
Offline
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #8 on: May 04, 2012, 04:57:29 am » |
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. 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #9 on: May 04, 2012, 05:02:41 am » |
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
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #10 on: May 04, 2012, 05:20:35 am » |
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? 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #11 on: May 04, 2012, 05:24:04 am » |
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
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #12 on: May 04, 2012, 05:29:17 am » |
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? 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #13 on: May 04, 2012, 05:42:13 am » |
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
Sr. Member
Karma: 0
Posts: 258
I'm enjoying my Life
|
 |
« Reply #14 on: May 04, 2012, 05:49:50 am » |
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
|
|
|
|
|
|