Shop OBEX P1 Docs P2 Docs Learn Events
Link Detection — Parallax Forums

Link Detection

Chip CoxChip Cox Posts: 73
edited 2011-03-21 06:41 in Accessories
Has anyone looked into anything regarding link detection. I want to display an error if there isn't a cable plugged in or if the other end isn't plugged in for example.
Thanks

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-03-20 14:01
    If the RJ45 is not connected, where will you display the error? A serial terminal?

    The status LED are off when the Spinneret is not connected to a network .
  • Chip CoxChip Cox Posts: 73
    edited 2011-03-20 14:15
    Yes, I will either display the message on a serial terminal , or to a LCD. I understand that the lights are off when the RJ45 connector is not plugged in. In my case the spinneret is connected to another prop where the actual sensors are running. If the network cable becomes unplugged, I want to send a message back to the other prop letting it know that the cable is unplugged. That way, it can either buffer the data it would normally be sending across, or display it the error on a serial terminal or LCD whichever is appropriate.
  • Mike GMike G Posts: 2,702
    edited 2011-03-20 15:37
    I'm not sure how your application works... but if the RJ45 cable is not connected then a requests for a network resource will timeout. At that point you can decide what to do, set a flag, let the other Propeller know, save the current info to the Spinneret's SD card until the network is available again...
  • Chip CoxChip Cox Posts: 73
    edited 2011-03-20 20:11
    Hmmmm, they aren't timing out. That give me somewhere to look.
    Thanks
  • Mike GMike G Posts: 2,702
    edited 2011-03-21 06:41
    Hmmmm, they aren't timing out. That give me somewhere to look.

    You have to write the timeout logic. The client demo waits indefinitely until a connection is made. The status register will contain $00.

    The web server is a little different as the server is listening; status = $14. If the Spinneret is not connected to the network, the code will wait forever.

    I looked in the published W5100 data sheet and Spinneret schematic. I did not see a node where the Propeller is connected to the W5100 status lines. I could be wrong though.

    Again I'm referencing the demo code and the published references. You're setup could be completely different.
Sign In or Register to comment.