Send Wake on Lan (WoL) request manually through the ethernet cable using an Arduino or Raspberry Pi












1















I'm trying to make a circuit that "intercepts" the ethernet cable before it enters the computer, allowing me to send a "Magic Packet" through the cable manually - by the press of a button for example.



As far as I could gather, to make Wake on Lan happen, you must send 6 bytes of 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's MAC adress - total of 102 bytes. (source: Wikipedia). I'm just having a hard time figuring out how to send this magic packet manually, not through the router (if it's even possible).



The sketch below illustrates what I'm trying to do.



Rough sketch



An ethernet cable has 8 wires, the interesting ones for this probably being no. 1, 2, 3 and 6 - TX+, RX-, RX+ and RX- (illustration).



I'm trying to determine how this specific serial protocol works, and how to use it in practice on a development-board like Arduino. This website says it can either be "RS423" or "RS422".



So my question is; is it possible to do what I'm trying to do? And if so, how do I go about sending the Magic Packet correctly?










share|improve this question



























    1















    I'm trying to make a circuit that "intercepts" the ethernet cable before it enters the computer, allowing me to send a "Magic Packet" through the cable manually - by the press of a button for example.



    As far as I could gather, to make Wake on Lan happen, you must send 6 bytes of 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's MAC adress - total of 102 bytes. (source: Wikipedia). I'm just having a hard time figuring out how to send this magic packet manually, not through the router (if it's even possible).



    The sketch below illustrates what I'm trying to do.



    Rough sketch



    An ethernet cable has 8 wires, the interesting ones for this probably being no. 1, 2, 3 and 6 - TX+, RX-, RX+ and RX- (illustration).



    I'm trying to determine how this specific serial protocol works, and how to use it in practice on a development-board like Arduino. This website says it can either be "RS423" or "RS422".



    So my question is; is it possible to do what I'm trying to do? And if so, how do I go about sending the Magic Packet correctly?










    share|improve this question

























      1












      1








      1


      1






      I'm trying to make a circuit that "intercepts" the ethernet cable before it enters the computer, allowing me to send a "Magic Packet" through the cable manually - by the press of a button for example.



      As far as I could gather, to make Wake on Lan happen, you must send 6 bytes of 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's MAC adress - total of 102 bytes. (source: Wikipedia). I'm just having a hard time figuring out how to send this magic packet manually, not through the router (if it's even possible).



      The sketch below illustrates what I'm trying to do.



      Rough sketch



      An ethernet cable has 8 wires, the interesting ones for this probably being no. 1, 2, 3 and 6 - TX+, RX-, RX+ and RX- (illustration).



      I'm trying to determine how this specific serial protocol works, and how to use it in practice on a development-board like Arduino. This website says it can either be "RS423" or "RS422".



      So my question is; is it possible to do what I'm trying to do? And if so, how do I go about sending the Magic Packet correctly?










      share|improve this question














      I'm trying to make a circuit that "intercepts" the ethernet cable before it enters the computer, allowing me to send a "Magic Packet" through the cable manually - by the press of a button for example.



      As far as I could gather, to make Wake on Lan happen, you must send 6 bytes of 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's MAC adress - total of 102 bytes. (source: Wikipedia). I'm just having a hard time figuring out how to send this magic packet manually, not through the router (if it's even possible).



      The sketch below illustrates what I'm trying to do.



      Rough sketch



      An ethernet cable has 8 wires, the interesting ones for this probably being no. 1, 2, 3 and 6 - TX+, RX-, RX+ and RX- (illustration).



      I'm trying to determine how this specific serial protocol works, and how to use it in practice on a development-board like Arduino. This website says it can either be "RS423" or "RS422".



      So my question is; is it possible to do what I'm trying to do? And if so, how do I go about sending the Magic Packet correctly?







      networking ethernet raspberry-pi wake-on-lan arduino






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 27 '18 at 17:19









      Albert MN.Albert MN.

      1085




      1085






















          1 Answer
          1






          active

          oldest

          votes


















          1














          As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.



          Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.



          Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.



          Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).



          The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".



          All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.



          If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388179%2fsend-wake-on-lan-wol-request-manually-through-the-ethernet-cable-using-an-ardu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.



            Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.



            Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.



            Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).



            The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".



            All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.



            If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.






            share|improve this answer






























              1














              As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.



              Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.



              Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.



              Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).



              The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".



              All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.



              If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.






              share|improve this answer




























                1












                1








                1







                As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.



                Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.



                Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.



                Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).



                The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".



                All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.



                If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.






                share|improve this answer















                As you wrote, a WoL magic packet (frame) contains the sequence anywhere in its data stream.



                Usually, the WoL packet is sent using a higher-layer protocol since it's easier to do. Simply send a UDP packet (any port is possible, 0, 7 or 9 is customary) containing the sequence to broadcast address 255.255.255.255.



                Good luck on encoding the Ethernet stream though - it's not as simple as RS422/423.



                Before line encoding you need to build an Ethernet frame preceded by the preamble/SOF sequence, then the frame header (use Ethertype 0x0842) followed by the magic pattern. Depending on the WoL mechanism, you'll probably need to pad the frame to its minimal size (64 w/o preamble/SOF) and calculate the correct frame check sequence (FCS).



                The frame then needs to be line encoded. 10BASE-T uses simple Manchester code (01="1" and 10="0"). 100BASE-TX uses 4b/5b line code. 1000BASE-T uses a much more complicate line code that's probably outside your project's scope. Most probably the WoL link is 10BASE-T, so that's doable. If you can't take over an existing WoL link you'll also need to generate regular link pulses to make the far side "link up".



                All in all, it'll be much easier to wake the hardware using another method if you don't need to do it over the network cable.



                If you're using an Ethernet node to generate the WoL packet you can just connect it anywhere in your network, on any switch port. Simply broadcasting the packet will send it to all linked nodes, including the selected MAC.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 28 '18 at 9:34

























                answered Dec 28 '18 at 9:29









                Zac67Zac67

                69019




                69019






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388179%2fsend-wake-on-lan-wol-request-manually-through-the-ethernet-cable-using-an-ardu%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                    Alcedinidae

                    Can an atomic nucleus contain both particles and antiparticles? [duplicate]