[{"data":1,"prerenderedAt":331},["ShallowReactive",2],{"node-red-\u002Fnode-red\u002Fhardware\u002Fsiemens-iot-2050":3},{"id":4,"title":5,"body":6,"description":323,"extension":324,"meta":325,"navigation":326,"path":327,"seo":328,"stem":329,"__hash__":330},"nodeRed\u002Fnode-red\u002Fhardware\u002Fsiemens-iot-2050.md","Run Node-RED on Siemens IoT2050",{"type":7,"value":8,"toc":316},"minimark",[9,21,31,36,45,49,68,72,79,110,120,148,154,169,172,182,191,194,199,208,215,234,240,252,258,263,283,287,293,305,309,312],[10,11,12,13,20],"p",{},"Siemens ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fpress.siemens.com\u002Fglobal\u002Fen\u002Fpressrelease\u002Fnew-siemens-gateway-between-cloud-company-it-and-production",[18],"nofollow","announced"," the IoT2000 series in March of 2020.  With this tool many have been using it to function as a gateway between their plant operations and cloud infrastructure.  Onboard it came with Node-RED pre-installed. To manage Node-RED as an organization the FlowFuse agent is recommended, this documentation shows you how to do so.",[22,23,25,26,30],"div",{"style":24},"background-color: #fff4b9; border:1px solid #ffc400; color: #a27110; padding: 12px; border-radius: 6px; font-style: italic;","Warning: Later in the documentation we will be updating Node.js. This will break ",[14,27,29],{"href":28},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmraa","MRAA"," library. This will prevent communication to the GPIO of the device.",[32,33,35],"h2",{"id":34},"goal","Goal",[10,37,38,39,44],{},"The goal of this documentation is to guide the user through the installation process of getting FlowFuse Device agent installed on an IoT2050. The IoT2050 comes pre-installed with version 12.22.x Node.js on the ",[14,40,43],{"href":41,"rel":42},"https:\u002F\u002Fsupport.industry.siemens.com\u002Fcs\u002Fdocument\u002F109741799\u002Fdownloads-for-simatic-iot20x0?dti=0&lc=en-GB",[18],"IOT2050_Example_Image_V1.3.1"," image. A requirement to install FlowFuse Device Agent, Node.js needs to be upgraded to version 18 minimum.  We will be going through that process.",[32,46,48],{"id":47},"prerequisites","Prerequisites",[10,50,51,52,56,57,62,63,67],{},"We will be working with the IoT2050 Advanced, ",[53,54,55],"em",{},"6ES7 647-0BA00-1YA2",". The device has been ",[14,58,61],{"href":59,"rel":60},"https:\u002F\u002Fsupport.industry.siemens.com\u002Fcs\u002Fattachments\u002F109741799\u002FIOT2050_How_To_Firmware_Update_V1.3.pdf",[18],"upgraded"," to the latest firmware at the time of writing this article of v1.3.1.  We will be leveraging the IOT2050_Example_Image_V1.3.1.zip image which is a Debian base OS.  To complete this guide, knowledge of Linux-based cli is necessary.  Documentation to complete these requirements can be found ",[14,64,66],{"href":41,"rel":65},[18],"here",".",[32,69,71],{"id":70},"step-by-step-guide","Step by Step Guide",[73,74,75],"ol",{},[76,77,78],"li",{},"First we need to run the standard updates.",[80,81,86],"pre",{"className":82,"code":83,"language":84,"meta":85,"style":85},"language-shell shiki shiki-themes github-light github-dark","apt-get update\napt-get upgrade\n","shell","",[87,88,89,102],"code",{"__ignoreMap":85},[90,91,94,98],"span",{"class":92,"line":93},"line",1,[90,95,97],{"class":96},"sScJk","apt-get",[90,99,101],{"class":100},"sZZnC"," update\n",[90,103,105,107],{"class":92,"line":104},2,[90,106,97],{"class":96},[90,108,109],{"class":100}," upgrade\n",[73,111,112],{"start":104},[76,113,114,115,119],{},"If you need to migrate your existing Node-RED follow these ",[14,116,118],{"href":117},"\u002Fdocs\u002Fmigration","instructions"," to backup your existing progress.  From there we will need to remove the existing service that autostarts Node-RED by running the following command and rebooting:",[80,121,123],{"className":82,"code":122,"language":84,"meta":85,"style":85},"systemctl disable node-red.service\nreboot -h now\n",[87,124,125,136],{"__ignoreMap":85},[90,126,127,130,133],{"class":92,"line":93},[90,128,129],{"class":96},"systemctl",[90,131,132],{"class":100}," disable",[90,134,135],{"class":100}," node-red.service\n",[90,137,138,141,145],{"class":92,"line":104},[90,139,140],{"class":96},"reboot",[90,142,144],{"class":143},"sj4cs"," -h",[90,146,147],{"class":100}," now\n",[73,149,151],{"start":150},3,[76,152,153],{},"Confirm that your Node-RED instance is no longer running.",[80,155,157],{"className":82,"code":156,"language":84,"meta":85,"style":85},"systemctl status node-red\n",[87,158,159],{"__ignoreMap":85},[90,160,161,163,166],{"class":92,"line":93},[90,162,129],{"class":96},[90,164,165],{"class":100}," status",[90,167,168],{"class":100}," node-red\n",[10,170,171],{},"In the output look for the text that signifies the service has been stopped.",[173,174,175],"blockquote",{},[10,176,177,178,181],{},"iot2050-debian systemd",[90,179,180],{},"1",": Stopped Node-RED.",[73,183,185],{"start":184},4,[76,186,187,188,67],{},"Now it is time to upgrade your Node.js version.  To check the version before we get started run ",[87,189,190],{},"node -v",[10,192,193],{},"You should see an output like this:",[173,195,196],{},[10,197,198],{},"v12.22.5",[22,200,201,202,204,205,67],{"style":24},"Warning: updating Node.js will break the ",[14,203,29],{"href":28}," library. This will prevent communication to the GPIO of the device. Details can be found ",[14,206,66],{"href":207},"https:\u002F\u002Fsupport.industry.siemens.com\u002Fforum\u002FWW\u002Fen\u002Fposts\u002Fiot2050-node-js-versions\u002F297170",[10,209,210,211,214],{},"Then, install a tool called ",[53,212,213],{},"n"," that will allow you to change your versions of Node.js with the following command.",[80,216,218],{"className":82,"code":217,"language":84,"meta":85,"style":85},"npm install n -g\n",[87,219,220],{"__ignoreMap":85},[90,221,222,225,228,231],{"class":92,"line":93},[90,223,224],{"class":96},"npm",[90,226,227],{"class":100}," install",[90,229,230],{"class":100}," n",[90,232,233],{"class":143}," -g\n",[73,235,237],{"start":236},5,[76,238,239],{},"Next we will install the version 18.17.x (LTS) of Node.js.",[80,241,243],{"className":82,"code":242,"language":84,"meta":85,"style":85},"n v18.17\n",[87,244,245],{"__ignoreMap":85},[90,246,247,249],{"class":92,"line":93},[90,248,213],{"class":96},[90,250,251],{"class":100}," v18.17\n",[10,253,254,255,257],{},"Now run ",[87,256,190],{}," again to confirm the installation.  You should see the latest version now installed.",[173,259,260],{},[10,261,262],{},"v18.17.1",[73,264,266,277],{"start":265},6,[76,267,268,269,273,274,67],{},"Now that we have Node.js installed, we can proceed with the standard installation process.  First ",[14,270,272],{"href":271},"\u002Fdocs\u002Fdevice-agent\u002Finstall\u002F","install"," the FlowFuse Device agent.  Then, to connect your FlowFuse Device Agent, follow these ",[14,275,118],{"href":276},"\u002Fdocs\u002Fdevice-agent\u002Fregister\u002F",[76,278,279,280,67],{},"Lastly, if you want your device to run on boot.  Follow these ",[14,281,118],{"href":282},"\u002Fblog\u002F2023\u002F05\u002Fdevice-agent-as-a-service\u002F",[32,284,286],{"id":285},"switching-between-versions-of-nodejs","Switching between versions of Node.js",[10,288,289,290,292],{},"Switching between versions of Node.js can now be completed by leveraging ",[53,291,213],{}," command that was installed in step 4.  To do so simply run the following to switch back.",[80,294,296],{"className":82,"code":295,"language":84,"meta":85,"style":85},"n v12.22.5\n",[87,297,298],{"__ignoreMap":85},[90,299,300,302],{"class":92,"line":93},[90,301,213],{"class":96},[90,303,304],{"class":100}," v12.22.5\n",[32,306,308],{"id":307},"more-on-mraa","More on MRAA",[10,310,311],{},"The MRAA library is a \"Low Level Skeleton Library for Communication on GNU\u002FLinux platform.\"  It has been key for various solutions to communicate to hardware boards GPIO, General Purpose Input Output.  The MRAA library only supports version 6.x.x of Node.js, but Siemens put in the effort to patch their deployment up to version 12.22.x of Node.js.",[313,314,315],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":85,"searchDepth":104,"depth":104,"links":317},[318,319,320,321,322],{"id":34,"depth":104,"text":35},{"id":47,"depth":104,"text":48},{"id":70,"depth":104,"text":71},{"id":285,"depth":104,"text":286},{"id":307,"depth":104,"text":308},"In this guide, we will discuss how to install FlowFuse Device agent on Siemens IoT2050.","md",{},true,"\u002Fnode-red\u002Fhardware\u002Fsiemens-iot-2050",{"title":5,"description":323},"node-red\u002Fhardware\u002Fsiemens-iot-2050","kMKjewZVkh7AsGTjl16V_wamTToKLKwDJZKdQRkEEDk",1780070557379]