Edge-impulse-run-impulse On-Demand


  1. How do I run edge-impulse-run-impulse on-demand rather than in continuous mode?
  2. Is that even the right approach?

Project ID:

Context/Use case:
Much appreciation for the previous help, my daughter and I have now collected and categorized our data and the results are better than we could have hoped when running the edge-impulse-run-impulse command, but we’d like to only run it when commanded to run.

A conveyor belt pulls a Lego block through a light tunnel until an IR sensor is tripped (a Python3 script running on a Pi4 handles that work). Once the IR is tripped, I want the Python script trigger edge-impulse-run-impulse (our Edge Impulse model is uploaded on the ESP-EYE) and report the results back to the Pi4. Timing is slow- this is perhaps one block per minute and a deliberate call to the edge-impulse-run-impulse seems more relatable (teaching opportunity vs a continuous run).

In other words, our ESP-EYE is powered via a USB cable plugged into the Pi and running edge-impuse-run-impulse from a command line on the Pi4 works as expected, just in continuous mode and not from a Python3 call in our script. How do we call the edge-impulse-run-impulse command, capture one result, and record the result to an array/variables in Python?

As I want to run the ready-to-go-binary from Edge Impulse on my ESP-EYE (ESP32) and simply capture the output on my Pi 4, is the linux-sdk-python the most direct path? Seems like that would be more applicable if I wanted to run the AI piece on my Pi4 and not just use the Pi4 to grab the results.

Edit: Saw this on another recent post- seems to be what I want- will give it a try.

Oh, I stand corrected. I now understand the ESP is doing the inferencing.

You could connect the Pi4 and ESP via a serial connection. Then send ASCII text “AT+RUNIMPULSE” to start the ESP inferencing. The results will stream from the ESP to the Pi4 over the serial connection.
Then simply close the serial port on the Pi4 side to stop the ESP from streaming data.

AT Commands are here.

1 Like