FC components and AI (ideas?)

Post and discuss new components that you have created.
Steve-Matrix
Matrix Staff
Posts: 1724
http://meble-kuchenne.info.pl
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 247 times
Been thanked: 407 times

Re: FC components and AI (ideas?)

Post by Steve-Matrix »

External code can be included in Supplementary Code. See: https://www.flowcode.co.uk/wiki/index.p ... ntary_Code

Instead of adding the code directly to Flowcode, add statements into Supplementary Code such as the following to point it at external files:

Code: Select all

#include "C:\MyFolder\MyCode.h"

Code: Select all

#include "C:\MyFolder\MyCode.c"
You can then call any external C functions in your code by adding a C icon to your Flowcode macros.

Bijumon
Posts: 31
Joined: Fri Dec 30, 2022 11:44 am
Has thanked: 8 times
Been thanked: 12 times

Re: FC components and AI (ideas?)

Post by Bijumon »

Created an another component using AI for ESP32 that a single macro call enables direct email dispatch via SMTP (SSL/TLS) for simple notifications like sensor reading or system alerts. Ensure that ESP32 has an active WiFi connection before calling the macro.

Input Parameters
HOST_ADDRESS: SMTP server (e.g., "smtp.gmail.com").
PORT: SSL/TLS port number. (465 for Gmail)
USER_NAME: Full sender email address. (e.g., "yourname@gmail.com")
PASSWORD: 16-character Google App Password (e.g.,"xgdihlrtexusksta") not login password
DESTINATION: Recipient list (e.g., "a@mail.com, b@mail.com")
SUBJECT: The title of the email. (e.g., “Temperature Alert")
MSG_LINE 1 - 4 : Four lines for your data strings (128B per line)

Please note that I have specifically tested this component only on the ESP32 Wroom 32 module with Gmail account
Attachments
ESP_Mail_Client.fcfx
(14.91 KiB) Downloaded 4 times
ESP_Mail_Client.fcpx
(3.78 KiB) Downloaded 3 times

mnfisher
Valued Contributor
Posts: 1813
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 153 times
Been thanked: 855 times

Re: FC components and AI (ideas?)

Post by mnfisher »

That's very neat, thankyou.

One suggestion - if you have a string as a parameter to a macro - untick the 'make local copy' check box - this saves duplicating the string (which takes time and memory) - and you can then pass strings of any size.

So - you could have string msg_text[10000] as the parameter to the function - and this is just passed as a 32bit pointer (and a length FCsz_MSG_TEXT) - if the 'make local copy' is ticked it will copy the string to a local (10000 byte) buffer - but otherwise doesn't.

Martin

chipfryer27
Valued Contributor
Posts: 1868
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 408 times
Been thanked: 632 times

Re: FC components and AI (ideas?)

Post by chipfryer27 »

Hi

This sounds a very cool component. Thank you for creating and sharing.

I hope to test it for myself soom.

Regards

Post Reply