├── .github └── workflows │ ├── stale.yml │ └── sync_issues.yml ├── LICENSE ├── README.md ├── docker-compose.yaml ├── docker-ubuntu.sh └── node-red-config ├── package.json ├── seeed.webp └── settings.js /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: 'Close stale issues and PRs' 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 4 * * *' 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | 16 | - name: Checkout script repository 17 | uses: actions/checkout@v4 18 | with: 19 | repository: Seeed-Studio/sync-github-all-issues 20 | path: ci 21 | 22 | - name: Run script 23 | run: ./ci/tools/stale.sh 24 | env: 25 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | -------------------------------------------------------------------------------- /.github/workflows/sync_issues.yml: -------------------------------------------------------------------------------- 1 | name: Automate Issue Management 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - edited 8 | - assigned 9 | - unassigned 10 | - labeled 11 | - unlabeled 12 | - reopened 13 | 14 | jobs: 15 | add_issue_to_project: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Add issue to GitHub Project 19 | uses: actions/add-to-project@v1.0.2 20 | with: 21 | project-url: https://github.com/orgs/Seeed-Studio/projects/17 22 | github-token: ${{ secrets.ISSUE_ASSEMBLE }} 23 | labeled: bug 24 | label-operator: NOT -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Seeed Studio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # No-Code Edge AI Vision with Node-RED 2 | 3 | Now you can get started with AI vision at the edge in just **THREE STEPS** with no coding experience at all! 4 | 5 | ## Prerequisites 6 | 7 | - NVIDIA Jetson device 8 | 9 | ## Getting Started 10 | 11 | **Note:** For this guide, we have used a [reComputer J1010 with Jetson Nano](https://www.seeedstudio.com/Jetson-10-1-A0-p-5336.html) running [NVIDIA JetPack 4.6.1](https://developer.nvidia.com/jetpack-sdk-461) 12 | 13 | ### Step 1 - Install 14 | 15 | Clone this GitHub repo and run the installer 16 | 17 | ```sh 18 | git clone https://github.com/Seeed-Studio/node-red-contrib-ml 19 | cd node-red-contrib-ml && sudo ./docker-ubuntu.sh 20 | ``` 21 | 22 | ### Step 2 - Configure 23 | 24 | Open a web browser, type `jetson_device_ip_address:1880` on the search box, drag and drop blocks and connect them as follows 25 | 26 |

27 | 28 | ### Step 3 - Deploy 29 | 30 | Press **DEPLOY** to see it in action! 31 | 32 | ## Application 1 33 | 34 | https://user-images.githubusercontent.com/20147381/170643573-2a2d70c2-7e0b-430b-b66c-ee56ade3116f.mp4 35 | 36 | ## Application 2 37 | 38 | https://user-images.githubusercontent.com/20147381/172834524-256d3f4b-3721-4ca8-8c64-b847988c04ac.mp4 39 | 40 | ## Learn more 41 | 42 | For a more detailed step-by-step guide on using Node-RED for Edge AI Vision, please pay attention to this software. 43 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.9" # optional since v1.27.0 2 | services: 3 | node-red: 4 | image: nodered/node-red:3.0.1 5 | restart: always 6 | network_mode: "host" 7 | volumes: 8 | - "$HOME/node-red:/data" 9 | user: "0" 10 | ports: 11 | - "1880:1880" 12 | dataloader: 13 | image: baozhu/node-red-dataloader:v1.2 14 | restart: always 15 | runtime: nvidia 16 | network_mode: "host" 17 | privileged: true 18 | devices: 19 | - "/dev:/dev" 20 | - "/var/run/udev:/var/run/udev" 21 | ports: 22 | - "5550:5550" 23 | detection: 24 | image: baozhu/node-red-detection:v1.2 25 | restart: always 26 | runtime: nvidia 27 | network_mode: "host" 28 | ports: 29 | - "5560:5560" 30 | 31 | -------------------------------------------------------------------------------- /docker-ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # High Intensity 4 | IBlack='\033[0;90m' # Black 5 | IRed='\033[0;91m' # Red 6 | IGreen='\033[0;92m' # Green 7 | IYellow='\033[0;93m' # Yellow 8 | IBlue='\033[0;94m' # Blue 9 | IPurple='\033[0;95m' # Purple 10 | ICyan='\033[0;96m' # Cyan 11 | IWhite='\033[0;97m' # White 12 | 13 | if ! [ $(id -u) = 0 ] ; then 14 | echo "$0 must be run as sudo user or root" 15 | exit 1 16 | fi 17 | 18 | storage=$(df | awk '{ print $4 } ' | awk 'NR==2{print}' ) 19 | #if storage > 3.8G 20 | if [ $storage -gt 3800000 ] ; then 21 | echo -e "${IGreen}Your storage space left is $(($storage /1000000))GB, you can install this application." 22 | else 23 | echo -e "${IRed}Sorry, you don't have enough storage space to install this application. You need about 3.8GB of storage space." 24 | echo -e "${IYellow}However, you can regain about 3.8GB of storage space by performing the following:" 25 | echo -e "${IYellow}-Remove unnecessary packages (~100MB)" 26 | echo -e "${IYellow}-Clean up apt cache (~1.6GB)" 27 | echo -e "${IYellow}-Remove thunderbird, libreoffice and related packages (~400MB)" 28 | echo -e "${IYellow}-Remove cuda, cudnn, tensorrt, visionworks and deepstream samples (~800MB)" 29 | echo -e "${IYellow}-Remove local repos for cuda, visionworks, linux-headers (~100MB)" 30 | echo -e "${IYellow}-Remove GUI (~400MB)" 31 | echo -e "${IYellow}-Remove Static libraries (~400MB)" 32 | echo -e "${IRed}So, please agree to uninstall the above. Press [y/n]" 33 | read yn 34 | if [ $yn = "y" ] ; then 35 | echo "${IGreen}starting to remove the above-mentioned" 36 | # Remove unnecessary packages, clean apt cache and remove thunderbird, libreoffice 37 | apt update 38 | apt autoremove -y 39 | apt clean 40 | apt remove thunderbird libreoffice-* -y 41 | 42 | # Remove samples 43 | rm -rf /usr/local/cuda/samples \ 44 | /usr/src/cudnn_samples_* \ 45 | /usr/src/tensorrt/data \ 46 | /usr/src/tensorrt/samples \ 47 | /usr/share/visionworks* ~/VisionWorks-SFM*Samples \ 48 | /opt/nvidia/deepstream/deepstream*/samples 49 | 50 | # Remove local repos 51 | apt purge cuda-repo-l4t-*local* libvisionworks-*repo -y 52 | rm /etc/apt/sources.list.d/cuda*local* /etc/apt/sources.list.d/visionworks*repo* 53 | rm -rf /usr/src/linux-headers-* 54 | 55 | # Remove GUI 56 | apt-get purge gnome-shell ubuntu-wallpapers-bionic light-themes chromium-browser* libvisionworks libvisionworks-sfm-dev -y 57 | apt-get autoremove -y 58 | apt clean -y 59 | 60 | # Remove Static libraries 61 | rm -rf /usr/local/cuda/targets/aarch64-linux/lib/*.a \ 62 | /usr/lib/aarch64-linux-gnu/libcudnn*.a \ 63 | /usr/lib/aarch64-linux-gnu/libnvcaffe_parser*.a \ 64 | /usr/lib/aarch64-linux-gnu/libnvinfer*.a \ 65 | /usr/lib/aarch64-linux-gnu/libnvonnxparser*.a \ 66 | /usr/lib/aarch64-linux-gnu/libnvparsers*.a 67 | 68 | # Remove additional 100MB 69 | apt autoremove -y 70 | apt clean 71 | else 72 | exit 1 73 | fi 74 | fi 75 | 76 | apt update 77 | 78 | if ! [ -x "$(command -v curl)" ]; then 79 | apt install curl 80 | fi 81 | 82 | if ! [ -x "$(command -v docker)" ]; then 83 | apt install docker 84 | fi 85 | 86 | if ! [ -x "$(command -v nvidia-docker)" ]; then 87 | apt install nvidia-docker2 88 | fi 89 | 90 | if ! [ -x "$(command -v docker-compose)" ]; then 91 | curl -SL https://files.seeedstudio.com/wiki/reComputer/compose.tar.bz2 -o /tmp/compose.tar.bz2 92 | tar xvf /tmp/compose.tar.bz2 -C /usr/local/bin 93 | chmod +x /usr/local/bin/docker-compose 94 | fi 95 | 96 | #node-red setting 97 | mkdir -p $HOME/node-red 98 | cp node-red-config/* $HOME/node-red 99 | 100 | echo -e "${IGreen}start all of docker" 101 | 102 | #deamon 103 | docker-compose --file docker-compose.yaml up -d 104 | 105 | #install node-red theme package 106 | docker exec node-red-contrib-ml-node-red-1 bash -c "cd /data && npm install" 107 | 108 | # restart node-red-contrib-ml-node-red-1 container for the above changes to take into effect 109 | docker restart node-red-contrib-ml-node-red-1 110 | 111 | #no deamon 112 | #docker-compose --file docker/docker-compose.yaml up 113 | echo -e "${IYellow}#########################################################################" 114 | 115 | #sudo docker login 116 | #sudo docker tag dev:dataloader-build baozhu/node-red-dataloader:v1.0 117 | #sudo docker tag dev:detection-build baozhu/node-red-detection:v1.0 118 | #sudo docker push baozhu/node-red-detection:v1.0 119 | #sudo docker push baozhu/node-red-dataloader:v1.0 120 | -------------------------------------------------------------------------------- /node-red-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-red-project", 3 | "description": "A Node-RED Project", 4 | "version": "0.0.1", 5 | "private": true, 6 | "dependencies": { 7 | "@node-red-contrib-themes/theme-collection": "^2.2.3", 8 | "node-red-seeed-recomputer": "git+https://github.com/Seeed-Studio/node-red-seeed-recomputer.git" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /node-red-config/seeed.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seeed-Studio/node-red-contrib-ml/69d5b535b687c3ccc121d30c54e748798c07e42b/node-red-config/seeed.webp -------------------------------------------------------------------------------- /node-red-config/settings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the default settings file provided by Node-RED. 3 | * 4 | * It can contain any valid JavaScript code that will get run when Node-RED 5 | * is started. 6 | * 7 | * Lines that start with // are commented out. 8 | * Each entry should be separated from the entries above and below by a comma ',' 9 | * 10 | * For more information about individual settings, refer to the documentation: 11 | * https://nodered.org/docs/user-guide/runtime/configuration 12 | * 13 | * The settings are split into the following sections: 14 | * - Flow File and User Directory Settings 15 | * - Security 16 | * - Server Settings 17 | * - Runtime Settings 18 | * - Editor Settings 19 | * - Node Settings 20 | * 21 | **/ 22 | 23 | module.exports = { 24 | 25 | /******************************************************************************* 26 | * Flow File and User Directory Settings 27 | * - flowFile 28 | * - credentialSecret 29 | * - flowFilePretty 30 | * - userDir 31 | * - nodesDir 32 | ******************************************************************************/ 33 | 34 | /** The file containing the flows. If not set, defaults to flows_.json **/ 35 | flowFile: 'flows.json', 36 | 37 | /** By default, credentials are encrypted in storage using a generated key. To 38 | * specify your own secret, set the following property. 39 | * If you want to disable encryption of credentials, set this property to false. 40 | * Note: once you set this property, do not change it - doing so will prevent 41 | * node-red from being able to decrypt your existing credentials and they will be 42 | * lost. 43 | */ 44 | //credentialSecret: "a-secret-key", 45 | 46 | /** By default, the flow JSON will be formatted over multiple lines making 47 | * it easier to compare changes when using version control. 48 | * To disable pretty-printing of the JSON set the following property to false. 49 | */ 50 | flowFilePretty: true, 51 | 52 | /** By default, all user data is stored in a directory called `.node-red` under 53 | * the user's home directory. To use a different location, the following 54 | * property can be used 55 | */ 56 | //userDir: '/home/nol/.node-red/', 57 | 58 | /** Node-RED scans the `nodes` directory in the userDir to find local node files. 59 | * The following property can be used to specify an additional directory to scan. 60 | */ 61 | //nodesDir: '/home/nol/.node-red/nodes', 62 | 63 | /******************************************************************************* 64 | * Security 65 | * - adminAuth 66 | * - https 67 | * - httpsRefreshInterval 68 | * - requireHttps 69 | * - httpNodeAuth 70 | * - httpStaticAuth 71 | ******************************************************************************/ 72 | 73 | /** To password protect the Node-RED editor and admin API, the following 74 | * property can be used. See http://nodered.org/docs/security.html for details. 75 | */ 76 | //adminAuth: { 77 | // type: "credentials", 78 | // users: [{ 79 | // username: "admin", 80 | // password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.", 81 | // permissions: "*" 82 | // }] 83 | //}, 84 | 85 | /** The following property can be used to enable HTTPS 86 | * This property can be either an object, containing both a (private) key 87 | * and a (public) certificate, or a function that returns such an object. 88 | * See http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener 89 | * for details of its contents. 90 | */ 91 | 92 | /** Option 1: static object */ 93 | //https: { 94 | // key: require("fs").readFileSync('privkey.pem'), 95 | // cert: require("fs").readFileSync('cert.pem') 96 | //}, 97 | 98 | /** Option 2: function that returns the HTTP configuration object */ 99 | // https: function() { 100 | // // This function should return the options object, or a Promise 101 | // // that resolves to the options object 102 | // return { 103 | // key: require("fs").readFileSync('privkey.pem'), 104 | // cert: require("fs").readFileSync('cert.pem') 105 | // } 106 | // }, 107 | 108 | /** If the `https` setting is a function, the following setting can be used 109 | * to set how often, in hours, the function will be called. That can be used 110 | * to refresh any certificates. 111 | */ 112 | //httpsRefreshInterval : 12, 113 | 114 | /** The following property can be used to cause insecure HTTP connections to 115 | * be redirected to HTTPS. 116 | */ 117 | //requireHttps: true, 118 | 119 | /** To password protect the node-defined HTTP endpoints (httpNodeRoot), 120 | * including node-red-dashboard, or the static content (httpStatic), the 121 | * following properties can be used. 122 | * The `pass` field is a bcrypt hash of the password. 123 | * See http://nodered.org/docs/security.html#generating-the-password-hash 124 | */ 125 | //httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."}, 126 | //httpStaticAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."}, 127 | 128 | /******************************************************************************* 129 | * Server Settings 130 | * - uiPort 131 | * - uiHost 132 | * - apiMaxLength 133 | * - httpServerOptions 134 | * - httpAdminRoot 135 | * - httpAdminMiddleware 136 | * - httpNodeRoot 137 | * - httpNodeCors 138 | * - httpNodeMiddleware 139 | * - httpStatic 140 | ******************************************************************************/ 141 | 142 | /** the tcp port that the Node-RED web server is listening on */ 143 | uiPort: process.env.PORT || 1880, 144 | 145 | /** By default, the Node-RED UI accepts connections on all IPv4 interfaces. 146 | * To listen on all IPv6 addresses, set uiHost to "::", 147 | * The following property can be used to listen on a specific interface. For 148 | * example, the following would only allow connections from the local machine. 149 | */ 150 | //uiHost: "127.0.0.1", 151 | 152 | /** The maximum size of HTTP request that will be accepted by the runtime api. 153 | * Default: 5mb 154 | */ 155 | //apiMaxLength: '5mb', 156 | 157 | /** The following property can be used to pass custom options to the Express.js 158 | * server used by Node-RED. For a full list of available options, refer 159 | * to http://expressjs.com/en/api.html#app.settings.table 160 | */ 161 | //httpServerOptions: { }, 162 | 163 | /** By default, the Node-RED UI is available at http://localhost:1880/ 164 | * The following property can be used to specify a different root path. 165 | * If set to false, this is disabled. 166 | */ 167 | //httpAdminRoot: '/admin', 168 | 169 | /** The following property can be used to add a custom middleware function 170 | * in front of all admin http routes. For example, to set custom http 171 | * headers. It can be a single function or an array of middleware functions. 172 | */ 173 | // httpAdminMiddleware: function(req,res,next) { 174 | // // Set the X-Frame-Options header to limit where the editor 175 | // // can be embedded 176 | // //res.set('X-Frame-Options', 'sameorigin'); 177 | // next(); 178 | // }, 179 | 180 | 181 | /** Some nodes, such as HTTP In, can be used to listen for incoming http requests. 182 | * By default, these are served relative to '/'. The following property 183 | * can be used to specifiy a different root path. If set to false, this is 184 | * disabled. 185 | */ 186 | //httpNodeRoot: '/red-nodes', 187 | 188 | /** The following property can be used to configure cross-origin resource sharing 189 | * in the HTTP nodes. 190 | * See https://github.com/troygoode/node-cors#configuration-options for 191 | * details on its contents. The following is a basic permissive set of options: 192 | */ 193 | //httpNodeCors: { 194 | // origin: "*", 195 | // methods: "GET,PUT,POST,DELETE" 196 | //}, 197 | 198 | /** If you need to set an http proxy please set an environment variable 199 | * called http_proxy (or HTTP_PROXY) outside of Node-RED in the operating system. 200 | * For example - http_proxy=http://myproxy.com:8080 201 | * (Setting it here will have no effect) 202 | * You may also specify no_proxy (or NO_PROXY) to supply a comma separated 203 | * list of domains to not proxy, eg - no_proxy=.acme.co,.acme.co.uk 204 | */ 205 | 206 | /** The following property can be used to add a custom middleware function 207 | * in front of all http in nodes. This allows custom authentication to be 208 | * applied to all http in nodes, or any other sort of common request processing. 209 | * It can be a single function or an array of middleware functions. 210 | */ 211 | //httpNodeMiddleware: function(req,res,next) { 212 | // // Handle/reject the request, or pass it on to the http in node by calling next(); 213 | // // Optionally skip our rawBodyParser by setting this to true; 214 | // //req.skipRawBodyParser = true; 215 | // next(); 216 | //}, 217 | 218 | /** When httpAdminRoot is used to move the UI to a different root path, the 219 | * following property can be used to identify a directory of static content 220 | * that should be served at http://localhost:1880/. 221 | */ 222 | //httpStatic: '/home/nol/node-red-static/', 223 | 224 | /******************************************************************************* 225 | * Runtime Settings 226 | * - lang 227 | * - logging 228 | * - contextStorage 229 | * - exportGlobalContextKeys 230 | * - externalModules 231 | ******************************************************************************/ 232 | 233 | /** Uncomment the following to run node-red in your preferred language. 234 | * Available languages include: en-US (default), ja, de, zh-CN, zh-TW, ru, ko 235 | * Some languages are more complete than others. 236 | */ 237 | // lang: "de", 238 | 239 | /** Configure the logging output */ 240 | logging: { 241 | /** Only console logging is currently supported */ 242 | console: { 243 | /** Level of logging to be recorded. Options are: 244 | * fatal - only those errors which make the application unusable should be recorded 245 | * error - record errors which are deemed fatal for a particular request + fatal errors 246 | * warn - record problems which are non fatal + errors + fatal errors 247 | * info - record information about the general running of the application + warn + error + fatal errors 248 | * debug - record information which is more verbose than info + info + warn + error + fatal errors 249 | * trace - record very detailed logging + debug + info + warn + error + fatal errors 250 | * off - turn off all logging (doesn't affect metrics or audit) 251 | */ 252 | level: "info", 253 | /** Whether or not to include metric events in the log output */ 254 | metrics: false, 255 | /** Whether or not to include audit events in the log output */ 256 | audit: false 257 | } 258 | }, 259 | 260 | /** Context Storage 261 | * The following property can be used to enable context storage. The configuration 262 | * provided here will enable file-based context that flushes to disk every 30 seconds. 263 | * Refer to the documentation for further options: https://nodered.org/docs/api/context/ 264 | */ 265 | //contextStorage: { 266 | // default: { 267 | // module:"localfilesystem" 268 | // }, 269 | //}, 270 | 271 | /** `global.keys()` returns a list of all properties set in global context. 272 | * This allows them to be displayed in the Context Sidebar within the editor. 273 | * In some circumstances it is not desirable to expose them to the editor. The 274 | * following property can be used to hide any property set in `functionGlobalContext` 275 | * from being list by `global.keys()`. 276 | * By default, the property is set to false to avoid accidental exposure of 277 | * their values. Setting this to true will cause the keys to be listed. 278 | */ 279 | exportGlobalContextKeys: false, 280 | 281 | /** Configure how the runtime will handle external npm modules. 282 | * This covers: 283 | * - whether the editor will allow new node modules to be installed 284 | * - whether nodes, such as the Function node are allowed to have their 285 | * own dynamically configured dependencies. 286 | * The allow/denyList options can be used to limit what modules the runtime 287 | * will install/load. It can use '*' as a wildcard that matches anything. 288 | */ 289 | externalModules: { 290 | // autoInstall: false, /** Whether the runtime will attempt to automatically install missing modules */ 291 | // autoInstallRetry: 30, /** Interval, in seconds, between reinstall attempts */ 292 | // palette: { /** Configuration for the Palette Manager */ 293 | // allowInstall: true, /** Enable the Palette Manager in the editor */ 294 | // allowUpdate: true, /** Allow modules to be updated in the Palette Manager */ 295 | // allowUpload: true, /** Allow module tgz files to be uploaded and installed */ 296 | // allowList: ['*'], 297 | // denyList: [], 298 | // allowUpdateList: ['*'], 299 | // denyUpdateList: [] 300 | // }, 301 | // modules: { /** Configuration for node-specified modules */ 302 | // allowInstall: true, 303 | // allowList: [], 304 | // denyList: [] 305 | // } 306 | }, 307 | 308 | 309 | /******************************************************************************* 310 | * Editor Settings 311 | * - disableEditor 312 | * - editorTheme 313 | ******************************************************************************/ 314 | 315 | /** The following property can be used to disable the editor. The admin API 316 | * is not affected by this option. To disable both the editor and the admin 317 | * API, use either the httpRoot or httpAdminRoot properties 318 | */ 319 | //disableEditor: false, 320 | 321 | /** Customising the editor 322 | * See https://nodered.org/docs/user-guide/runtime/configuration#editor-themes 323 | * for all available options. 324 | */ 325 | editorTheme: { 326 | /** The following property can be used to set a custom theme for the editor. 327 | * See https://github.com/node-red-contrib-themes/theme-collection for 328 | * a collection of themes to chose from. 329 | */ 330 | theme: "midnight-red", 331 | 332 | /** To disable the 'Welcome to Node-RED' tour that is displayed the first 333 | * time you access the editor for each release of Node-RED, set this to false 334 | */ 335 | //tours: false, 336 | page: { 337 | title: "reComputer Flow Editor" 338 | // favicon: "/absolute/path/to/theme/icon", 339 | // css: "/absolute/path/to/custom/css/file", 340 | // scripts: [ "/absolute/path/to/custom/script/file", "/another/script/file"] 341 | }, 342 | header: { 343 | title: " Flow Editor
", 344 | image: "/data/seeed.webp", // or null to remove image 345 | // url: "http://nodered.org" // optional url to make the header text/image a link to this url 346 | }, 347 | 348 | palette: { 349 | /** The following property can be used to order the categories in the editor 350 | * palette. If a node's category is not in the list, the category will get 351 | * added to the end of the palette. 352 | * If not set, the following default order is used: 353 | */ 354 | //categories: ['subflows', 'common', 'function', 'network', 'sequence', 'parser', 'storage'], 355 | categories: ['seeed recomputer'], 356 | }, 357 | 358 | projects: { 359 | /** To enable the Projects feature, set this value to true */ 360 | enabled: false, 361 | workflow: { 362 | /** Set the default projects workflow mode. 363 | * - manual - you must manually commit changes 364 | * - auto - changes are automatically committed 365 | * This can be overridden per-user from the 'Git config' 366 | * section of 'User Settings' within the editor 367 | */ 368 | mode: "manual" 369 | } 370 | }, 371 | 372 | codeEditor: { 373 | /** Select the text editor component used by the editor. 374 | * Defaults to "ace", but can be set to "ace" or "monaco" 375 | */ 376 | lib: "ace", 377 | options: { 378 | /** The follow options only apply if the editor is set to "monaco" 379 | * 380 | * theme - must match the file name of a theme in 381 | * packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme 382 | * e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme" 383 | */ 384 | theme: "vs", 385 | /** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc. 386 | * for the full list, see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandaloneeditorconstructionoptions.html 387 | */ 388 | //fontSize: 14, 389 | //fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace", 390 | //fontLigatures: true, 391 | } 392 | } 393 | }, 394 | 395 | /******************************************************************************* 396 | * Node Settings 397 | * - fileWorkingDirectory 398 | * - functionGlobalContext 399 | * - functionExternalModules 400 | * - nodeMessageBufferMaxLength 401 | * - ui (for use with Node-RED Dashboard) 402 | * - debugUseColors 403 | * - debugMaxLength 404 | * - execMaxBufferSize 405 | * - httpRequestTimeout 406 | * - mqttReconnectTime 407 | * - serialReconnectTime 408 | * - socketReconnectTime 409 | * - socketTimeout 410 | * - tcpMsgQueueSize 411 | * - inboundWebSocketTimeout 412 | * - tlsConfigDisableLocalFiles 413 | * - webSocketNodeVerifyClient 414 | ******************************************************************************/ 415 | 416 | /** The working directory to handle relative file paths from within the File nodes 417 | * defaults to the working directory of the Node-RED process. 418 | */ 419 | //fileWorkingDirectory: "", 420 | 421 | /** Allow the Function node to load additional npm modules directly */ 422 | functionExternalModules: true, 423 | 424 | /** The following property can be used to set predefined values in Global Context. 425 | * This allows extra node modules to be made available with in Function node. 426 | * For example, the following: 427 | * functionGlobalContext: { os:require('os') } 428 | * will allow the `os` module to be accessed in a Function node using: 429 | * global.get("os") 430 | */ 431 | functionGlobalContext: { 432 | // os:require('os'), 433 | }, 434 | 435 | /** The maximum number of messages nodes will buffer internally as part of their 436 | * operation. This applies across a range of nodes that operate on message sequences. 437 | * defaults to no limit. A value of 0 also means no limit is applied. 438 | */ 439 | //nodeMessageBufferMaxLength: 0, 440 | 441 | /** If you installed the optional node-red-dashboard you can set it's path 442 | * relative to httpNodeRoot 443 | * Other optional properties include 444 | * readOnly:{boolean}, 445 | * middleware:{function or array}, (req,res,next) - http middleware 446 | * ioMiddleware:{function or array}, (socket,next) - socket.io middleware 447 | */ 448 | //ui: { path: "ui" }, 449 | 450 | /** Colourise the console output of the debug node */ 451 | //debugUseColors: true, 452 | 453 | /** The maximum length, in characters, of any message sent to the debug sidebar tab */ 454 | debugMaxLength: 1000, 455 | 456 | /** Maximum buffer size for the exec node. Defaults to 10Mb */ 457 | //execMaxBufferSize: 10000000, 458 | 459 | /** Timeout in milliseconds for HTTP request connections. Defaults to 120s */ 460 | //httpRequestTimeout: 120000, 461 | 462 | /** Retry time in milliseconds for MQTT connections */ 463 | mqttReconnectTime: 15000, 464 | 465 | /** Retry time in milliseconds for Serial port connections */ 466 | serialReconnectTime: 15000, 467 | 468 | /** Retry time in milliseconds for TCP socket connections */ 469 | //socketReconnectTime: 10000, 470 | 471 | /** Timeout in milliseconds for TCP server socket connections. Defaults to no timeout */ 472 | //socketTimeout: 120000, 473 | 474 | /** Maximum number of messages to wait in queue while attempting to connect to TCP socket 475 | * defaults to 1000 476 | */ 477 | //tcpMsgQueueSize: 2000, 478 | 479 | /** Timeout in milliseconds for inbound WebSocket connections that do not 480 | * match any configured node. Defaults to 5000 481 | */ 482 | //inboundWebSocketTimeout: 5000, 483 | 484 | /** To disable the option for using local files for storing keys and 485 | * certificates in the TLS configuration node, set this to true. 486 | */ 487 | //tlsConfigDisableLocalFiles: true, 488 | 489 | /** The following property can be used to verify websocket connection attempts. 490 | * This allows, for example, the HTTP request headers to be checked to ensure 491 | * they include valid authentication information. 492 | */ 493 | //webSocketNodeVerifyClient: function(info) { 494 | // /** 'info' has three properties: 495 | // * - origin : the value in the Origin header 496 | // * - req : the HTTP request 497 | // * - secure : true if req.connection.authorized or req.connection.encrypted is set 498 | // * 499 | // * The function should return true if the connection should be accepted, false otherwise. 500 | // * 501 | // * Alternatively, if this function is defined to accept a second argument, callback, 502 | // * it can be used to verify the client asynchronously. 503 | // * The callback takes three arguments: 504 | // * - result : boolean, whether to accept the connection or not 505 | // * - code : if result is false, the HTTP error status to return 506 | // * - reason: if result is false, the HTTP reason string to return 507 | // */ 508 | //}, 509 | } 510 | --------------------------------------------------------------------------------