[{"data":1,"prerenderedAt":327},["ShallowReactive",2],{"blog-\u002Fblog\u002F2024\u002F01\u002Fhow-to-deploy-node-red-with-flowfuse-to-balenacloud":3},{"id":4,"title":5,"body":6,"description":310,"extension":311,"meta":312,"navigation":322,"path":323,"seo":324,"stem":325,"__hash__":326},"blog\u002Fblog\u002F2024\u002F01\u002Fhow-to-deploy-node-red-with-flowfuse-to-balenacloud.md","Step-by-Step Guide to Deploying Node-RED with FlowFuse in balenaCloud",{"type":7,"value":8,"toc":292},"minimark",[9,26,31,42,47,55,59,90,94,102,106,109,131,135,163,167,170,191,195,198,223,227,240,260,264,267,285,289],[10,11,12,13,18,19,25],"p",{},"In a ",[14,15,17],"a",{"href":16},"\u002Fwebinars\u002F2024\u002Fbalena\u002F","recent webinar with balena",", we explored the dynamic capabilities of deploying FlowFuse to a fleet of devices using ",[14,20,24],{"href":21,"rel":22},"https:\u002F\u002Fwww.balena.io\u002Fcloud",[23],"nofollow","balenaCloud",". This blog post serves as a practical guide to replicate that process, specifically tailored for those aiming to streamline their deployment of FlowFuse in an efficient and user-friendly manner.",[27,28,30],"h2",{"id":29},"how-to-implement-flowfuse-with-balenacloud-on-a-fleet-of-devices","How to Implement FlowFuse with balenaCloud on a Fleet of devices",[10,32,33],{},[14,34,38],{"href":35,"rel":36,"title":37},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=cKFu1ljUlKE",[23],"Deploying Node-RED with FlowFuse in balenaCloud",[39,40],"img",{"alt":37,"src":41},"https:\u002F\u002Fi.ytimg.com\u002Fvi\u002FcKFu1ljUlKE\u002Fhqdefault.jpg",[43,44,46],"h3",{"id":45},"preparation-steps","Preparation Steps",[10,48,49,50,54],{},"Before diving into the deployment process, it's crucial to familiarize yourself with key resources. We recommend reviewing our previous ",[14,51,53],{"href":52},"\u002Fblog\u002F2023\u002F11\u002Fdevice-agent-balena\u002F","blog post"," on deploying the FlowFuse Device Agent via balena. This post contains a vital link to the GitHub repository, essential for deploying FlowFuse with balena, laying the groundwork for the steps ahead.",[43,56,58],{"id":57},"creating-a-new-fleet-in-balenacloud","Creating a New Fleet in balenaCloud",[60,61,62,77,80,83],"ol",{},[63,64,65,66,71,72,76],"li",{},"Navigate to the ",[14,67,70],{"href":68,"rel":69},"https:\u002F\u002Fgithub.com\u002FFlowFuse\u002Fbalena-device-agent",[23],"FlowFuse git"," repository. Click on the ",[73,74,75],"strong",{},"Deploy with balena"," button.",[63,78,79],{},"Name your fleet.",[63,81,82],{},"Select your default device.",[63,84,85,86,89],{},"Click ",[73,87,88],{},"Create and Deploy",".",[43,91,93],{"id":92},"adding-devices-to-the-fleet","Adding Devices to the Fleet",[10,95,96,97,89],{},"Once your fleet is created, the next step is to add devices. To add a device to your fleet, follow these ",[14,98,101],{"href":99,"rel":100},"https:\u002F\u002Fdocs.balena.io\u002Flearn\u002Fgetting-started\u002Fvar-som-mx6\u002Frust\u002F#add-a-device-and-download-os",[23],"instructions",[43,103,105],{"id":104},"setting-up-flowfuse","Setting Up FlowFuse",[10,107,108],{},"Setting up FlowFuse correctly is essential for seamless operation:",[60,110,111,118,128],{},[63,112,113,114,117],{},"Create a new instance within FlowFuse or use an existing one if you prefer. Follow these ",[14,115,101],{"href":116},"\u002Fdocs\u002Fuser\u002Fintroduction\u002F#creating-a-node-red-instance"," to create a new instance.",[63,119,120,121,124,125,89],{},"Create a ",[73,122,123],{},"Device Provisioning Token"," by following these ",[14,126,101],{"href":127},"\u002Fdocs\u002Fdevice-agent\u002Fregister\u002F#bulk-registration",[63,129,130],{},"Ensure you add the FlowFuse Node-RED application you want the devices to provision. If left at default, devices will need to be manually added to applications.",[43,132,134],{"id":133},"using-the-device-provisioning-token","Using the Device Provisioning Token",[60,136,137,144,160],{},[63,138,139,140,143],{},"First, convert the contents of the Device Provisioning Token to base64. Follow these ",[14,141,101],{"href":142},"\u002Fblog\u002F2023\u002F11\u002Fdevice-agent-balena\u002F#environment-variable"," to convert the file to base64.",[63,145,146,147,150,151,155,156,89],{},"Once converted, import this string into balena as a ",[73,148,149],{},"Fleet"," level variable, not a device level variable. Follow these ",[14,152,101],{"href":153,"rel":154},"https:\u002F\u002Fdocs.balena.io\u002Flearn\u002Fmanage\u002Fvariables\u002F#fleet-wide-variables",[23]," to import the Fleet level variable with the Name ",[157,158,159],"code",{},"FF_DEVICE_YML",[63,161,162],{},"This action will provision any new device added to the fleet with the yaml file configuration, automatically adding the device to a FlowFuse instance.",[43,164,166],{"id":165},"deploying-and-testing-the-flowfuse-instance","Deploying and Testing the FlowFuse Instance",[10,168,169],{},"Deploying the FlowFuse instance brings everything together:",[60,171,172,175,178,188],{},[63,173,174],{},"Navigate to your FlowFuse application created earlier.",[63,176,177],{},"Go to your devices and you should now see your newly provisioned devices from balena.",[63,179,180,181,184,185,89],{},"If this is your first time setting up your fleet, the device will not have a snapshot. You will need to deploy a snapshot. Follow these ",[14,182,101],{"href":183},"\u002Fdocs\u002Fuser\u002Fsnapshots\u002F#create-a-snapshot"," to do so. Ensure that you select ",[73,186,187],{},"Set Target Snapshot",[63,189,190],{},"Once complete, the FlowFuse instance will deploy to your device(s).",[27,192,194],{"id":193},"integrating-influxdb-optional","Integrating InfluxDB (Optional)",[10,196,197],{},"Integrating InfluxDB enables effective data storage and management:",[60,199,200,211,217],{},[63,201,202,203,208,209,89],{},"Similar to the previous steps, navigate to this ",[14,204,207],{"href":205,"rel":206},"https:\u002F\u002Fgithub.com\u002Fmpous\u002Fflowfuse-agent-influx-balena\u002Ftree\u002Fmain?tab=readme-ov-file",[23],"Github repository"," and click ",[73,210,75],{},[63,212,213,214,89],{},"This time, instead of creating a new fleet, select ",[73,215,216],{},"Use an existing fleet instead",[63,218,219,220,89],{},"Choose your fleet for deployment and select ",[73,221,222],{},"Deploy to fleet",[43,224,226],{"id":225},"data-generation-and-management","Data Generation and Management",[10,228,229,230,235,236,239],{},"For testing, we have created a flow to get you started. Follow this ",[14,231,234],{"href":232,"rel":233},"https:\u002F\u002Fflows.nodered.org\u002Fflow\u002F66f37bb739b6cdb0c7ad3a4e2edd68ef",[23],"link"," and import it. There are four sets of flows for you to begin with. The first is for data generation. The second is a manual data generation flow. The third is key as it initiates the creation of a database, in this case, ",[73,237,238],{},"mydb",". The last flow is a simple query that pulls data from InfluxDB.",[60,241,242,249,255],{},[63,243,244,245,248],{},"Import the flows into your FlowFuse instance of Node-RED and deploy. Follow these ",[14,246,101],{"href":247},"\u002Fblog\u002F2023\u002F03\u002F3-quick-node-red-tips-5\u002F#2.-import-helpful-example-flows-provided-with-custom-nodes"," for importing and exporting.",[63,250,251,252,89],{},"Return to Flowfuse, go to your instance, and create another ",[14,253,254],{"href":183},"snapshot",[63,256,257,258,89],{},"Ensure that you ",[73,259,187],{},[43,261,263],{"id":262},"finalizing-and-testing-the-setup","Finalizing and Testing the Setup",[10,265,266],{},"The final steps ensure that your setup is fully operational:",[60,268,269,272,278],{},[63,270,271],{},"Once deployed, navigate to the device.",[63,273,274,89],{},[14,275,277],{"href":276},"\u002Fdocs\u002Fdevice-agent\u002Fdeploy\u002F#editing-the-node-red-flows-on-a-remote-instance-that-is-assigned-to-an-application","Enable Developer Mode",[63,279,280,281,284],{},"Next, click the newly revealed button, ",[73,282,283],{},"Open Editor",", to access the deployed Flow.",[43,286,288],{"id":287},"conclusion","Conclusion",[10,290,291],{},"Implementing FlowFuse with balenaCloud significantly enhances your device management and data processing capabilities. This guide provides a foundational approach, but don't hesitate to delve deeper into each step to tailor the setup to your specific needs.",{"title":293,"searchDepth":294,"depth":294,"links":295},"",2,[296,305],{"id":29,"depth":294,"text":30,"children":297},[298,300,301,302,303,304],{"id":45,"depth":299,"text":46},3,{"id":57,"depth":299,"text":58},{"id":92,"depth":299,"text":93},{"id":104,"depth":299,"text":105},{"id":133,"depth":299,"text":134},{"id":165,"depth":299,"text":166},{"id":193,"depth":294,"text":194,"children":306},[307,308,309],{"id":225,"depth":299,"text":226},{"id":262,"depth":299,"text":263},{"id":287,"depth":299,"text":288},"In a recent webinar with balena, we explored the dynamic capabilities of deploying FlowFuse to a fleet of devices using balenaCloud. This blog post serves as a practical guide to replicate that process, specifically tailored for those aiming to streamline their deployment of FlowFuse in an efficient and user-friendly manner.","md",{"navTitle":5,"excerpt":313},{"type":7,"value":314},[315],[10,316,12,317,18,319,25],{},[14,318,17],{"href":16},[14,320,24],{"href":21,"rel":321},[23],true,"\u002Fblog\u002F2024\u002F01\u002Fhow-to-deploy-node-red-with-flowfuse-to-balenacloud",{"title":5,"description":310},"blog\u002F2024\u002F01\u002Fhow-to-deploy-node-red-with-flowfuse-to-balenacloud","amaiBX60t3p2k5uNrEIKbiSbYI4G5GKYyfDsCcaB5Bo",1780070551333]