-
Notifications
You must be signed in to change notification settings - Fork 77
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
Conversation
a579f01
to
c860cdc
Compare
recipes-app/mraa/files/0004-iot2050-Add-support-for-the-new-IOT2050-SM-variant.patch
Outdated
Show resolved
Hide resolved
recipes-app/mraa/files/0004-iot2050-Add-support-for-the-new-IOT2050-SM-variant.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0001-Dynamic-add-user-button-label.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-Adapt-new-IOT2050-SM.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-Adapt-new-IOT2050-SM.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-Adapt-new-IOT2050-SM.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-Adapt-new-IOT2050-SM.patch
Outdated
Show resolved
Hide resolved
daf492c
to
7b941cd
Compare
recipes-app/node-red-gpio/files/0003-mraa-gpio-din-Make-D14-D19-IOT2050-only.patch
Outdated
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-mraa-gpio-Pass-settings-from-js-to-html.patch
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0002-mraa-gpio-Pass-settings-from-js-to-html.patch
Show resolved
Hide resolved
recipes-app/node-red-gpio/files/0004-mraa-gpio-din-Fix-the-for-attribute-of-lables.patch
Show resolved
Hide resolved
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. |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to update?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label
There was a problem hiding this comment.
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)); | ||
+ } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
recipes-app/node-red-gpio/files/0008-mraa-gpio-Add-support-for-IOT2050-SM.patch
Show resolved
Hide resolved
7b941cd
to
0e932de
Compare
48c2f22
to
640e892
Compare
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. |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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>". |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 ||
.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
640e892
to
9594c04
Compare
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]>
9594c04
to
5c0fac5
Compare
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/ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, plz check
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]>
5c0fac5
to
081365b
Compare
This is the second part of the IOT2050-SM series, targeting the tuning of. the current existing applications.