Deploy ML models to Arm edge devices using Edge Impulse and AWS IoT Greengrass
Introduction
Understand the Edge Impulse and AWS IoT Greengrass deployment architecture
Select and set up your edge device
Set up your Edge Impulse project
Install AWS IoT Greengrass on your Arm edge device
Store your Edge Impulse API key in AWS Secrets Manager
Create the Edge Impulse Greengrass component
Deploy the component to your edge device
Verify inference and view results
Next Steps
Deploy ML models to Arm edge devices using Edge Impulse and AWS IoT Greengrass
Introduction
Understand the Edge Impulse and AWS IoT Greengrass deployment architecture
Select and set up your edge device
Set up your Edge Impulse project
Install AWS IoT Greengrass on your Arm edge device
Store your Edge Impulse API key in AWS Secrets Manager
Create the Edge Impulse Greengrass component
Deploy the component to your edge device
Verify inference and view results
Next Steps
View live inference in the browser
After the deployment completes and the Edge Impulse Linux Runner starts, it hosts a local web interface on port 4912. This page shows the live video input from a camera or a file, alongside real-time inference results and timing information.
Open a browser and navigate to the following URL:
http://<your-edge-device-ip>:4912
Replace <your-edge-device-ip> with the public IP address (for EC2) or local IP address of your edge device. For example, if your device’s IP address is 1.1.1.1, the URL is:
http://1.1.1.1:4912
Edge devices with cameras
If your device has a camera attached, you’ll see live video in the browser. Point the camera at this test image to verify that the model is detecting objects:
Test image with a dog and a cat
The model, running on your edge device, identifies both the dog and the cat. The browser output is similar to:
Expected inference results with camera
Edge devices without cameras
If your device doesn’t have a camera, the component plays a pre-installed 90-second video of a cat. The browser output is similar to:
Expected inference results without camera
If the image appears frozen, the Edge Impulse Linux Runner has finished playing the video and is waiting for a restart command. To replay the video, see
Send commands through AWS IoT Core
.
View inference output in AWS IoT Core
The Edge Impulse Linux Runner publishes inference results and model metrics to AWS IoT Core MQTT topics. You can view these messages in the AWS Console.
To view the message:
Open the AWS Console and navigate to AWS IoT Core.
Select MQTT test client.
In the Subscribe to a topic section, enter the following topic filter and select Subscribe:
/edgeimpulse/device/#
For devices with cameras, inference results appear whenever the model identifies an object. The output is similar to:
Inference output in MQTT test client
Model metrics are published periodically, controlled by the metrics_sleeptime_ms configuration field:
Model metrics in MQTT test client
Send commands through AWS IoT Core
The Edge Impulse Greengrass component supports commands sent through MQTT topics. The restart command restarts the Edge Impulse Linux Runner service. This is especially useful for devices without cameras, where it pauses after the video ends.
Find your device name
To send a command, you need the device name that the Edge Impulse Linux Runner registered in IoT Core. Look at the inference output in the MQTT test client. Each message is published to a topic with the following structure:
/edgeimpulse/device/<device-name>/inference/output
Copy the <device-name> portion from the topic to use in the next step.
The Edge Impulse Linux Runner uses four MQTT topics per device:
/edgeimpulse/device/<device-name>/inference/output
/edgeimpulse/device/<device-name>/model/metrics
/edgeimpulse/device/<device-name>/command/input
/edgeimpulse/device/<device-name>/command/output
Send the restart command
To send a restart command:
In the MQTT test client, select the Publish to a topic tab.
Enter the following topic, replacing
<device-name>with the name of your device:/edgeimpulse/device/<device-name>/command/inputClear the message body and enter the following JSON:
{ "cmd": "restart" }Select Additional configuration and enable the Retain message on this topic checkbox.
Select Publish.
After publishing, you should see a response on the command output topic similar to:
/edgeimpulse/device/<device-name>/command/output
The response confirms that the Edge Impulse Linux Runner has restarted. Navigate back to http://<your-edge-device-ip>:4912 in your browser to confirm that inference has resumed. You should also see new inference results appearing in the MQTT test client.
For devices without cameras, the Edge Impulse Linux Runner reads the sample video file and reports inferences until the video ends. The runner then waits for a restart command to replay the video from the beginning.
Troubleshoot deployment issues
If the Edge Impulse Linux Runner doesn’t start or the browser page doesn’t load, consider the following:
First deployment takes time: On the first deployment, the component installs all prerequisites (Node.js, libvips, Edge Impulse CLI). This can take 5–10 minutes. Monitor progress by tailing the component log on your device:
sudo tail -f /greengrass/v2/logs/EdgeImpulseLinuxEdge Impulse Linux RunnerServiceComponent.logTrace runtime logs: While the component is running, the Edge Impulse Linux Runner writes a separate log file in
/tmp. The filename follows the patternei_lockfile_runner_<device-name>.log. Tail this file to watch live inference activity:sudo tail -f /tmp/ei_lockfile_runner_*.logJetson GPU model loading delay: On Jetson devices where the model is compiled for GPU acceleration, expect a 2–3 minute delay the first time the model loads into GPU memory. Subsequent starts are much faster.
Clean up AWS resources
To clean up AWS resources and minimize costs, see Cleaning up AWS resources .
What you’ve accomplished
You’ve verified that the Edge Impulse Linux Runner is running inference on your edge device. You viewed results in the browser and AWS IoT Core MQTT topics, and sent a restart command through IoT Core.
You can now use MQTT commands through AWS IoT Core to control the Edge Impulse Linux Runner in real time and interpret its model metrics. For more information about the available command set and metrics features of the Edge Impulse Linux Runner AWS IoT Greengrass integration, see the MQTT command and metrics reference .