#Error: unknown resource type: API "rdk:component:sensor" with model "rdk:builtin:ultrasonic"

1 messages · Page 1 of 1 (latest)

vivid hemlock
#

I connected an HC-SR04 ultrasonic sensor to a RPi Zero 2 W and created the following VIAM configuration:

{
  "components": [
    {
      "name": "rpi",
      "namespace": "rdk",
      "type": "board",
      "model": "pi",
      "attributes": {
        "digital_interrupts": [
          {
            "name": "int_echo_us1",
            "pin": "38"
          }
        ]
      }
    },
    {
      "name": "ultrasonic_1",
      "namespace": "rdk",
      "type": "sensor",
      "model": "ultrasonic",
      "attributes": {
        "board": "rpi",
        "echo_interrupt_pin": "int_echo_us1",
        "trigger_pin": "40",
        "timeout_ms": 1000
      },
      "depends_on": [
        "rpi"
      ]
    }
  ]
}

Unfortunately the logs show the same error message over and over again:

rdk.resource_manager.rdk:component:sensor/ultrasonic_1 resource/graph_node.go:277 resource build error: unknown resource type: API "rdk:component:sensor" with model "rdk:builtin:ultrasonic" not registered resource rdk:component:sensor/ultrasonic_1 model rdk:builtin:ultrasonic

I have tried many ways to configure it, but end up with the same situation every time. Does anyone have any idea how to proceed?

rich lark
#

This is a bug with the app component selection. The built-in ultrasonic sensor component has been replaced by a module from the registry, so your current configuration will need to be updated to use that module and configured based on the associated docs: https://github.com/viam-modules/viam-ultrasonic

GitHub

Viam Golang module for the HC-S204 and compatible echo/trigger pin ultrasonic sensors. - viam-modules/viam-ultrasonic