Shop OBEX P1 Docs P2 Docs Learn Events
Trouble getting W5200 connected , Solved , DHCP+Netbios+Basic Auth+Multisocketserver - Page 4 — Parallax Forums

Trouble getting W5200 connected , Solved , DHCP+Netbios+Basic Auth+Multisocketserver

124678

Comments

  • Mike GMike G Posts: 2,702
    edited 2012-10-13 12:44
    I have one more hour to troubleshoot. You are not consistently receiving a return packet. The -1 means that the request timeout. Have you tried to increase the timeout in Socket.Spin?
      TIMEOUT           = 1000      ' Number of loops to execute before issuing a timeout
      INIT_DELAY        = 1         ' Amount of time (ms) to wait in each timeout loop 
      TRANS_DELAY       = 0         ' Milliseconds to wait between receiving data blocks
    
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-13 12:59
    Mikeeeeeee. It works like a charm now .
    Yes I am realy happy , I havent implemented it in the full code yet but the dhcp demo gets the ip set every time .

    The magic change was the TIMEOUT value . You told me before to play with the INIT_DELAY , with that one i have tryied allot of combinations , non workd ,.
    i have increased the timeout to 1500 and directly it works all the time ,

    Thanks again mike , without you troubleshooting I would have never het this whole thing working , :P

    about an old question asked
    at the parseresourse .
    I used the below code to get something done with a post from my brouwser
    
        if(strcomp(resPtr[j], string("setpointplus")))
            setpointplus
    

    But this just inceases the value with one
    PUB setpointplus     
     if setpoint < 99
       Setpoint:= Setpoint + 1
     return
    
    the button with the inputfield is now posting ¨setpointvar + (INPUT)¨ to the wiznet .

    detect the setpointvar and then extract the input (e.g. 53 ) to use as

    Setpoint:= 53

    Your the best help Mike ,
    I much apriciate
    Someday ill give something nice back to you , currently not in the best position , but time wil tell . your the best
  • Mike GMike G Posts: 2,702
    edited 2012-10-13 13:29
    What is your gateway and DNS IP? Get these values from your router.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-13 13:43
    Mike, the implementation to make it work in the complete program isnt working like i expected . better say still not working , The demo works , not the complet one trying to figure out why

    Gateway is 192.168.2.254 ,, dns i thout the same

    why you need them 4 ,
    the program needs to find that out for it self right ??, because it must be able to work in another network with different gateway and dns,. ,or do you ask for a different reason

    o router dns is , 195.121.1.34/195.121.1.66/0.0.0 , gateway i cant find . only where you can set it , there its also 192.168.2.254
  • Mike GMike G Posts: 2,702
    edited 2012-10-13 17:09
    why you need them 4 ,
    the program needs to find that out for it self right ??, because it must be able to work in another network with different gateway and dns,. ,or do you ask for a different reason
    Because I'm trying to help you! The Offer packet contains zeros where I expect data.
  • Mike GMike G Posts: 2,702
    edited 2012-10-13 17:48
    Okay, soooo looking at the offer packet I see the following information
    Subnet Mask.....255.255.255.0
    Router..........192.168.2.254
    DNS.............192.168.2.254
    Domain Name.....lan	
    Server..........192.168.2.254
    

    I expect to see DNS servers outside your local network. Plus I see that a domain named lan. I'm not sure sure if the domain name has any meaning yet. I have some research to do and I'll get back with you.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-13 18:15
    Mike G wrote: »
    Okay, soooo looking at the offer packet I see the following information
    Subnet Mask.....255.255.255.0
    Router..........192.168.2.254
    DNS.............192.168.2.254
    Domain Name.....lan	
    Server..........192.168.2.254
    

    I expect to see DNS servers outside your local network. Plus I see that a domain named lan. I'm not sure sure if the domain name has any meaning yet. I have some research to do and I'll get back with you.

    About why I asked why u need the values , I meant to get to know what you are looking for in the code solving the problem :p anyway

    the domain name lan doesn't say nothing to me , not sure where that came from . the other settings look to be correct for what my modems sends out

    its getting kinda late here too so i'm gonna take a nap soon and continue tomorrow , I still didn't have any luck to get the full code working , even though the DHCP demo does work.
  • Mike GMike G Posts: 2,702
    edited 2012-10-13 19:11
    About why I asked why u need the values , I meant to get to know what you are looking for in the code solving the problem :p anyway
    First, I'm trying figure out why your offer packet does not contain a server IP address in the DHCP header.
    http://www.networksorcery.com/enp/protocol/dhcp.htm

    Second, why is DNS routed to your local network.

    Networking is not my forte. I researched heavily to get to this point. I realize there is a problem but I can't reproduce the the exact problem. Therefore, I need information to build a troubleshooting plan.

    Please describe your network configuration in as much detail as you can.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-14 04:56
    Mike G wrote: »
    First, I'm trying figure out why your offer packet does not contain a server IP address in the DHCP header.
    http://www.networksorcery.com/enp/protocol/dhcp.htm

    Second, why is DNS routed to your local network.

    Networking is not my forte. I researched heavily to get to this point. I realize there is a problem but I can't reproduce the the exact problem. Therefore, I need information to build a troubleshooting plan.

    Please describe your network configuration in as much detail as you can.

    Mike dont know what happend but now im not able to get them to work at all , verry strange , thinking the Simpleide program loads the bad data orso , dont understand why yesterday it work like a charm the dhcp demo and now it doensnt doe anything
    anyway

    my local network

    I have a adsl modem that connects me to the internet , this modem is also my main modem ,so from this box . is the starting point

    my network parametes are like in the photo below
    1.jpg
    2.jpg
    3.jpg


    In this network I have a pc with ubuntu with static ip 192.168.2.151. . this is where I have my apache server running from , serving e.g the stylesheets for the wiznet .

    besides that these is a blackberry phone and some other dhcp assign computers. (neighbours)
    don,t think they have anything to do with it .

    In the first picture I can see that the modem still rememberd the propnet . even knowing the controller was not on. The modem remembers it orso when its not there.
    maybe thats causing the modem not to transmit all the neccecary info

    like you said , I am also deffinitly not strong in this networking chapter. its also heavy reading and tryingout and more reading and asking :P ,
    thats why i appriciate your work allot.
    got the feeling you can,t take a brake without it working . or you will keep thinking about how to fix it anyway if your doing something else , This is definitly what I feel when I am trying to get this to work :p

    Hope we find the problem, tel me know
    781 x 789 - 107K
    784 x 462 - 63K
    798 x 916 - 111K
    1.jpg 106.9K
    2.jpg 63.5K
    3.jpg 111.5K
  • Mike GMike G Posts: 2,702
    edited 2012-10-14 06:29
    DHCP assignment has a lease period. It is ok to see the PROPNET in the DHCP client table.

    I'm still not sure what the problem is and why it works sometimes and not others. Check for an IP conflict or release the DHCP lease for the PROPNET.

    i guess it is ok to have the router configured as the DNS server. I tied it and works in my environment.

    Do you have a router connected to the modem too?
    Mike dont know what happend but now im not able to get them to work at all , verry strange , thinking the Simpleide program loads the bad data orso , dont understand why yesterday it work like a charm the dhcp demo and now it doensnt doe anything
    anyway
    Wht does this mean? Can you be more specific than It does not work?
  • Mike GMike G Posts: 2,702
    edited 2012-10-14 08:46
    The following files were updated.

    Dhcp.spin
    DhcpDemo.spin
    TcpSocketClientDemoDhcpDns.spin
    W5200.spin

    I was expecting the gateway IP to always be in the server DHCP field in the Offer packet. That's not always the case. The logic will use the router IP as the gateway if the server IP is empty in the Offer packet.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-14 09:11
    Mike G wrote: »
    The following files were updated.

    Dhcp.spin
    DhcpDemo.spin
    TcpSocketClientDemoDhcpDns.spin
    W5200.spin

    I was expecting the gateway IP to always be in the server DHCP field in the Offer packet. That's not always the case. The logic will use the router IP as the gateway if the server IP is empty in the Offer packet.

    Hi . I was just about to answer when i saw the new code . went to try it out . and the result is good . The dhcp demo works every time all time , with both modems , on the first try.

    about my network stil ,dont know if you call it a router , but the pc running ubuntu with static ip gets its network connection that gets transferred thru the power socket at the modem side , and out again at the socket where the computer is , so there is some sort of small network to get the data across my power lines.

    anyway.
    the multisocket program still doesnt run good , this is how it looks right now , but i still get the error #1 with it , and the dhcp demo works fine , using same object files
    PUB Main | i, page, dnsServer, receiving,bytesToRead
    
      
       
      setpoint :=  i2cObject.ReadLong(i2cSCL, EEPROMAddr, $7981) 
      offset :=  i2cObject.ReadLong(i2cSCL, EEPROMAddr, $7977)    
     
      dira[8]~~
      outa[8]~~
      
      cognew(tempcontrol,@stack1)
      cognew(controller,@stack2)
      
      receiving := true
      bytesToRead := 0
                                    
      pst.Start(115_200)
      pause(1000)
    
      pst.str(string("Initialize W5200", CR))
      wiz.start(6, 5, 4, 7)
      wiz.SetMac($00, $08, $DC, $16, $F8, $01)
    
      pst.str(string("Getting network paramters", CR))
      dhcp.Init(@buff, 7)
      pst.str(string("Requesting IP....."))
      ifnot(dhcp.DoDhcp)
        pst.str(string(CR, "Error Code: "))
        pst.dec(dhcp.GetErrorCode)
        pst.char(CR)
        pst.str(dhcp.GetErrorMessage)
        pst.char(CR)
        reboot
      else
        PrintIp(dhcp.GetIp)
    
      pst.str(string("DNS..............."))
      dnsServer := wiz.GetDns
      PrintIp(wiz.GetDns)
    
      pst.str(string("DHCP Server......."))
      printIp(wiz.GetDhcpServerIp)
    
      pst.str(string("Router IP........."))
      printIp(wiz.GetRouter)
      pst.char(CR)
      
      repeat
        pst.str(string("Initialize Sockets",CR))
        repeat i from 0 to SOCKETS-1
          sock[i].Init(i, TCP, 8080)
               
        OpenListeners
        StartListners
            
        pst.str(string("Start Socket server",CR))
        \MultiSocketServer
        pst.str(string("I blew up!"))
        pause(5000)
    

    I also renamed the files (w5200,socket,dhcp)adding a 3 to the end , to make sure the simpleide program was using the right one
    OBJ
      pst             : "Parallax Serial Terminal"
      wiz             : "W52003.spin" 
      sock[SOCKETS]   : "Socket3.spin"
      sht             : "Sensirion_full"         { temp/lv sensor control object }
      fp              : "FloatString"              { Math object }
      f               : "Float32"                  { Math object }
      i2cObject       : "basic_i2c_driver"         {Eprom object}     
      shift           : "Simple_74HC595"             { lcd control object }             
      rom             : "I2C_ROMEngine"                       { Eeprom Backup object }
      led             : "led_pwm"
       eeprom  : "Propeller Eeprom" 
         dhcp            : "Dhcp3"
    


    Let me know what im doing wrong with the dhcpmultiscket why its not working .


    UPDATE Correction, the demo doesnt work every time still. Tying to compare a few and see what differance i can find

    looks like when i connect it to the linksys modem that i have ( loose modem -only prop connected to it via wire ) ip server s 10.0.0.1 . anyway . it looks like it gets assing every time , but with the otrher modem i get the error still .
    correction . I did a modem reset and now its seem to connect also every time .
    the dhcp demo then . the dhcp followd by the multisocket still does the same
  • Mike GMike G Posts: 2,702
    edited 2012-10-14 09:44
    A -1 return code means the DHCP object timed out waiting for a response.

    Try increasing the timeout period.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-14 09:51
    Mike G wrote: »
    A -1 return code means the DHCP object timed out waiting for a response.

    Try increasing the timeout period.

    the error it 1 not -1


    its like increasing the timeout of the init_delay only increases the time that it responds with the error.

    the multi socket works most of the time with a timeout of 2000 and an init_delay of 2 . but still sometimes it doesn't get the ip assigned

    and with the demo the both work , dont know why it doesnt with the other program


    Mike , is there a differance in the sequence done in the dhcp demo with the one I use in the multisocket(.wizdoDHCP)
    strangly , the demo works fine , but the otrher one not, there must be something not updated orso ?
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-14 16:35
    I thouth this would help you out mike ,

    From 10 times , turing the propeller on , running the dhcp demo . recording the log and turning it off back

    try 1 - bad
    try2- bad
    try3- bad
    try4- Good
    try5- Good
    try6- Good
    try7- Good
    try8- BAD
    try9- BAD
    try10- Good

    So about 50 % of the time it works , i have attached the log file with all the data . hope it is usefull

    DHCP log.odt
  • Mike GMike G Posts: 2,702
    edited 2012-10-14 16:55
    Igor, leave INIT_DELAY at 1 and only change TIMEOUT.
    the error it 1 not -1
    The DHCP object error 1 can only come from result of a -1 being returned from Socket.Available. A -1 from Socket.Available means the socket timed out. An error code 1 from the DHCP objects means the timeout happened waiting for the Offer packet.

    The fact that DHCP works 50% of time means - it works half the time, which is good. The other half, it times out - not good. So the question is why is the Offer timing out?

    The TIMEOUT constant dictates the number of to loops run. INIT_DELAY is the amount of time to delay within the loop. Do this, set INIT_DELAY to 1 which is 1ms. Set TIMEOUT to 10000. This creates a 10 second maximum timeout.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-14 17:24
    Mike G wrote: »
    Do this, set INIT_DELAY to 1 which is 1ms. Set TIMEOUT to 10000. This creates a 10 second maximum timeout.

    Mike I have tried this before , did it now again , and that doesn't solve it , it looks like it only increases the time it takes to get the respond back to get the error #1 printed in the serial terminal

    did a little bit of wiresharking on it . an i saw it

    When I get a successful ip assigned , I can see the hole process of doing the discovery , getting the request etc etc. see in the picture . working nice
    Schermafdruk van 2012-10-15 02:05:25.jpg


    anyway
    when the dhcp fails , There is never any action taking place in the wireshark , *** iff the discovery request never gets send out orso because wireshark is not seeing it .
    any ideas ?

    and thanks for the short wiki explination about the socket timouts :p
  • Mike GMike G Posts: 2,702
    edited 2012-10-15 08:09
    The WireShark image is showing packet captures on port 68. DHCP operates over 2 ports 68 and 67.

    Use the following filter string in WireShark
    port 67 or port 68
    

    When I get home from work, I'll write debug code to help troubleshoot but I think you are experiencing timeouts as shown in DHCP log.odt.
  • Mike GMike G Posts: 2,702
    edited 2012-10-15 20:48
    Update DhcpDemo.spin. It's not going to solve the problem but might shed some light. Did you have any luck viewing port 67 and 68 packets in WireShark?
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-16 05:39
    He Mike, I had a awful headache last night so i went to sleep very early, not making any progress , anyway

    I took a fresh copy of the dhcp demo , loaded it . wireshark ready ,
    wasn,t able to get it to fillter and show me only those packets , but I can see them , and everything else :p
    anyway , when there is a successful dhcp assignment my log looks like this
    Initialize
    Remote IP: 192.168.2.254
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 45 4F 5B 85 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....556
    
    
    
    Message from: 192.168.2.254:67 (548)
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  02 01 06 00 85 00 00 00 00 00 00 00 00 00 00 00 
    0010  C0 A8 02 02 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 02 01 04 FF FF FF 00 03 04 C0 A8 02 FE 06 
    0100  04 C0 A8 02 FE 0F 03 6C 61 6E 36 04 C0 A8 02 FE 
    0110  33 04 00 01 51 80 FF 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0210  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0220  00 00 00 00 00 
    
    Start: 167 Len: 548
    -----------------------------------------------------
    
    
    Receive Offer
    Assigned IP.......192.168.2.2
    Gateway IP:.......Not assigned or 0.0.0.0
    Send Request
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 45 4F 5B 85 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 C0 A8 02 FE 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 03 32 04 C0 A8 02 02 36 04 C0 A8 02 FE 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....556
    
    
    
    Message from: 192.168.2.254:67 (548)
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  02 01 06 00 85 00 00 00 00 00 00 00 00 00 00 00 
    0010  C0 A8 02 02 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 05 01 04 FF FF FF 00 03 04 C0 A8 02 FE 06 
    0100  04 C0 A8 02 FE 0F 03 6C 61 6E 36 04 C0 A8 02 FE 
    0110  33 04 00 01 51 80 FF 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    01F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0210  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0220  00 00 00 00 00 
    
    Start: 167 Len: 548
    -----------------------------------------------------
    
    
    Receive Ack
    IP Assigned.......192.168.2.2
    
    
    DNS...............192.168.2.254
    DHCP Server.......192.168.2.254
    Router IP.........192.168.2.254
    Gateway IP........0.0.0.0
    

    One thing that i find odd is that the gateway is set to 0.0.0.0 , isn it supose to be 192.168.2.254?
    for the rest the succesfull dhcp assinments looks fine
    at the wireshark side i can see the discovery goig out and and getting assinnd .
    4.jpg


    Thats the time when it all looks to go fine .
    at the other hand , when it fail to connect , I get a verry different log. looking like below

    at the start , it waits when sending the first discovery , after a sec when it recives the first error , it keeps sending out the discovery after echother whitout stopping. Never getting the ip assing in 30 tryies(only 9 DHCP retries shown below)
    Initialize
    Remote IP: 192.168.2.254
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....-1
    
    
    Error: Discover
    
    Retry DHCP: 0
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 1
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 2
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 3
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 4
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 5
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 6
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 7
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 8
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    
    Retry DHCP: 9
    
    Send Discover
    
    -----------------------------------------------------
    
          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
          -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
    0000  01 85 6F 3A CD 00 00 00 00 00 00 00 00 00 00 00 
    0010  00 00 00 00 00 00 00 00 00 00 00 00 00 08 DC 16 
    0020  F8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00E0  00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 
    00F0  35 01 01 32 04 00 00 00 00 37 04 01 03 06 2A 0C 
    0100  06 50 78 2D 31 30 30 FF 00 00 00 00 00 00 00 00 
    0110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    0150  00 00 00 00 00 00 00 
    
    Start: 159 Len: 342
    -----------------------------------------------------
    
    Send Bytes.......342
    Bytes to Read....0
    
    
    Error: Discover
    

    At the wireshark side , i can see that a the discovery is beeing sent out an offer comming back , but a discovery beeing sent out again and continuing
    at line 7 is the fist, when i turn the prop on
    at line 19-24 is my pc with static ip talking to the modem, so thats not part of it .

    anyway . looks like the prop never gets, or accepts the offer that gets sent from the modem . or somthing in that range
    5.jpg
    because the prop continues to send them out
    6.jpg


    When its a succesfull . (below)
    1 Discovery gets sent out , (line 1)
    2 Modem sends offer (line 2)
    3 Wiznet asks hoe has the gateway , and thell I want 192.168.2.2 . ( line 3)
    4 after that modem accepts ( line 4)
    4.jpg


    Maybe Im wrong about the explination , but thats what i think is the simple explination of the procces
    . so I assume the wiznet nevver gets to step 3. and keeps repeating the first.
    so its either not getting it , or not listening at all for it


    hope this is helpfull for you mike , looking forward to getting it working 100% of the time :p

    Update : i was looking closer and i see that , the first when it fails , the discovery gets send (line 7) out after that the (ARP) gets send ( line8) . it waits for the offer but never gets it from the modem , ( don,t know why ) anyway . after it doesnt get the offer the first time it sends back out an second request and continues to do that. BUT when the second request gets send out , the modem sends an offer out , but the prop keeps discovering in place of taking the offer ,
    is it because the prop is not doing the ARP after each new discovery gets send out for it to accept the offer .; or is it just not looking for the offer ,
    So the modem does not react everytime on the first time , But when it does react sending the offer , the prop never takes it

    its what i think is happening

    Let me know what you think about it
    5.jpg
    942 x 104 - 45K
    1024 x 470 - 118K
    1024 x 580 - 156K
    4.jpg 44.7K
    5.jpg 118.5K
    6.jpg 156.2K
  • Mike GMike G Posts: 2,702
    edited 2012-10-16 07:24
    I did another quick test update this morning.

    Get the latest files:
    DhcpDemo.spin
    Socket.spin
    W5200.spin

    This should fix the Gateway issue. If so I'll update the DHCP object.

    Attached the WireShark log.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-16 08:15
    the gateway issue is fix yes
    but further the same , looks like , when the prop sends out its second discovery because it didn't get any reply the first time .
    when it send the second one , it does get a reply ,. but the prop never takes it . or thats what it looks like in wireshark
    I have attached the logs
    wireshark log.zip

    let me know
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-16 17:45
    Mike about the login form , I was implementing it in my multisocetserver that i use for the html5 graphs. anyway

    the name gets incoded at the start of the code , just before we begin setting the ip andso.
    pst.Start(115_200)
      pause(1000)
    
      'Encode the username and password used in basic authentication
      repeat t1 from 0 to @_null - @user_pw - 1
        b64.out(user_pw[t1])
      t1 := b64.end
      bytemove(@base64auth, t1, strsize(t1))
      pst.str(@base64auth)
      pst.char(CR)
    
      wiz.Init
        
      wiz.SetIp(192, 168, 2, 200)
    
    . i figured out that the token size header doesn't need to be used because its already being tokenized in the parseresourse
    but at implementing the rest of the code for it to work has been a big problem .
    have moved the code all over the place , and but unable to let it work correctly
    so far i have tried to put in in the parseresource letting it look for an extra if statement before it sends out
     if(IsAuthenticated) and (strcomp(resPtr[j], string("HTTP")))
          return @index
    
    
    and about 10 more combinations of the method being asked there , all resulting in or the page never loading , or it will keep on asking for the password,.
    wanna help me get it working with the graph page , keywords : Multi Socket -Authorization- ongoing xml request. buttons to press :p
  • Mike GMike G Posts: 2,702
    edited 2012-10-16 18:40
    . i figured out that the token size header doesn't need to be used because its already being tokenized in the parseresourse
    but at implementing the rest of the code for it to work has been a big problem .

    You don't need to use parseresourse anymore. I originally coded parseresourse as a very basic URL parser since you had two different requests. It was never intended for production just something to get you started.

    I built TcpSocketBasicAuthenticationServerDemo.spin specifically for basic authentication. The top level object contains a reference HttpHeader.spin. HttpHeader.spin is a comprehensive header tokenizer that exposes the header name values through public method. Please take a look at the demo.

    Is it as simple as reading the base-64 authorization header and comparing it to the the base-64 encode username and password created during the initialization process.
    PUB IsAuthenticated
      return strcomp( @authValue, req.Header( string("Authorization") ) )
    

    Does the demo work for ya?

    If I get time I'll look at incorporating authentication in HtmlGraph.spin.
  • Mike GMike G Posts: 2,702
    edited 2012-10-16 18:54
    What values do you have for TIMEOUT, INIT_DELAY, and TRANS_DELAY in the socket object?
      TIMEOUT           = ?' Number of loops to execute before issuing a timeout
      INIT_DELAY        = ?        ' Amount of time (ms) to wait in each timeout loop 
      TRANS_DELAY       = ?         ' Milliseconds to wait between receiving data blocks
    
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-16 19:09
    Yes the demo works fine at my side

    I left the timeout at 10000 like you put it ,
    the init delay = 1
    and trans_delay = 0

    just like in the fesh copy of this morning


    im going to dig deepper in the httpheader file , but
    you say parseresourse is not needed anymore , how do i get the different xlm posted then ?
    where do i put the methods that run when i push my buttons
  • Mike GMike G Posts: 2,702
    edited 2012-10-16 19:27
    im going to dig deepper in the httpheader file , but
    you say parseresourse is not needed anymore , how do i get the different xlm posted then ?
    where do i put the methods that run when i push my buttons

    Change your logic to use the HttpHeader Object.
    PUB Get(key)		- Return GET (URL) parameters by name
    PUB Post(key)		- Return POST (form) parameters by name
    PUB Header(key)		- Return header parameter by name
    PUB Request(key)	- Return GET or POST paramters by name
    PUB UrlContains(value)	- Does the URL contain the search string (value)
    

    I update Socket and the DhcpDemo. Please give it a try.

    I simulated your symptoms by unplugging the network cable on the initial request then plugging the cable in again. The updated logic can handle the connection issue and recover.
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-16 20:04
    Mike, I dont know whats happening , but for some reason my hole computer is not functioning anymore when i load the propeller gcc . verry strang
    tried reinstalling the files ,. nothing . think i wil reinstall the system soon , tyring to find out what it is
    til then im sorry cant test the code , im asap on it :P

    any ideas ?
    8.jpg
    719 x 465 - 77K
    8.jpg 76.7K
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-10-17 03:53
    Mike . The DHCP demo works good

    I have tested it 25+ times on both of my 2 lan network routers , and it gets the ip set immediately 100 % of the time.
    I saw once that it didnt get it right ahead , but at the second discovery packet sent out , accompanied by the ACK ( this was not the case before ) it did get it . so it wil get the ip set on both networks

    Nice work mike , I think now the DHCP files is bugless 4 further implementation .

    still trying to figure out what happend to my simpleide I used an old computer to test . but this is not the best pc so im trying to fix that fast
  • Mike GMike G Posts: 2,702
    edited 2012-10-18 06:53
    Make sure you get the latest Socket.spin
Sign In or Register to comment.