Skip to content

Arduino IoT Collector does not start, crashes with port not found

Bug report

Summary

The application does not start but crashes with an Arduino Port not being found.

Steps to reproduce

Build and run the application.

mkdir build
cmake -B build
make -C build

./build/arduino_iot_collector config/arduino_iot_collector.conf

What is the current bug behavior?

The collector starts but crashes with an uncaught exception, saying it could not find the Arduino port.

What is the expected correct behavior?

The collector starts and collects metrics from the connected Arduino board.

Relevant logs and/or screenshots

./build/arduino_iot_collector config/arduino_iot_collector.conf
Starting Arduino IoT Collector Application...
libc++abi: terminating due to uncaught exception of type std::runtime_error: Failed to initialize Arduino temperature sensor: Arduino port not found: /dev/ttyACM0
[1]    38916 abort      ./build/arduino_iot_collector config/arduino_iot_collector.conf

Environment information

  • OS (Linux/Unix, macOS, Windows) and version:
  • Metrics type (Prometheus, file, Arduino, other hardware sensors):
  • Building from source: Compiler and version (g++ --version, clang++ --version):

Possible fixes

  1. Remove the uncaught exception, and create a better error handling
  2. Investigate why the configured port is not working
    1. Maybe there is no auto-detection. Use the arduino-cli board list CLI to detect the connected Arduino board.
Edited by Michael Friedrich