Customize progress

12 views
Skip to first unread message

Thomas Commandoux

unread,
Nov 29, 2022, 11:08:07 AM11/29/22
to swup...@googlegroups.com
Hi everyone,

I'm trying to use the remote handler, which I know few people use, but in my case that was the best choice.

I'm having a pretty big problem which is that the progress bar on the HMI is determined by how much of the file image I have received on my external process, but the actual installation is not how much I receive on my external process but how much this external process has put in my target device.

Basically let's say I receive 3 chunks out of 4, my external has sent 3 ACK, because otherwise he wouldn't have received anything, and SWUpdate says : "OK you are at 75% on installment", but I haven't even started it. I deal with the installment on my external process, and I finish it, and my external process then sends the last ACK, and I'm now at 100%, having waited 5 minutes at 75%, I'm now suddenly at 100%.

I cannot find how to temper the progress process. I've seen everywhere, how to listen to it, but never how to take charge of it !

Is there any solution to do that ?

Best regards


Stefano Babic

unread,
Nov 29, 2022, 11:34:23 AM11/29/22
to Thomas Commandoux, swup...@googlegroups.com
Hi Thomas,
This is *exactly* the disadvantage of the remote handler. The remote
handler was introduced for use case where an external command is used
for update an artifact, and this code is maintained under a proprietary
(or not GPLv2 compliant, but mostly proprietary) license. To avoid to
adapt and link to SWUpdate as handler (best solution), the way is to
create a protocol (based on ZeroMQ) to just forward the artifact. As
disadvantage, SWUpdate has no idea what the handler is doing, that is
progress (your issue) cannot be set correctly, and output from the
external tool cannot be intercept by SWUpdate and put on SWUpdate's log
(further issue).

The technical solution is to write it as internal handler, let link in
to SWUpdate (=code becomes GPLv2), and then SWUpdate has knowledge and
can update the progress correctly - as it does with all internal handlers.

Best regards,
Stefano Babic

>
> Best regards
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Thomas Commandoux

unread,
Nov 29, 2022, 11:46:47 AM11/29/22
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

Yes, thank you for your reply,

I did manage to set log messages when there is a fatal error (I just append my error message to the NACK: "NACK:failed to..."), but it's true it's not as flexible as wanted.

Anyway, indeed what you said, was what was suggested to me, but my software is quite big, it was written in C++/Qt, which I have managed to switch to plain simple C++, which was the least requirement for us... But switching it to C... boy...

I'm really not as strong as that, I think, and again it's quite big, many thousands of lines...

But if I understand you correctly, that would be what I need to do ? Switch my code to plain C and implement it in a custom handler ?

Best regards

Stefano Babic

unread,
Nov 29, 2022, 11:58:08 AM11/29/22
to Thomas Commandoux, Stefano Babic, swup...@googlegroups.com
Hi Thomas,

On 29.11.22 17:46, Thomas Commandoux wrote:
> Hi Stefano,
>
> Yes, thank you for your reply,
>
> I did manage to set log messages when there is a fatal error (I just
> append my error message to the NACK: "NACK:failed to..."), but it's true
> it's not as flexible as wanted.

Right.

>
> Anyway, indeed what you said, was what was suggested to me, but my
> software is quite big, it was written in C++/Qt, which I have managed to
> switch to plain simple C++, which was the least requirement for us...
> But switching it to C... boy...
>

You can stil link your C++ code to C, if code could be released under GPLv2.

> I'm really not as strong as that, I think, and again it's quite big,
> many thousands of lines...

You have to publish your code because it is GPLv2, but if I will merge
it into SWUpdate or not, well, this is another story. It could be if
there are no drawbacks for other users (no forced switch to g++), and
libstdc++ is just linked when the handler is selected.

>
> But if I understand you correctly, that would be what I need to do ?
> Switch my code to plain C and implement it in a custom handler ?

Plain C or not, you should check yourself. It could still be C++. But
the way is to have a handler that uses the internal copyimage()
function. This can have callbacks, that is you can attach your custom
code to write / install your artifact, and the core of SWUpdate will
update the progress accordingly.

Best regards,
Stefano Babic

>
> Best regards
>
> Le mar. 29 nov. 2022 à 17:34, Stefano Babic <sba...@denx.de
> <mailto:sba...@denx.de>> a écrit :
> <mailto:swupdate%2Bunsu...@googlegroups.com>
> > <mailto:swupdate+u...@googlegroups.com
> <mailto:swupdate%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> =====================================================================
> DENX Software Engineering GmbH,        Managing Director: Erika Unter
> HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> sba...@denx.de <mailto:sba...@denx.de>
> =====================================================================

Thomas Commandoux

unread,
Nov 29, 2022, 12:31:50 PM11/29/22
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

I'm sorry but I'm quite fuzzy on GLPv2.

If I make a custom handler, I have to give it to you or to the public ?

Best regards
Thomas

Stefano Babic

unread,
Nov 29, 2022, 12:41:32 PM11/29/22
to Thomas Commandoux, Stefano Babic, swup...@googlegroups.com
Hi Thomas,

On 29.11.22 18:31, Thomas Commandoux wrote:
> Hi Stefano,
>
> I'm sorry but I'm quite fuzzy on GLPv2.
>
> If I make a custom handler, I have to give it to you or to the public ?

When your custom handler is linked into SWUpdate, it becomes GPLv2. You
have now to provide the sources for it, and any customer of yours can
ask for them.

This means, if the handler is not merged into mainline, you have to
publish the sources yourself (on any platform, own server, etc.) and you
have to maintain it - a new SWUpdate version could become incompatible
with your handler.

If the handler is merged into mainline, that means sources are posted on
this ML, they were reviewed and accepted, then you do not bother about
compatibility, and changes in core / whatever will do not break the
handler itself. Even licensing of your software (you must already
provide a link to swupdate, like you have to do for kernel and many
other FOSS project) is easier, because your device can just point to
SWUpdate sources, that's all.

So, apart that in both cases sources are public, it is different in
terms of maintanance of the product.

Best regards,
Stefano

>
> Best regards
> Thomas
>
> Le mar. 29 nov. 2022 à 17:58, Stefano Babic <sba...@denx.de
> > <mailto:sba...@denx.de <mailto:sba...@denx.de>>> a écrit :
> >     <mailto:swupdate%2Bunsu...@googlegroups.com
> <mailto:swupdate%252Buns...@googlegroups.com>>
> >      > <mailto:swupdate+u...@googlegroups.com
> <mailto:swupdate%2Bunsu...@googlegroups.com>
> >     <mailto:swupdate%2Bunsu...@googlegroups.com
> <mailto:swupdate%252Buns...@googlegroups.com>>>.
> >      > To view this discussion on the web visit
> >      >
> >
> https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com>> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>>.
> >
> >     --
> >
>  =====================================================================
> >     DENX Software Engineering GmbH,        Managing Director:
> Erika Unter
> >     HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell,
> Germany
> >     Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> > sba...@denx.de <mailto:sba...@denx.de> <mailto:sba...@denx.de
> <mailto:sba...@denx.de>>
> >
>  =====================================================================
> >
>
> --
> =====================================================================
> DENX Software Engineering GmbH,        Managing Director: Erika Unter
> HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> sba...@denx.de <mailto:sba...@denx.de>
> =====================================================================
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Thomas Commandoux

unread,
Nov 29, 2022, 12:48:31 PM11/29/22
to Stefano Babic, swup...@googlegroups.com
Hi Stefano,

Ok, thanks for you reply,

Best regards

Thomas Commandoux

unread,
Nov 29, 2022, 2:18:25 PM11/29/22
to Stefano Babic, swup...@googlegroups.com
I think I won't be able to publish my code, as I work in a sensitive field, releasing anything is not an option as I imagine you can understand ! 

I think I will stick to the remote handler ! In that case my own process is not under the GPLv2 right ?

Best regards
Thomas 

Stefano Babic

unread,
Nov 29, 2022, 2:40:48 PM11/29/22
to Thomas Commandoux, Stefano Babic, swup...@googlegroups.com


On 29.11.22 20:18, Thomas Commandoux wrote:
> I think I won't be able to publish my code, as I work in a sensitive
> field, releasing anything is not an option as I imagine you can
> understand !
>
> I think I will stick to the remote handler ! In that case my own process
> is not under the GPLv2 right ?

You're right.

Regards,
Stefano

>
> Best regards
> Thomas
>
> Le mar. 29 nov. 2022, 18:48, Thomas Commandoux <t.comm...@gmail.com
> <mailto:t.comm...@gmail.com>> a écrit :
>
> Hi Stefano,
>
> Ok, thanks for you reply,
>
> Best regards
>
> Le mar. 29 nov. 2022 à 18:41, Stefano Babic <sba...@denx.de
> >      >     <mailto:swupdate%2Bunsu...@googlegroups.com
> <mailto:swupdate%252Buns...@googlegroups.com>
> >     <mailto:swupdate%252Buns...@googlegroups.com
> <mailto:swupdate%25252Bun...@googlegroups.com>>>
> >     <mailto:swupdate%252Buns...@googlegroups.com
> <mailto:swupdate%25252Bun...@googlegroups.com>>>>.
> >      >      > To view this discussion on the web visit
> >      >      >
> >      >
> >
> https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com>> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com>>> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2eyWE9uJ3YP3dCr037r5vpc0ApR5FQbvXxO9ssxPwkOmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>>>.
> >      >
> >      >     --
> >      >
> >
>  =====================================================================
> >      >     DENX Software Engineering GmbH,        Managing
> Director:
> >     Erika Unter
> >      >     HRB 165235 Munich,   Office: Kirchenstr.5, 82194
> Groebenzell,
> >     Germany
> >      >     Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> >      > sba...@denx.de <mailto:sba...@denx.de>
> <mailto:sba...@denx.de <mailto:sba...@denx.de>>
> <mailto:sba...@denx.de <mailto:sba...@denx.de>
> >     <mailto:sba...@denx.de <mailto:sba...@denx.de>>>
> >      >
> >
>  =====================================================================
> >      >
> >
> >     --
> >
>  =====================================================================
> >     DENX Software Engineering GmbH,        Managing Director:
> Erika Unter
> >     HRB 165235 Munich,   Office: Kirchenstr.5, 82194
> Groebenzell, Germany
> >     Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> > sba...@denx.de <mailto:sba...@denx.de> <mailto:sba...@denx.de
> <mailto:sba...@denx.de>>
> >
>  =====================================================================
> >
> > --
> > You received this message because you are subscribed to the
> Google
> > Groups "swupdate" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> > an email to swupdate+u...@googlegroups.com
> <mailto:swupdate%2Bunsu...@googlegroups.com>
> > <mailto:swupdate+u...@googlegroups.com
> <mailto:swupdate%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com> <https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/CAK1tX2e3LqZv5Zuihu1Y54VgXWEXBcM2Fqy8h%2B%2BP-L5f9mPEDw%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> =====================================================================
> DENX Software Engineering GmbH,        Managing Director: Erika
> Unter
> HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell,
> Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
> sba...@denx.de <mailto:sba...@denx.de>
> =====================================================================
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/CAK1tX2cbua9Wf4JKjMo6uW5oaRN75oFAx26VtpUTNeh7D7JfLQ%40mail.gmail.com <https://groups.google.com/d/msgid/swupdate/CAK1tX2cbua9Wf4JKjMo6uW5oaRN75oFAx26VtpUTNeh7D7JfLQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages