From 75a9908cca190b9ad3af4c7d709519c853e8c4e7 Mon Sep 17 00:00:00 2001 From: TaddyHC Date: Tue, 4 Mar 2025 07:21:19 -0600 Subject: [PATCH] Initial commit - Application note resource update to fix and remove RPC test dummy --- .../python-ei-sensorfusion-rpc-flow-cloud.zip | Bin 6048 -> 6044 bytes .../python-ei-sensorfusion-rpc-flow.zip | Bin 6085 -> 6081 bytes .../15.edge-ai-docker-container/content.md | 54 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/assets/python-ei-sensorfusion-rpc-flow-cloud.zip b/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/assets/python-ei-sensorfusion-rpc-flow-cloud.zip index bbb82db0dff12e09fdbbb47716a38f2192ea3b06..ea22ce1d7f71a776e1817d8e3d14f3357aec6db9 100644 GIT binary patch delta 787 zcmV+u1MK{uFPty1zX1*OIb>S9R1B4<0ssI*lgt5H24QR4FcAHdECLySmYiy+vXSJL zZtZ{HNpfO4>6#D0KD~SI?%l~pLS?dI96nuWRtZ%M?!H7#aFL9=fhE_1%7gGk7LQA= zOrbFjaB>3E`pDjKXih>pKTM`G zNXF?$aAgNd6DWaBZ(GsM>9U;Ofs>qhE56{maj8J(K^0nYkb6aTz@gPRt zFhp8O>l%w4l`7zWfl4&S)ryOPNiWeZZA-WHWr^W(=T30cxLD}Dy+DIC$HgPV;fK>W zMh~3&XWh7tSocL(Barl5G&|DxEJ_YsYiWiBI%7gG}{8$$k|xu92)OQ2U&_z zr0;M|r$gV}8#D6@g4NxZl3PCL?QYZ$>UOv&%CIyNpZv}oUX6V_Uu|r6A?sESG0jyt z|6j4;PSqO>#kizTWEi_;1uXg>v(N;C4-ND=WLmpa43($?002XiU=(r&_J^c}2aS`d z5+0NG6dnT11e4JLD3d-FU;^F;lhFYvlgJfV0S=QP7JdO)lOYx`lh77b03aUF1LSKVuFtRS@TLd#Sc4w#fGOraF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j}{%1&=L}p2^0k)SG*js!821r<<L+P#B9nI&U;^|B zk)R@zE(!{h1r|;M9t)A6B9rhI2a|plP6A^Kk)R@z@D^MGQxTD%B9m|zO9tK%00000 D(!GGT diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/content.md index 13c307f6b4..a4afd201cc 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/15.edge-ai-docker-container/content.md @@ -535,50 +535,50 @@ The M4 core needs to have the **`rpc-flow-sensor.ino`** uploaded to collect and FlowSensor flowSensor(SENSOR_TYPE, SENSOR_PIN); void count() { - flowSensor.count(); + flowSensor.count(); } // Function to get Flow Rate (for RPC) float getFlowRate() { - flowSensor.read(); - float flowRate = flowSensor.getFlowRate_m(); // Get flow rate in L/min + flowSensor.read(); + float flowRate = flowSensor.getFlowRate_m(); // Get flow rate in L/min - if (isnan(flowRate) || isinf(flowRate)) { - return 0.0; // Default to 0 if no valid reading - } - return flowRate; + if (isnan(flowRate) || isinf(flowRate)) { + return 0.0; // Default to 0 if no valid reading + } + return flowRate; } void setup() { - SerialDebug.begin(115200); - //while (!SerialDebug); + SerialDebug.begin(115200); + //while (!SerialDebug); - SerialDebug.println("Starting Flow Sensor "); + SerialDebug.println("Starting Flow Sensor "); - flowSensor.begin(count); // Initialize the Flow Sensor + flowSensor.begin(count); // Initialize the Flow Sensor - // RPC Binding: Function to get flow rate - RPC.bind("flow_rate", [] { - return 11; - }); + // RPC Binding: Function to get flow rate + RPC.bind("flow_rate", [] { + return getFlowRate(); + }); - // RPC Binding: Receive classification results - RPC.bind("classification", [](std::string const& input) { - SerialDebug.print("Classification Received: "); - SerialDebug.println(input.c_str()); - return 1; - }); + // RPC Binding: Receive classification results + RPC.bind("classification", [](std::string const& input) { + SerialDebug.print("Classification Received: "); + SerialDebug.println(input.c_str()); + return 1; + }); - SerialDebug.println("Setup complete."); + SerialDebug.println("Setup complete."); } void loop() { - float flowRate = getFlowRate(); - SerialDebug.print("Flow Rate: "); - SerialDebug.print(flowRate); - SerialDebug.println(" L/min"); + float flowRate = getFlowRate(); + SerialDebug.print("Flow Rate: "); + SerialDebug.print(flowRate); + SerialDebug.println(" L/min"); - delay(1000); + delay(1000); } ```