Re: How to enable poweroff in D-LINK DSM-G600

Charles Brown <[email protected]> Tue, 19 Feb 2013 15:22:53 +0100
Newsgroups gmane.os.netbsd.ports.sandpoint
Message-ID <CAPA5q9a8aZ+PY52=yBmFp_5O-yj6PysTGZ57fQcY5WSwt2T_pA@mail.gmail.com>
--14dae9340ae9c62e6c04d6149316
Content-Type: text/plain; charset=ISO-8859-1

Yes, it works fine for me.
Every "power off"command works (shutdown -p,halt -p and so on) , also
pressing the power button for N seconds turns my unit off.
After doing this "via software" power off, I'm able to turn on the box
using the power button.
Also, issuing (root user):

echo "ZWC" > /dev/satmgr

immediatly turns off the unit, giving me a wonderfull root file system
check at first restart...

Yes, I can try to add the old "SYN\nSYN\n ", but I think that in my unit
this statement will never be executed. :)

Quite strange that doesn't work in your box. Different microcontrollers?
....
....
....
I have done the test that you requested, but (obviously), the statement
that sends "SYN\nSYN\n" in my box hasn't been executed.


2013/2/19 Frank Wille <[email protected]>

> On Thu, 14 Feb 2013 23:31:45 +0100
> Charles Brown <[email protected]> wrote:
>
> > dpwroff(struct satmgr_softc *sc)
> > {
> >     send_sat(sc, "ZWC\n");
> > }
> >
> > In my dsm-g600, this permits the power off of the unit via software.
>
> Does it really work for you? I knew about the command, but on my DSM-G600
> it didn't do anything.
>
> Maybe we have different revisions (I remember that you also had a
> different acardide(4) revision) of the PIC, or the PIC-software?
>
> Does "ZWC" switch off immediately?
>
> Can you test the following modification, which is intended to work
> with both revisions?


> ---8<---
> static void
> dpwroff(struct satmgr_softc *sc)
> {
>
>         send_sat(sc, "ZWC\n");
>
>         /*
>          * When this line is reached, then this board revision doesn't
>          * support hardware-shutdown, so we flash the power LED
>          * to indicate that the device can be switched off.
>          */
>         send_sat(sc, "SYN\nSYN\n");
>
>         /* drops into default power-off handling (looping forever) */
> }
> ---8<---
>
> --
> Frank Wille
>

--14dae9340ae9c62e6c04d6149316
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Yes, it works fine for me.<br>Every &quot;power off&q=
uot;command works (shutdown -p,halt -p and so on) , also pressing the power=
 button for N seconds turns my unit off.<br>After doing this &quot;via soft=
ware&quot; power off, I&#39;m able to turn on the box using the power butto=
n.<br>
Also, issuing (root user):<br><br>echo &quot;ZWC&quot; &gt; /dev/satmgr<br>=
<br>immediatly turns off the unit, giving me a wonderfull root file system =
check at first restart...<br><br>Yes, I can try to add the old &quot;SYN\nS=
YN\n &quot;, but I think that in my unit this statement will never be execu=
ted. :)<br>
<br></div>Quite strange that doesn&#39;t work in your box. Different microc=
ontrollers? <br><div>....<br>....<br>....<br></div><div>I have done the tes=
t that you requested, but (obviously), the statement that sends &quot;SYN\n=
SYN\n&quot; in my box hasn&#39;t been executed.<br>
=A0<br>=A0<br></div><div><div><div><div><div class=3D"gmail_extra"><div cla=
ss=3D"gmail_quote">2013/2/19 Frank Wille <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;<=
/span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D"im">On Thu,=
 14 Feb 2013 23:31:45 +0100<br>
Charles Brown &lt;<a href=3D"mailto:[email protected]">obigiankenobi@=
gmail.com</a>&gt; wrote:<br>
<br>
&gt; dpwroff(struct satmgr_softc *sc)<br>
&gt; {<br>
&gt; =A0 =A0 send_sat(sc, &quot;ZWC\n&quot;);<br>
&gt; }<br>
&gt;<br>
&gt; In my dsm-g600, this permits the power off of the unit via software.<b=
r>
<br>
</div>Does it really work for you? I knew about the command, but on my DSM-=
G600<br>
it didn&#39;t do anything.<br>
<br>
Maybe we have different revisions (I remember that you also had a<br>
different acardide(4) revision) of the PIC, or the PIC-software?<br>
<br>
Does &quot;ZWC&quot; switch off immediately?<br>
<br>
Can you test the following modification, which is intended to work<br>
with both revisions?=A0</blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
<br>
---8&lt;---<br>
static void<br>
<div class=3D"im">dpwroff(struct satmgr_softc *sc)<br>
{<br>
<br>
=A0 =A0 =A0 =A0 send_sat(sc, &quot;ZWC\n&quot;);<br>
<br>
</div>=A0 =A0 =A0 =A0 /*<br>
=A0 =A0 =A0 =A0 =A0* When this line is reached, then this board revision do=
esn&#39;t<br>
=A0 =A0 =A0 =A0 =A0* support hardware-shutdown, so we flash the power LED<b=
r>
=A0 =A0 =A0 =A0 =A0* to indicate that the device can be switched off.<br>
=A0 =A0 =A0 =A0 =A0*/<br>
=A0 =A0 =A0 =A0 send_sat(sc, &quot;SYN\nSYN\n&quot;);<br>
<br>
=A0 =A0 =A0 =A0 /* drops into default power-off handling (looping forever) =
*/<br>
}<br>
---8&lt;---<br>
<span class=3D""><font color=3D"#888888"><br>
--<br>
Frank Wille<br>
</font></span></blockquote></div><br></div></div></div></div></div></div>

--14dae9340ae9c62e6c04d6149316--