Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current application tuning for IOT2050-SM #510

Merged
merged 7 commits into from
Jan 7, 2024
Merged

Conversation

BaochengSu
Copy link
Collaborator

This is the second part of the IOT2050-SM series, targeting the tuning of. the current existing applications.

@BaochengSu BaochengSu force-pushed the su/iot2050-sm-app-tune branch 3 times, most recently from daf492c to 7b941cd Compare December 28, 2023 08:35
Date: Thu, 28 Dec 2023 10:19:31 +0800
Subject: [PATCH] mraa-gpio: dout: Add D14-D19 for IOT2050

This was lost during last upstreaming.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we have multiple upstreamings, or why "last"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, and will reword.

}
+
+ if (RED.settings.mraaGpioDoutBoardType === "IOT2050") {
+ for (i of [...Array(20).keys()].slice(14)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark on for as above. I think this is very readable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to update?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently changed in a later patch - please do that directly here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a mistake when finding the 1st patch, fixed.

+
+ if (RED.settings.mraaGpioDoutBoardType === "IOT2050") {
+ for (i of [...Array(20).keys()].slice(14)) {
+ // from D14 to D19
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And that comment would be kind of obsolete then as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Date: Thu, 28 Dec 2023 11:00:06 +0800
Subject: [PATCH] mraa-gpio: Fix led label in the flow editor

The default lable for led node is 'led', which is almost useless.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

+ for (i of [...Array(20).keys()].slice(14)) {
+ // from D14 to D19
+ $('#node-input-pin').append($("<option></option>").attr("value", i).text("D" + i));
+ }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you make the loop boundaries model-dependent, you can save one loop instance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

@BaochengSu BaochengSu force-pushed the su/iot2050-sm-app-tune branch from 7b941cd to 0e932de Compare January 2, 2024 15:00
@BaochengSu BaochengSu requested a review from jan-kiszka January 2, 2024 15:49
@BaochengSu BaochengSu force-pushed the su/iot2050-sm-app-tune branch 2 times, most recently from 48c2f22 to 640e892 Compare January 4, 2024 05:43
Subject: [PATCH] iot2050: Add support for the new IOT2050-SM variant

IOT2050-SM board was added into IOT2050 series, in contrast to existing
variants, the IOT2050-SM board comes without a Arduino interfaces.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"IOT2050-SM board was added to IOT2050 series. In contrast to existing
variants, the IOT2050-SM board comes without an Arduino interface."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Subject: [PATCH] mraa-gpio: Fix led label in the flow editor

The default label for led node is 'led', which is almost useless.
Change it to pattern "USER<n> LED <color>".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, this name scheme is only valid because the IOT2050 is the only user of the led module.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added into commit message

+ if (this.pin === "14" && RED.settings.mraaGpioDoutBoardType !== "IOT2050") {
+ return "LED";
+ } else {
+ return this.name||"D"+this.pin;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: add spaces around the ||.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

inherit npm
inherit node-red-module

DESCRIPTION = "A set of random nodes for Node-RED"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that the new commit message is more telling than no message...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module is required to be pre-installed by one customer, actually we don't have too much knowledge about that, we only know they want to use it to generate random numbers in their flow, and don't want to install this node for every piece of their devices.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, but this here is an example image, not a final product image. The latter will need a layer on top anyway to perform the require customizations and hardenings.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, I'm not against adding it, specifically as it comes from an already used source (https://github.com/node-red/node-red-nodes), just clarify the commit message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message refined

install -v -d ${D}/usr/sbin/
install -v -m 755 ${WORKDIR}/iot2050-firmware-update ${D}/usr/sbin/
ln -sf ../lib/iot2050/fwu/iot2050-firmware-update ${D}/usr/sbin/iot2050-firmware-update
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that installation into /usr/lib/iot2050/fwu/ so that we need to link it here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have update.conf.json.tmpl installed together, which is not very good to install into sbin. So the same rules are applied with eio manager and some others, which is installed to /usr/lib.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, conf files should not go into sbin. Maybe they are better off in /usr/share/iot2050/fwu?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, /usr/share is more reasonable.

Copy link
Collaborator

@jan-kiszka jan-kiszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost fine now, just minor remarks left.

@huaqianli huaqianli force-pushed the su/iot2050-sm-app-tune branch from 640e892 to 9594c04 Compare January 5, 2024 02:14
huaqianli and others added 2 commits January 5, 2024 11:27
For mraa, the main difference between the new variant and the rest
is the tailoring down of the Arduino interface.

Signed-off-by: Li Hua Qian <[email protected]>
The Arduino interfaces are tailored down on the new variant, so for the
node-red, only the USER button and the USERn LEDs are kept, all other
nodes are removed from the pallete.

Meanwhile some bug fixes are introduced as well, notably:

-. din: Make D14-D19 IOT2050 only, fix some ui errors.
-. dout: Add D14-D19 for IOT2050
-. led: Make it IOT2050 only, fix ui label.

Also the baseline is bumped up to the latest upstream version 0.4.0

Signed-off-by: chao zeng <[email protected]>
Signed-off-by: Baocheng Su <[email protected]>
This node adds functionality to generate random numbers in flows. It was
requested by a user to be part of the image, and it is easy to add
because we already carry the underlying source module

Signed-off-by: Li Hua Qian <[email protected]>
Signed-off-by: Baocheng Su <[email protected]>
Arduino IOs and GPIOs are not needed on IOT2050 SM Variant.

Signed-off-by: Li Hua Qian <[email protected]>
Firmware update package is good to generate within building time,
so add an image type to make the FWU package.

Signed-off-by: Li Hua Qian <[email protected]>
do_install() {
install -v -d ${D}/usr/share/iot2050/fwu
install -v -m 644 ${WORKDIR}/update.conf.json ${D}/usr/share/iot2050/fwu/
install -v -m 755 ${WORKDIR}/iot2050-firmware-update ${D}/usr/share/iot2050/fwu/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to have to conf files in usr/share, not the scripts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, plz check

huaqianli and others added 2 commits January 5, 2024 17:51
At the beginning, an additional firmware was intended to be integrated
into the upgrade tarball package. And the original code was kind of
process-oriented code, many common features are not extracted, many
duplicate codes exist, and the code coupling is very high, which is very
difficult to expand and maintain. It was necessary to refactor the code for
better maintainability and extension.

Anyway, in the end the additional firmware is planed to integrated into its
associated subsystem for decoupling. Refactored code is preserved for
possible  future maintainability and extension. For example, if new firmware
needs to be added in the future, whether it is the existing firmware upgrade
method or other upgrade methods, the previous upgrade logic or upgrade
method can be more easily introduced and reused.

This only changes the internal structure, no notable functional/logic
changes, maybe some minor changes, but that's trivial.

Signed-off-by: Li Hua Qian <[email protected]>
Per observation, CP2102N reset takes more than 30 ms to finish, increase
the assertion to 1 second to improve the stability.

Signed-off-by: Baocheng Su <[email protected]>
@BaochengSu BaochengSu force-pushed the su/iot2050-sm-app-tune branch from 5c0fac5 to 081365b Compare January 5, 2024 09:52
@BaochengSu BaochengSu merged commit 7cb62dd into master Jan 7, 2024
5 checks passed
@huaqianli huaqianli deleted the su/iot2050-sm-app-tune branch July 9, 2024 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants