Helo,
I wanted connect my arduino to a raspberry pi but I have some problems.
At first I connected the arduino directly to the raspberry and everthing was fine.
Then I pluged the raspberry and the arduino in a switch. The config of the switch is alright and I have only one network. The result is the Arduino can´t connect with the raspberry.
I find the gateway a bit weird unless you have some good routing capabilities in your home. I would probably expect your gateway to be 172.20.10.1 which would make more sense
can you check on your computer - if it is connected to the same network - what the gateway is??
You are fine with MikroTik. That is what I use. I've never had a problem with my ethernet shield. Don't know what model router you are using, but they can be a bit touchy to set up. I don't normally recommend them for a beginner. I use various RB433 models. RB433, RB433AH and RB433UAH.
Yes, two gateway parameters in the begin call. The first is the dns server ip, and the second is the gateway ip. If you need a "real" dns server, replace the first parameter with your dns server ip.
diode1990:
Actually it should it work, when I plug the arduino in a Switch????
Yes. It will work with a MikroTik router set up as a switch, or Netgear, or D-Link. I've tested them. I was helping users on the MikroTik forum for years with setup and routing questions.
Could be. If you want to set it up as a switch, that is done in "/interface ethernet" and "/interface ethernet switch". Assign the network settings to the master interface, and all others (slave ports) should have the master-port set to the master interface. As I recall, there is a "switch1" as the default.