Go Down

Topic: Ethernet Shield Setup (Read 2 times) previous topic - next topic

Jim_Socks

All,

Here is my situation:

Public Wifi from hotel room
Laptop connected to WiFi
iPad connected to WiFi
Ethernet shield connected to Laptop

My goal is to control the arduino from my iPad using the Ardumote HD app.  I think everything is in order, except it isn't working, and I feel it is because of my lack of network knowledge.  I think if I can get the addresses all set up, I'll be good to go.  Here is the network area of my sketch:

Code: [Select]

#include <SPI.h>         // for Arduino later than ver 0018
//#include <EthernetUdp.h>   // UDP library from bjoern@cs.stanford.edu
#include <Ethernet.h>
         
                         // source:  http://code.google.com/p/arduino/source/browse/trunk/libraries/?r=1094#libraries%2FEthernet


//////////  NETWORK INFO  ////////////////

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 169,254,130,77 };    // Set your shield's desired IP address here - check your network for configuration details
//byte gateway[] = { 192,168,1,1 };   //if you need to set a gateway IP
//byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
 
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)


IPAddress iPhoneIP(192, 168, 252, 156);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...


I am a complete idiot about network stuff.  I know what an IP address is, and what a MAC address is, but gateway and subnet masks... no idea.

For those that can help, here is some info from my network preferences:

Under the airport tab:
Status: CONNECTED
AirPort is connected to Guest and has the IP address 192.168.253.155.

Under the ethernet tab:
Status: CONNECTED
Ethernet has a self-assigned IP address and may not be able to connect.
IP address:  169.254.130.67
Subnet Mask:  255.255.0.0


zoomkat

Quote
Ethernet shield connected to Laptop


What provisions have you made for the laptop to act as a bridge between the arduino and hotel wifi system?
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

Jim_Socks

Quote
What provisions have you made for the laptop to act as a bridge between the arduino and hotel wifi system?


None...  I'll google what that is and get to work.  Any other suggestions?

Jim_Socks

OK, I watched a youtube video about setting up my Mac to "bridge" or share its internet over my ethernet port, and my computer is now "bridged"!

However, I feel I still need help in getting the correct addresses into my code.  Anyone out there that can help with that?  Are the numbers I posted above helpful at all?

Jim_Socks

Boy, I'm having a rough time.

I have no access to the router because it's the hotel WiFi, so forwarding the 7777 port doesn't seem to be a possibility (I tried to use portmapper, but it won't run on my computer for some reason)

I have an airport express though, so I plugged it in and set up my own little WiFi network (albeit w/o actual internet connection) I opened Airport Utility and forwarded port 7777.  I plugged the ethernet from the arduino into the airport express itself- but it doesn't show up on the DHCP client list.

I am at a loss here.  I have no idea which numbers go where... 

My NEW numbers are as follows:

Airport Tab:
Status: CONNECTED
AirPort is connected to Guest and has the IP address 10.0.1.2

iPad has IP of 10.0.1.3
in this new configuration, I changed the requested IP of the arduino to 10.0.1.5.

Here is the code snippet I am so frustrated over:
Code: [Select]


#include <SPI.h>         // for Arduino later than ver 0018
#include <EthernetUdp.h>   // UDP library from bjoern@cs.stanford.edu
#include <Ethernet.h>
         
                         // source:  http://code.google.com/p/arduino/source/browse/trunk/libraries/?r=1094#libraries%2FEthernet


//////////  NETWORK INFO  ////////////////

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 10, 0, 1, 5 };    // Set your shield's desired IP address here - check your network for configuration details
//byte gateway[] = { 192,168,1,1 };   //if you need to set a gateway IP
//byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
 
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)


IPAddress iPhoneIP(10, 0, 1, 3);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...


Please help if you can!

Go Up