【问题标题】:Google Assistant on Raspberry pi Segmentation faultRaspberry pi 分段错误上的 Google Assistant
【发布时间】:2020-11-28 15:03:10
【问题描述】:

使用本指南在我的 pi 上安装 Google 助手:https://developers.google.com/assistant/sdk/guides/library/python/embed/run-sample

(env) pi@raspberrypi:~ $ source env/bin/activate
    (env) pi@raspberrypi:~ $ googlesamples-assistant-hotword --project_id 'celius-54926' --device_model_id 'celius-54926-celius-qyn1r6'
    device_model_id: celius-54926-celius-qyn1r6
    device_id: A1CE24415E5C880BCA74644CD6315DC2

    Segmentation fault

【问题讨论】:

  • 你有哪个版本的SDK?你可以通过运行 pip freeze 来找出答案。
  • (env) pi@raspberrypi:~ $ pip freeze cachetools==2.1.0 certifi==2018.4.16 cffi==1.11.5 chardet==3.0.4 click==6.7 enum34== 1.1.6 期货==3.1.1 google-assistant-grpc==0.2.0 google-assistant-library==1.0.0 google-assistant-sdk==0.5.0 google-auth==1.4.1 google-auth -oauthlib==0.2.0 googleapis-common-protos==1.5.3 grpcio==1.12.0 idna==2.6 oauthlib==2.0.7 pathlib2==2.3.2 pkg-resources==0.0.0 protobuf== 3.5.2.post1 pyasn1==0.4.2 pyasn1-modules==0.2.1 pycparser==2.18 requests==2.18.4 requests-oauthlib==0.8.0 rsa==3.4.2 六==1.11.0 sounddevice ==0.3.11 坚韧==4.12.0 urllib3==1.22
  • 你能在 GitHub 页面上提出问题吗:github.com/googlesamples/assistant-sdk-python/issues
  • 我遇到了同样的问题并尝试了所有建议(为项目启用了助手 api,使用 googlesamples-assistant-devicetool 删除和注册我的设备。)我相信 devicetool 正在工作,因为我可以注册新设备或删除现有设备并在设备注册页面上查看更改。我试过googlesamples-assistant-hotwordgoogle-assistant-demo 都给我Segmentation Fault 没有更多信息。
  • 另外,根据文档,When you run the sample the first time, it will generate a device instance for your particular device. 但是在我运行googlesamples-assistant-hotword 然后使用googlesamples-assistant-devicetool --project-id my-prj-id list --device 之后,没有创建设备实例。我手动创建了一个,但仍然出现段错误。

标签: google-assistant-sdk


【解决方案1】:

我遇到了同样的问题。

我继续阅读页面:https://developers.google.com/assistant/sdk/guides/library/python/embed/run-sample 在标题“查找设备实例 ID”下,看来我的设备没有注册。

因此,我通过此处的帮助页面从 pi 手动注册了设备: https://developers.google.com/assistant/sdk/reference/device-registration/device-tool#register-device

(env) pi@raspberrypi:~ $  googlesamples-assistant-devicetool --project-id YOUR_DEVICE_ID register-device --device 4D609xxxxxxxxxxxxxxxxxxx --model YOUR_MODEL_ID --client-type SERVICE
Creating new device
Error: Failed to register device: 403
Google Assistant API has not been used in project 5739xxxxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview?project=5739xxxxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

所以我点击链接并在我的谷歌帐户下启用了 API,然后重试。

(env) pi@raspberrypi:~ $ googlesamples-assistant-devicetool --project-id YOUR-PROJECT-ID register-device --device 4D60xxxxxxxxxxxxxxx --model YOUR_MODEL_ID --client-type SERVICE

Creating new device

Device instance 4D60xxxxxxxxx successfully registered

现在可以正常使用了。

【讨论】:

  • 谢谢。我遇到了同样的问题,发现我的 model_ID 不正确。通过上面的过程更容易发现问题
  • 做了,还是有同样的问题
【解决方案2】:

我遇到了同样的问题。经过大量研究,我发现有一个新版本的 google-assistant-library

一旦我将它从 1.0.0 升级到 v1.0.1,问题就解决了。

打开您的环境并运行

python -m pip install --upgrade google-assistant-library==1.0.1

如果有任何问题,请告诉我。

【讨论】:

    【解决方案3】:

    我在设置 Ubuntu 助手时遇到了同样的问题,我发现我的谷歌助手 api 没有启用。我从 api 控制台启用它并开始工作。

    【讨论】:

      【解决方案4】:

      我在 RPi4 中遇到了同样的问题。 最后这个问题被新版本的 google-assistant 库修复了,1.1.0 而不是 1.0.1 版本:

      python -m pip install --upgrade google-assistant-library==1.1.0
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-22
        • 2018-06-24
        • 1970-01-01
        • 1970-01-01
        • 2017-12-31
        相关资源
        最近更新 更多