wiz820io server not initializing to fixed IP

Status
Not open for further replies.

twilkers

Well-known member
Hi,

I have a working sketch for arduino ethernet R3 and am told that it should just work for wiz820io with a recompile.

while it builds ok, the server inits to 0.0.0.0 instead of the intended fixed IP address.

what am I doing wrong or not doing properly?

thanks in advance,
tim
 

Attachments

  • teensy_webserver_RevD1_2016_10_22_adapter_port.ino
    15.9 KB · Views: 109
works for me

View attachment webcontent.html.txt
View attachment serial monitor output.txt

With only a small change of IP Address from 192.168.1.17 to 192.168.2.17 to match my local LAN, this sketch appears to work for me. Attached are the Serial Monitor output and the HTTP Response.

Which Teensy model are you using? What version of Arduino/Teensyduino are you using. I'm using a Teensy 3.2, Arduino 1.6.12, and Teensyduino 1.31-beta1.
 
Last edited:
Very encouraging. I'm using
Teensy 3.2
Arduino 1.6.11
Teensyduino 1.30

Guess I have some upgrading to do.

Thanks for the sanity check!
 
Very encouraging. I'm using
Teensy 3.2
Arduino 1.6.11
Teensyduino 1.30

Guess I have some upgrading to do.

Thanks for the sanity check!

Upgrading won't hurt but it's probably not the root issue. Also, kinda expect Teensyduino 1.31 to be released "in a few days". I'd try a couple of things first:

1. Make sure you use a unique MAC Address, at least on your local network. I see you are now using a hard coded MAC Address in your sketch. If you have more than 1 Teensy on your local network running this sketch, there will be a conflict. Or, if you have a network switch and you move the Teensy from one port to another, it might confuse the switch unless you reset it.

You can (and should) replace the hard coded MAC Address with code that uses each Teensy's unique MAC Address. See this thread for more info.

2. You also are using a hard coded IP Address. To overly simplify, the IP Address needs to use the same Subnet as the other nodes on your local network, including the one you are running your web client (web browser) on.

If you have DHCP available on your local network, you could also use that to obtain a valid IP Address. Take a look the various overloaded versions of Ethernet.begin() for the appropriate one to use.
 
Last edited:
thanks for the suggestions. per your numbering

1. currently only in test mode, laptop, switch, teensy stack. so only single teensy for now. In the end system there is an arduino as well, but I was careful to change the mac address on this sketch to prevent conflict. thanks for the reference thread. another member was nudging me in this direction and I have the code, but had same server init issue. so I figured best to back up a step and solve one issue at a time. ultimately will consolidate the lowly featured arduino to this teensy on my way to 3.6 and larger sram.

2. in my end system, everything is on the .1 subnet. I was reluctant to use DHCP because using the IP address to access the web page remotely. I must admit the overloading is a bit confusing to me at this point. once it inits, I'll take another run at the overloading thing to try to get the teensy mac to work.

the overall function is a data acquisition system for a remote, off grid solar installation at my rc field.


upgraded arduino and teensy to 1.31 beta #2, same init issue.

suggestions?

thanks for your help
 
Last edited:
since sketch works for you, I'm thinking hardware issue unless you have a better idea.

I don't have another board set to swap out just now, will in a week or so.
 
I'm running your code on a Teensy 3.2 with Wiz820io. This is what I see in the serial monitor:

sc.png

I tested with Arduino 1.6.12 and Teensyduino 1.31-beta2.

Maybe there's something not quite right with your hardware?

Also, turn on Verbose info while compiling in File > Preferences. Then check the list of library locations, to make sure Arduino really is using the Ethernet library Teensyduino provides (hardware/teensy/avr/libraries/Ethernet).
 
Maybe post some pictures of how you've actually connected the hardware...

thanks Paul.

attached is verbose listing from compiler. looks same to me as with sparkfun and R3.

pic of my setup is also attached and is a bit busy. on the left is a board with several difference amplifiers and shunt resistors to measure bidirectional current from a bank of batteries. below teensy is an adapter board I made that gets the analog signals to teensy with a 7805 regulator for teensy. below that is a connector board to connect to signals to shunt board.

I have an accurate 2.5v reference on the connector board which I'm supplying to Aref. there is another of the same reference on the shunt board to generate signal to shift voltages up for single supply conversion with bidirectional currents.

the diode board is my easy way to get from 12v to about 7.5v for the adapter (need both voltages). I am confident that wall transformer is supplying enough power for 5v regulator.

substituting arduino ethernet R3 and sparkfun teensy adapter, same sketch, same other boards, all works well, shows just as you posted. fixed IP address shows up and I can get webpage using browser.

appreciate you taking the time.
 

Attachments

  • tim's verbose list 10_28_2016.txt
    28.9 KB · Views: 93
  • tim's setup.jpg
    tim's setup.jpg
    165.4 KB · Views: 165
Can you try just the Teensy 3.2 + WIZ820io together? Use one of the simple example sketches, like examples/WebServer. Test with only computer, switch, and Teensy on your network. This should provide a simpler test to see if your hardware, Ethernet library, and sketch are working correctly.

If you do much work with Teensy 3.2 and WIZ820io, it can be very useful to make a socketed version of each. You can then quickly put the two together for debugging purposes as needed.
 
As I said in your other thread, did you try it on a router and not just connected to your laptop? I'm pretty sure your problem lies there. If you use it on a switch not connected to any network or router, ethernet will work very erratic or not at all. You need a valid IP that fits in your subnet, you need a reachable gateway to communicate etc.
 
The verbose info shows the correct libraries. Your program definitely worked (at least initialized with the right IP number) when I ran it here. Looks like something with the hardware.
 
Thanks for checking Paul. Do you have a router on your system? I've found my router but not the power supply at this point to try it.
 
Thanks for checking Paul. Do you have a router on your system?

The other end of the ethernet cable was plugged into a HP 1400-24G switch.

https://www.amazon.com/dp/B000P2YRKM

I tried again just now, without any ethernet cable plugged into the WIZ820io. It still prints "server is at 192.168.1.17" in the serial monitor, with no cable connected. If you're seeing 0.0.0.0, it's almost certainly a sign your WIZ820io isn't connected properly or has been damaged.
 
I substituted an old WRT54GL set for a DHCP server for the switch I was using, .didn't get anything in the serial window at all.

moved back to the switch, get 0.0.0.0. unplugged ethernet cable, same.

since my code is obviously running, could I be doing anything to other teensy pins that would impace wiz820io functionality? this is a new adapter I have done, the only addition was to add a board level switch to PGM because teensy sw was inaccessible.
 
Did you try removing the Teensy+Wiz820 from all that other stuff?

Here is the hardware I tested with your code. This definitely works:

enet.jpg
 
Tested this way as well, same 0.0.0.0

I think you're right, the wiz820io has seen better days.

I was concerned if the USB port could provide enough power for this configuration, but guess it can.

I have spare wiz and adapter boards, short a teensy just now. More in a week or so with an oshpark order.

Thanks for your help,
 
Hi all,

I had this same issue where Ethernet.localIP() reports 0.0.0.0 (or sometimes 255.255.255.255) after setting a static IP in the normal 192.168.0.x range.

This was a new issue after updating my Ethernet to the latest version by Paul on GitHub.

I was able to resolve by putting this code at the beginning of setup(){}

pinMode(9, OUTPUT);
digitalWrite(9, LOW); // reset the WIZ820io
delay(1000);
digitalWrite(9, HIGH); // release the WIZ820io

So I'm wondering if the reset pulse inside the Ethernet library is now too short? (I'm using W5200 & Teensy 3.6 on custom PCB with 3.3v regulator)
 
Hi all,

I had this same issue where Ethernet.localIP() reports 0.0.0.0 (or sometimes 255.255.255.255) after setting a static IP in the normal 192.168.0.x range.

This was a new issue after updating my Ethernet to the latest version by Paul on GitHub.

I was able to resolve by putting this code at the beginning of setup(){}



So I'm wondering if the reset pulse inside the Ethernet library is now too short? (I'm using W5200 & Teensy 3.6 on custom PCB with 3.3v regulator)


Hi

I have had the same issue today. Just recompiled a previously working project from about year back. I changed the fall back IP address that was used in case DHCP didn't acquire OK.
Found that Ethernet.begin(MYmac) hung. Commenting it out and adding Ethernet.begin(MYmac, MYip) in its place didn't hang but Ethernet.localIP() reported 0.0.0.0.
Strangely the Serial port would not open either so could not debug easily.
Adding the external reset as per macaba's recommendation worked a treat, everything back to as it was.

Thanks, saved me loads of time.

I'm using Arduino 1.8.1 and Teensyduino 1.35. I also tried it on my 'old' system using Arduino 1.6.6 with Teensyduino 1.28 with similar results.


My first ever post!
 
Yeah, pretty busy right now. This EHCI stuff is probably the most difficult driver-level code I've ever done. But it's finally starting to come together.....

I'm probably not going to put the reset pulse back into the library, at least not compiled by default. But I might put a mention of it into all the examples, maybe the code commented out.

There's a few reasons for this....

1: I'm hoping to get Arduino to accept my massively-changed Ethernet library. Taking an extra pin, which isn't connected on anyone's shields other than PJRC's, isn't going to be very welcome in the wider Arduino community.

2: W5200 is end-of-life. Long-term, this problem is expected to fade away.

3: Consuming an extra pin isn't very nice, especially when the other chips don't really need it, and even W5200 works if you initialize it right away after a power-on reset pulse from the CAT811.
 
Status
Not open for further replies.
Back
Top