Shop OBEX P1 Docs P2 Docs Learn Events
Can I post W5200 for Quickstart here? No link light. — Parallax Forums

Can I post W5200 for Quickstart here? No link light.

PaulPaul Posts: 263
edited 2014-05-27 13:44 in Accessories
Just wondering as I Spinneret and W5200-4-QS are pretty similar. If not, please direct me to the correct forum.

Not getting any "link" light with known good switches and cables. I think I had the link light originally out of the box but after programming different things it doesn't link anymore. I've tried DhcpDemo and Simple_server and WebServer_W5200 but none seem to work. Now I'm stuck.

Thanks.

Comments

  • Mike GMike G Posts: 2,702
    edited 2013-04-17 07:45
    Yes, this is the right place. Maybe one of the forum admin or a Parallax admin can update this forum title or create a new forum.

    You must power the W5200 QS then power the QuickStart. I'm assuming you are using a QuickStart board.

    When you run any of the programs start up info is displayed in the Parallax Serial Terminal. What do you see in the terminal?
  • PaulPaul Posts: 263
    edited 2013-04-17 10:44
    Yes, I'm using the QuickStart. I'm powering with the USB cable's 5V. I guess both boards are powered at the same time.

    From the PST:
    Starting QuickStart Web Server v1.0
    Mount SD Card - OK
    WizNet 5200 Version: 3
    -----------------------------------------------
    
    Retrieving Network Parameters...Please Wait
    -----------------------------------------------
    
    DHCP Attempts: 6
    Error Code: 1
    Discover Error
    

    It looks like DHCP isn't working. ...or DHCP isn't working because I have no link.
    Is there a "demo' that uses static IP? I'm pretty restricted to what range of IP addresses they let me choose from.
  • Mike GMike G Posts: 2,702
    edited 2013-04-17 12:16
    Paul, USB power alone probably will not cut it. First, supply 6-9V to the QS W5200 through the barrel connector, then plug in the USB cable to program the QS.

    Yes, there are examples that use a static IP on Google Code and there are many examples in the forum. I'm at work right now. I don't want to post anything that will lead you down the rabbit hole.
  • PaulPaul Posts: 263
    edited 2013-04-17 13:00
    Thanks Mike. I'll look around for a proper power supply and check out Google Code. Thanks for the help.
  • PaulPaul Posts: 263
    edited 2013-04-17 18:10
    FOLLOWUP: The extra power supply seems to do the trick for the link lights. I'm just a little miffed at Parallax for inferring on their spec sheets that a USB (+5V @ 500mA) would be sufficient. Live and learn.

    It looks to me that the following will setup static IP after I enter my own IP and MAC. Am I close?
    OBJ
      wiz           : "W5200"
    
    PUB INIT
      wiz.Start(3, 0, 1, 2) 
      wiz.SetIp(192, 168, 1, 104)
      wiz.SetMac($00, $08, $DC, $16, $F8, $01)
    
  • Mike GMike G Posts: 2,702
    edited 2013-04-17 18:26
    That looks about right, can't verify - still at work.

    What about the WebServer_W5200 and DHCP. DHCP not working for ya?
  • Mike GMike G Posts: 2,702
    edited 2013-04-18 05:17
    Paul, the start method in post #6 is using incorrect PIN IO for the production QS W5200 board. See the attached archive for a basic TCP server that uses a static IP.
  • PaulPaul Posts: 263
    edited 2013-04-18 09:12
    Mike, DHCP is not working at home. Should be but isn't. I did get "W5200_UnitTest" working there last night with static IP settings and got the Hello World html page. Dhcp is working here at work but I have to change the IP to my 'restricted' range.

    Thanks for the MultiSocketServerDemo. This should help a lot.

    Paul
  • twctwc Posts: 107
    edited 2013-04-18 09:45
    ....something you can easily try is the 'resetIP' argument for DoDhcp. For my Netgear router (acting as the DHCP server), DoDhcp only works if the source (i.e. W5200) IP is 0.0.0.0. The gotcha is it will work the first time after power-up/reset which comes up with source IP=0.0.0.0. But once I've got a valid IP (i.e. not 0.0.0.0), subsequent calls to DoDhcp will fail unless the IP is reset to 0.0.0.0 first. In short...

    repeat
    DoDhcp(0) 'don't reset IP

    ...will work the first time after power-up/reset, but faills second pass (i.e. after IP is set to non-0.0.0.0 by the first pass), while...

    repeat
    DoDhcp(1) 'reset IP to 0.0.0.0 first, then get new IP

    ...works fine.

    This is definitely a router/DHCP server dependent mystery, some setups don't need to resetIP, but maybe yours (like mine) does so give it a try.
  • Mike GMike G Posts: 2,702
    edited 2013-04-18 12:57
    Definitely, give twc's suggestion a shot and let us know.

    What is the make and model of your home router?
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2013-04-18 13:44
    Hi Paul,

    The W5200 + QuickStart should work from USB power alone. There are some large capacitors on the board that may take a little while to charge (on the order of milliseconds). The FTDI chip also has a conversation with your computer when it first enumerates itself. As part of this conversation, it requests that the computer's USB port supply up to 500 mA, instead of the normal 100 mA before the request. Since this enumeration and request take a little time, I've noticed that the W5200 chip doesn't always start up properly.

    Try having your program wait a second when it is starting, and issue a hard reset command:
    waitcnt(cnt + clkfreq)
    wiz.HardReset(WIZ#WIZ_RESET)
    

    That should bring the w5200 chip back to a known state.

    Basically, the key is to make sure the w5200 chip has "stable" power on start up. You can accomplish this by supplying power to the hardware before you connect it to your computer's USB port (as Mike G suggested, and you have done), or by having the Propeller reset the w5200 chip.
  • Mike GMike G Posts: 2,702
    edited 2013-04-18 14:06
    Make sure to wait about 1.5 seconds after a reset before initializing a socket. At least that's what I have to do on my setup.
  • PaulPaul Posts: 263
    edited 2013-04-19 13:00
    @ Daniel & Mike, Well it's certainly good to know that I wasn't crazy for thinking I saw link lights before I started programming the QS! It makes sense that the W5200 is getting commands from the QS before it's ready. I will give the 1-1.5 sec. delay a try this weekend. Weather permitting: Good weather means I'm working on the yard and shaving the dog. :blank:

    Router is a Motorola SBG6580.

    @twc, I'll give the resetIP() a go and see if works for me. I do remember seeing another method to force the IP in one of the DHCP webserver programs. I was going to dig it out and see what it does.

    Thanks all.
    Paul
  • rubergdrubergd Posts: 11
    edited 2014-05-26 09:09
    The start-up sequence was a great tip...Thanks! I had just picked up a QS W5200 board and was going crazy trying to get it to start up predictably.

    The amount of demo code provided for the board is awesome, but I was wondering if there was any associated documentation for the various examples, as the only one covered in the product guide was the simple server. I know that the folder names are fairly self-explanatory, but brief description and basic instructions (setup, etc.) for each example would be greatly appreciated. I have been digging through the source code to figure out the functionality of each, but some of this stuff is pretty new to me, it's slow going and a little guidance would go a long way. In spite of that, I've managed to get a few things running and am really impressed with this cool little board and the libraries and code that came with it.. Thanks for the creation!

    Regarding the WebServer_W5200_RTC example:
    The original sntp server listed in the example was offline, so I put in another. It syncs up fine and the date, time and year are correct, but the day of the week displayed in the xml examples is wrong. I tried other servers with the same result. Any suggestions? Thanks in advance!
  • Mike GMike G Posts: 2,702
    edited 2014-05-27 07:50
    I fired up WebServer_W5200_RTC this morning from source and it worked as expected. The code showed Tuesday as the current day of the week. Could be changes implemented around December caused a bug.
  • rubergdrubergd Posts: 11
    edited 2014-05-27 13:44
    Hi, Mike. I had been using the examples and libraries from the product page download. Most of them had 3/10/13 or earlier file dates. After my post, I went to the Google code site and downloaded the latest (R198) and greatest and replaced everything. The day problem is fixed. I haven't had time to dig through all of the revisions, but one of the cool improvements I did spot in the examples is that you can now serve from SD subdirectories. Perhaps the download on the product page could be updated? Thanks for your reply and all of the work you have put into this project....Don
Sign In or Register to comment.