It depends on your router.
Sometimes during testing, the router gets suspicious and blocks the IP.
I always set the Arduino to DHCP and set a fixed IP address in the router.
How do you know if your local IP is accepted by the router ?
Is that really the gateway IP ?
If you are using Windows, then request the gateway and find a free local IP. Perhaps a command window with 'ipconfig /all'.
When you take your project with you and connect it to another router, then it might not work if the router has other settings.
there is no router, I literally have the ethernet plugged into my computer and am trying to ping it or change it, nothing I do seems to make a difference.
I did plug it into my laptop and it shows as another IP but still that same generic 169.254.x.x
You have not posted all your code, but in the small amount you have posted I don't see a call to ether.begin which I believe should come before ether.staticSetup.
So, I have this huge sketch and yes I just tossed those lines in the first post in the sketch hoping that would do the trick. I was wrong.
So I want to start very basically, I have the below sketch. I uploaded it to the arduino, connected the crossover cable from the Enc to the back of my computer and in the terminal, I ran 'ipconfig getifaddr en0' the result was '169.254.16.93'.
I am sure you look at this and think 'duh' but honestly I am lost, tried for days, and can't wrap my head around what is going on.
Should I ping my computer and try to get the netmask, dns and gw?
My first reaction is that your PC is using 169.254.16.93 as the ip address for Ethernet - though I am unsure that the "getifaddr en0" means if you are using windows - what OS are you using on the PC?
If the PC Ethernet address is 169.254.16.93 and assuming it has a netmask of 255.255.255.0 other ip addresses on ethernet will need to be 169.254.16.nn in order to communicate with it. Alternatively, set the ip address on your PC to 192.168.0.nn where nn is not used elsewhere 200 might be suitable.
You still don't appear to have a ether.begin() before you call ether.staticSetup. Not sure whether using a blank dnsip will cause problems, you could use the PC ip. Using an address ending in .0 may cause problems (as can an ip address ending in 255) this is because they are often used as network identifier and broadcast address respectively so are best avoided in this case - they often work without problems, but it just add an additional possible problem to this configuration. The address 169.254.x.x is an automatic private address range and indicates a problem - usually caused by the computer trying to use DHCP but with no DHCP server accessible. I think it would be safer to use 192.168.0.n address and use 192.168.0.93 for the PC (you will have to set it manually) and 192.168.0.200 for your arduino and 192.168.0.254 for the gateway.
Very often routers (gateways) are given the address ending in .254., Often routers for home use contain dns servers so again use 192.168.0.254 for the dnsip.
Hello,
In case you have only your Arduino hardware cabled to the port of your pc and nothing else (even no Wifi active), then you need to set you PC to a fixed IP address and you need to set your Arduino to another fixed ip adress. Then you set both network masks to the same value and you are done.
From then on you should be able to ping your Arduino from your PC. And if it does not work, well try disabling virus scanners, firewalls etc.
However: if you have WiFi on an other NIC in your pc: make sure your networks are separate ones (IP anded with Mask should be different).
If you are connected to a (HOME) network, you should be able to ping from your pc to your router. And you should be able to identify a free IP address, then you should be able to set your Arduino to this free address.
I have written some software to look at Arduino variables over ethernet from the PC. The tutorial to use this software explains in detail how to set up your Arduino (fixed IP) with a PC (variable IP) to make ping work. Good luck.
Are there any led lights on the Ethernet interfaces that indicate whether there is an live circuit or not? Many switches and ethernet interfaces show no lights if there is no connection but a led if there is a connection, often different colour leds for different speeds. You may need to plug both the PC (Mac) and the Arduino into a switch just to check the Ethernet connection.
Does the same thing happen with the laptop as with your mac?
Can you try more than one ethernet cable (just in case)?
None of your code includes a call to ethernet.begin that I can see, so in theory you are not actually starting the Ethernet communications on your Arduino.
I think the best option is to try another sketch to see if you can get ping working.
There is a simple example in the link below, you will obviously have to change the ip address to one suitable for your network - probably the one you have used in your own sketch.