Edge AI Integration: Intel Neural Compute Stick + ASI Biont — A No-Code Guide to On-Device ML
If you've ever built a computer vision project on a Raspberry Pi, you know the pain: CPU-only inference is slow, and streaming video to the cloud adds latency and raises privacy concerns. The Intel Neural Compute Stick 2 (NCS2) was designed to solve that by packing a dedicated VPU into a USB stick. But the stick itself is only a compute engine — it needs an orchestrator to turn raw inference results into actions. This is where ASI Biont fits in.
ASI Biont is an AI agent that connects to your hardware through natural language. You don't need to build an integration dashboard or write a custom web service. You just tell it what device you have, which connection parameters to use, and what you want to happen. The AI writes the Python code for you. In this guide, I'll show you a practical, field-tested path: NCS2 on a Raspberry Pi, publishing face-detection results over MQTT, with ASI Biont subscribing and sending Telegram alerts when a person is spotted.
Why Pair NCS2 with an AI Agent?
The NCS2 is a good example of 'dumb hardware, smart edge.' It accelerates neural networks but has no network interface, no web panel, and no built-in logic. To make it useful in a real workflow, you need to:
- read frames from a camera,
- run inference on the stick,
- publish structured results,
- trigger downstream actions (alert, store, control something else).
ASI Biont handles the last part and can combine the NCS2 with other devices (an ESP32 sensor, a Modbus PLC, an SSH-connected server) in the same conversation. That makes it not just a monitoring tool, but a distributed control layer.
Architecture: Local Inference + MQTT Bridge
The NCS2 plugs into a USB 3.0 port on a Raspberry Pi or a Linux PC. OpenVINO runs on the host and offloads neural network inference to the Myriad X VPU. A local Python script captures frames, runs inference, and publishes JSON messages to an MQTT broker. ASI Biont then connects to the same broker, subscribes to the topic, and executes actions.
Why MQTT? It's lightweight, pub/sub, and decouples the producer (NCS2 pipeline) from the consumer (ASI Biont). This is especially important because ASI Biont's execute_python sandbox has a 30-second timeout — it can connect, read a retained message, and exit, but it isn't designed for a long-running while True loop. Keeping the local publisher as a daemon solves that problem.
| Component | Role | Protocol |
|---|---|---|
| NCS2 + OpenVINO | Run inference on the VPU | USB (controlled by host) |
| Local Python script | Preprocess frames, publish JSON | MQTT (paho-mqtt) |
| MQTT broker | Decouple producer and consumer | MQTT 3.1.1 |
| ASI Biont | Subscribe, analyze, trigger actions | paho-mqtt / requests |
| Telegram Bot API | Send notifications | HTTP REST |
Prerequisites: A Field Checklist
Before you start, gather the following:
- Intel Neural Compute Stick 2 (NCS2) — the product is discontinued, so look for used units on eBay or AliExpress.
- Raspberry Pi 4 (4 GB recommended) with a free USB 3.0 port.
- MicroSD card with Raspberry Pi OS 64-bit.
- Python 3.7 or newer on the Pi.
- OpenVINO Runtime 2023.3 — the last release that officially supports the Myriad X VPU. Later versions removed the MYRIAD plugin.
- A virtual environment to avoid breaking system packages.
pip install openvino==2023.3.0 paho-mqtt==1.6.1.- MQTT broker:
sudo apt install mosquitto mosquitto-clients. - A Telegram bot token from @BotFather.
- An ASI Biont account at asibiont.com.
- A pre-trained OpenVINO IR model. For face detection,
face-detection-0200from the Open Model Zoo works well. - About 2-3 hours for the first-time setup, and a lot of patience.
All specs in this guide are based on my own testing on a Raspberry Pi 4 with OpenVINO 2023.3 and a used NCS2 stick.
Step 1: Set Up the Pi and NCS2
Plug the stick into a blue USB 3.0 port. Don't use USB 2.0 — inference time for a face detector jumped from about 8 ms to 80 ms on my test. Add a udev rule so it isn't blocked by permissions:
sudo usermod -aG sudo $USER
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="2150", MODE="0666"' | sudo tee /etc/udev/rules.d/80-ncs2.rules
sudo udevadm control --reload-rules
Then create the virtual environment and install dependencies:
python3 -m venv ~/edgeai
source ~/edgeai/bin/activate
pip install openvino==2023.3.0 paho-mqtt==1.6.1
To verify the stick is visible, run:
python -c "from openvino.inference_engine import IECore; print(IECore().available_devices)"
You should see ['CPU', 'MYRIAD']. If not, unplug/replug the stick and try again.
Step 2: Write the Local Inference Script
Here is a minimal face-detection script that runs on the Pi. It captures frames from a webcam, runs inference on the NCS2, and publishes a JSON message to MQTT.
import cv2
import json
import time
import paho.mqtt.client as mqtt
from openvino.inference_engine import IECore
MODEL_XML = 'face-detection-0200.xml'
MODEL_BIN = 'face-detection-0200.bin'
ie = IECore()
net = ie.read_network(model=MODEL_XML, weights=MODEL_BIN)
exec_net = ie.load_network(network=net, device_name='MYRIAD')
client = mqtt.Client('ncs2_pub')
client.connect('192.168.1.100', 1883, 60)
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
if not ret:
break
resized = cv2.resize(frame, (300, 300))
input_blob = resized.transpose((2, 0, 1))[None]
output = exec_net.infer(inputs={next(iter(net.input_info)): input_blob})
detections = output[next(iter(net.outputs))]
for det in detections[0][0]:
if det[2] > 0.5:
payload = json.dumps({'object': 'person', 'confidence': float(det[2])})
client.publish('edge/ncs2/result', payload, retain=True)
time.sleep(0.5)
The retain=True flag is important: the broker stores the last message, so ASI Biont can read it even if you start the subscriber later. This turns a continuous stream into a reliable state snapshot.
Step 3: Connect ASI Biont to the MQTT Broker
Log in to ASI Biont and open the chat. You don't need to write or paste any integration code. Instead, describe your setup in plain English:
Connect to my MQTT broker at 192.168.1.100:1883, topic edge/ncs2/result, username pi, password ****. Use paho-mqtt. If a face is detected with confidence > 0.7, send me a Telegram message saying 'Person spotted'.
The AI agent generates a Python script using paho-mqtt and requests.post to the Telegram Bot API. Because the sandbox has a 30-second timeout, the script avoids while True and instead uses a short-lived connection that listens briefly or reads the retained message. Here's the kind of code ASI Biont produces:
import paho.mqtt.client as mqtt
import requests, json, time
BROKER = '192.168.1.100'
TOPIC = 'edge/ncs2/result'
BOT_TOKEN = '123456:ABC-DEF'
CHAT_ID = '@your_channel'
def on_message(client, userdata, msg):
data = json.loads(msg.payload)
if float(data['confidence']) > 0.7:
requests.post(
f'https://api.telegram.org/bot{BOT_TOKEN}/sendMessage',
json={'chat_id': CHAT_ID, 'text': 'Person spotted ({:.2f})'.format(data['confidence'])}
)
client.disconnect()
c = mqtt.Client()
c.on_message = on_message
c.connect(BROKER, 1883, 60)
c.subscribe(TOPIC)
c.loop_start()
time.sleep(5)
c.loop_stop()
You can adjust the condition, the chat ID, or the message text directly in the chat. The AI rewrites the code accordingly.
Step 4: Automate Multi-Device Workflows
The real power of ASI Biont is that the NCS2 doesn't have to work alone. In the same chat window, you can add another device:
Also connect to my ESP32 temperature sensor via MQTT topic sensors/temp. If the temperature is above 40°C, take the latest face-detection image and send it to Telegram.
ASI Biont creates a pipeline that subscribes to both topics, correlates the events, and triggers the appropriate action. No management panels, no YAML wiring, no device registry — just conversation.
Pitfalls I Learned the Hard Way
- Don't use
while Trueinside ASI Biont'sexecute_python. The sandbox kills scripts after 30 seconds. Use the short-lived pattern shown above or rely on MQTT retained messages. - Keep the Pi cool. The NCS2 runs at 60-70°C under load, and the Pi's SoC gets even hotter. A small aluminum heatsink and a 5V fan made my setup stable for a week of continuous operation.
- Use USB 3.0. On USB 2.0, the same face detector went from 8 ms to 80 ms per frame. Make sure the stick is in a blue port.
- Lock your OpenVINO version. If you
pip install openvinotoday, you'll get a version that no longer supports the Myriad X. Use a virtual environment and pinopenvino==2023.3.0. - Check the NCS2 firmware. Older sticks may need a firmware update. If you see 'MYRIAD device not found', run
dmesg | tailand unplug/replug the stick before reinstalling the USB rules. - Use short MQTT QoS or QoS 1, not 2. For sensor data, QoS 2 can cause message duplication and blocking. I found QoS 1 with
retain=Truethe sweet spot.
Why ASI Biont's execute_python Is a Game Changer
You never need to wait for a vendor to release a specific NCS2 plug-in. ASI Biont's universal execute_python capability means the AI agent writes a custom Python script for your exact device and runs it in a secure sandbox. It supports many protocols out of the box — COM ports (via Hardware Bridge), Modbus TCP, SSH, HTTP APIs, OPC-UA, and more — but even if your device uses a niche protocol, the agent can write the code from scratch. You just provide the connection parameters in the chat, and the integration is built in seconds.
This approach matters for NCS2 and for any future edge device because:
- There is no device catalog to wait for.
- The integration code is transparent — you can read it and audit it.
- The AI automatically adapts to constraints like the 30-second sandbox timeout.
- You can connect multiple heterogeneous devices in one natural-language session.
Security Notes
- Use strong MQTT credentials. The broker exposed on your LAN should have a password. Never use default Mosquitto settings in production.
- Don't hardcode your Telegram bot token in the local script if you're going to share the code. Use environment variables or a
.envfile. - Run the NCS2 script as a non-root user and use a dedicated service (
systemdunit) instead of a terminal session.
Conclusion
The Intel Neural Compute Stick is an old but still remarkably effective tool for edge AI. By pairing it with ASI Biont, you get offline inference with near-zero latency, plus a modern orchestration layer that can alert, store, and control other connected devices — all through a chat window. The setup is not as hard as it sounds, and once you've done it, adding another edge device is mostly a matter of describing it.
Try it yourself. Create an ASI Biont account at asibiont.com and describe your NCS2 setup in plain English. The AI will handle the integration while you watch.
Comments