I want to create an network connection through the ethernet module of the IND.I/O. DHCP does not assigns dynamic IP, I can manualy set the IP adres but not create a connection, .
The sketch I first used is the TelnetClient example adapted for the IND.IO. I have an echo service on my machine who listens but the Arduino does not connect. The client.connect returns 0 thus unable to connect to the server.
The second sketch is the WebServer example and my browser could not connect to it.
- Industruino is connected to a external power supply
- Green lights on the ethernet interface is blinking, red one is enabled
- Tried different ethernet cables and switch ports
- I changed the SPI speed to 4MHz (in 8MHz it coudn't set IP at 4MHz it can)
- Firewall on my Windows is disabled
- I use a static IP, with DHCP "Ethernet.begin(mac)" returns 0
- Pinging the Arduino results in a time-out
- Fram can be read and write (to test if the complete module was defective)
- Changed all Serial to SerialUSB in the examples
- I have not connected extra hardware besides the network module
- My router registeres devices with a static IP, the Industruino is not listed
- I use the Ethernet2 library
- Connect from another machine to the echo service works
Source code for the TelnetClient: https://pastebin.com/0MguAvj0
Output of the code:
Do I have to add or change something in my code? Or is the module simply defective?
The default WebClient example with SerialUSB change is working .
The wierd thing is that I started with this example and it wasn't working. The SPI frequency was on 8MHz. Yet the router has registered the MAC and IP. I changed the MAC, IP and the SPI freq. and restarted the router. The entry was gone but still not working. Through the day I changed alot of things and used defferent examples without succes.
Now, 24 hours later the WebClient and WebServer (based on yesterday's changes which didn't work) example works. I used the MAC from the WebClient example and DHCP.
My conclusion is that the first registered MAC and maybe IP was persistent for the router and/or the switch(es). Changing that blocked communication. Now 24 hours later the tables holding the MAC address is cleared and I get a fresh start.
Versiosn of software I used:
Ethernet2 by Various v1.0.4
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!