Google Assistent - Could not create the device instance - google-assistant-sdk

I don't have any idea why he could not create the instance.
First it says:
C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-id assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\.....\\AppData\\...
INFO:root:Registering device
ERROR:root:Option --device-model-id required when registering a device instance.
Next try with --device-model-id
C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Option --project-id required when registering a device instance.
And next try with --project-id
C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi --project-id evil-assist
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Failed to register device: {
"error": {
"code": 400,
"message": "Could not create the device instance. Client type need to be specified as SDK_LIBRARY or SDK_SERVICE.",
"status": "INVALID_ARGUMENT"
}
}
I also registered the device as shown on developers.google.com.
C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --model
Device Model Id: assi
Project Id: evil-assist
Device Type: action.devices.types.LIGHT
Trait action.devices.traits.OnOff
And
C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --device
Device Instance Id: assi
Nickname: assi
Model: assi
Any ideas why it doesn't work?

Fund a solution..
Update the Library using
python -m pip install --upgrade google-assistant-sdk[samples]
I updated it 2 days ago, it seems that there was a bug in that version. Now it works.

SDK library was updated to 0.4.1 to fix this issue.
https://github.com/googlesamples/assistant-sdk-python/commit/f00df5ff40672942bdc6d1b27c10c49076f994f2

You should update library as Thomas Mayer mentioned.
googlesamples-assistant-devicetool
changed slightly. To create device instance id there's command:
googlesamples-assistant-devicetool --project-id myand
roidthings-5dba4 register-device --device 123456 --model myandroidthings-xxxxxx-myproduct-yyyyyy --client-type LIBRARY
Apart from that https://developers.google.com/assistant/sdk/guides/library/python/ seems to be up to date
Last option depends on platform you support: https://developers.google.com/assistant/sdk/overview#features
SERVICE is for All gRPC platforms.
LIBRARY is for linux-armv7l and linux-x86_64

Related

Tensorflow-Federated - OSError: [Errno 8] Exec Format Error: /python3.10/site-packages/tensorflow_federated/../../..data/worker_binary

Being fairly new to Federated Learning, after following the instructions on Setting up FL, I faced this one error repeatedly when testing if Tensorflow-Federated is indeed installed, as shown below
I have installed all relevant dependencies and there were not any warning messages or error messages
Requirements already satisfied: pip in ./venv/lib/python3.10/site-packages
Expected Output when executing:
print(tff.federated_computation(lambda: 'Hello World')())
Should be
b'Hello, World!'
Received Output:
OSError: [Errno 8] Exec format error: '/venv/lib/python3.10/site-packages/tensorflow_federated/python/core/backends/native/../../../../data/worker_binary'
These are the environment details(if it matters):
macOS Ventura 13.1
python 3.10 on vsCode
tensorflow 2.11.0
Are there any ways in which I can work around this? Note: I have tried resetting the environment multiple times and clearing the runtime on the notebook file(.ipynb) as well

Appium - Install iOS apps from a testflight public url

I'm trying to install / run an iOS app from a test flight public url when using appium desktop but get the following error when starting the session:
"An unknown server-side error occurred while processing the command. Original error: Could not install app: 'ENOTDIR: not a directory, scandir '/var/folders/[DIRECTORY_PATH]/[RANDOM_GENERATED_CODE].app''"
The desired capabilities I provided to appium desktop are shown below:
{
"automationName": "XCUITest",
"platformName": "iOS",
"deviceName": "[DEVICE_NAME]",
"platformVersion": "13.3",
"xcodeOrgId": "[XCODE_ORG_ID]",
"xcodeSigningId": "iPhone Developer",
"udid": "[DEVICE_UDID]",
"bundleId": "[APP_BUNDLE_ID]",
"updatedWDABundleId": "[WEDRIVER_AGENT_RUNNER]",
"app": "https://testflight.apple.com/join/[RANDOM_GENERATED_CODE]"
}
Does appium support this functionality? If so what am i missing?
You should try to download the app before setting up Appium. (with bash script or Java itself)
After downloading, set the local URL in the capabilities.
This error:
install app: 'ENOTDIR: not a directory, scandir '/var/folders/[DIRECTORY_PATH]/[RANDOM_GENERATED_CODE].app''"
Seems to indicate you are pointing to a file, not a directory, which is what the executing code expected. Are you supposed to expand the artifacts from TestFlight before using them? Perhaps something is wrong with the [DirectoryPath] you specified. What's actually at that location after the failure occurs?

Ansible Container unable to load libsudo_util.so.0 for privileged module execution

I am trying to use Ansible Container for a basic example which is supposed to install Node within the image. When I use the ansible-container build command, after successfully building the conductor image, it fails the first task with a sudo related error. The task in question requires root privileges to be executed.
I am running Debian GNU/Linux 9.2 (stretch) with Docker 17.09.0-ce installed through the Docker APT repository. I tried with Ansible both from Debian Stretch (2.2.1.0-2) and from Pypi (2.4.1.0). I tried Ansible Container from Pypi (0.9.3rc0) and from the latest Git source. I always get the exact same error output.
The Ansible module complains about the following:
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
The task being run looks like the following:
- name: Add the Node Source repository signing certificate to APT
apt_key:
id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
keyserver: hkps://hkps.pool.sks-keyservers.net
become: yes
Both the conductor as well as the service I try to create use the debian:stretch base image.
I am running the ansible-container build command with sudo prepended, because only root may access the Docker socket on my system.
Here is the content of my container.yml:
version: "2"
settings:
conductor:
base: debian:stretch
project_name: container_test
services:
nodejs:
from: debian:stretch
roles:
- nodejs
registries: {}
Here is the full error output:
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Dockerâ„¢ daemon integration engine loaded. Build starting. project=container_test
Building service... project=container_test service=nodejs
PLAY [nodejs] ******************************************************************
TASK [Gathering Facts] *********************************************************
ok: [nodejs]
TASK [nodejs : Add the Node Source repository signing certificate to APT] ******
fatal: [nodejs]: FAILED! => {"changed": false, "module_stderr": "sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 127}
to retry, use: --limit #/tmp/tmpTRBQDe/playbook.retry
PLAY RECAP *********************************************************************
nodejs : ok=1 changed=0 unreachable=0 failed=1
ERROR Error applying role! engine=<container.docker.engine.Engine object at 0x7f84da0c5ed0> exit_code=2 playbook=[{'hosts': u'nodejs', 'roles': ['nodejs'], 'vars': {}}]
Traceback (most recent call last):
File "/usr/local/bin/conductor", line 11, in <module>
load_entry_point('ansible-container', 'console_scripts', 'conductor')()
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/cli.py", line 408, in conductor_commandline
**params)
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/core.py", line 843, in conductorcmd_build
raise RuntimeError('Build failed.')
RuntimeError: Build failed.
Conductor terminated. Cleaning up. command_rc=1 conductor_id=e8899239ad1017a89acc97396d38ab805d937a7b3d74e5a7d2741d7b1124bb0c save_container=False
ERROR Conductor exited with status 1
I found the cause for this:
The base image debian:stretch does not include sudo. Therefore a solution was to set the become_method to su instead. Normally, this can either be done per task, host or playbook. Because it is not obvious where the equivalent of a playbook lies in Ansible Container and how the concept of hosts applies, I only really had the option to use the task level.
I decided to add a role which installs sudo in the image and only set the become_method to su for the solitary task within this role. Atfer the role is applied, no further change is needed and the original tasks work.
A follow-up problem then was, that also GnuPG was not installed either to accomplish the apt_key module task properly. The following solution solves both problems:
- become: yes
become_method: su
block:
- name: Update package cache
apt:
update_cache: yes
cache_valid_time: 86400
- name: Install GnuPG
package:
name: gnupg2
state: present
- name: Install sudo
package:
name: sudo
state: present
Supposedly a more clean option would be to generate a base image that already includes these dependencies to allow for a more streamlined Ansible Container image generation.

Printer on Raspberry pi : Yaourt can't build the driver

I'm trying to use my hp laserjet p1006 printer with my raspberry pi (archlinux, Linus 3.18.9).
I already set up the cups server, I can manage my printer through the web interface, and added my user to sys and lp groups.
I can "install" my printer through this interface, choose a "model" (driver?) amongst hpcups and hpijs (none works).
I can manage my printer, but when I try to print something with it, it ends with a "filter failed" error in my cups interface and my printer doesn't react.
I didn't find a PPD file (on openprinting.org, they say : "PPD files (and the Foomatic XML files to generate them) come with the driver (foo2xqx), therefore we do not supply PPDs here on the OpenPrinting site.").
I tried to install foo2xqx by installing foo2zjs (in which it's included) with yaourt.
I also edited each PKGBUILD to replace the architecture ('i686' or 'x86_64') with 'armv6h'.
But It fails to build and install a dependency : foomatic-db-foo2zjs.
Here is the output of yaourt :
==> ERROR: Failure while creating working copy of foomatic-db-foo2zjs bzr repo
Aborting...
==> ERROR: Makepkg was unable to build foomatic-db-foo2zjs.
I also tried to add more swap but it solved nothing.
What could I do?
Thank you for your help!
EDIT : I tried to add space to /tmp (as this tutorial explains : http://www.boxtutorials.com/how-to-increase-the-size-of-disk-space-tmp-usrtmpdsk-partition-in-linux-server.html) and it went further.
But I still have an issue :
If I try to build the package with yaourt :
I got an error with the PKGBUILD file :
pkgname=foomatic-db-foo2zjs
arch=('i686' 'x86_64' 'armv6h')
_snapdate=20141011
pkgver=${_snapdate}
pkgrel=1
epoch=3
license=('GPL' 'custom')
pkgdesc="Foomatic - The collected knowledge about printers, drivers, and driver options in XML files, used by foomat\
ic-db-engine to generate PPD files. Rebuilt for use with foo2zjs."
depends=('perl' 'libxml2')
conflicts=('foomatic-db-ppd' 'foomatic-db-hpijs' 'foomatic-db' 'foo2zjs-testing')
provides=('foomatic-db-hpijs' 'foomatic-db')
makedepends=('cups' 'perl' 'libxml2' 'enscript' 'perl' 'net-snmp' 'bash' 'bzr')
source=(foomatic-db-foo2zjs::bzr+http://bzr.linuxfoundation.org/openprinting/foomatic/foomatic-db/)
url="http://www.linuxprinting.org/foomatic.html"
md5sums=('SKIP')
package() {
cd ${srcdir}/${pkgname}
bzr revno
echo $pkgver
# here are the problems :
# I tried chmod calls both with and without "sudo"
# chmod 777 ./make_configure
./make_configure
# chmod 777 ./configure
./configure --prefix=/usr
make DESTDIR=${pkgdir} install
install -v -Dm644 ${srcdir}/${pkgname}/COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
# foo2zjs provides different versions of the following files
rm ${pkgdir}/usr/share/foomatic/db/source/driver/foo2hiperc.xml
# some other rm calls
rm ${pkgdir}/usr/share/foomatic/db/source/printer/HP-LaserJet_1005.xml
}
I got the following :
PKGBUILD: line 24: ./make_configure: Permission denied
==> ERROR: A failure occurred in package().
Aborting...
==> ERROR: Makepkg was unable to build foomatic-db-foo2zjs.
I tried to add a call to "sudo chmod" in this file to get permissions but it doesn't work.
And if I try to build myself the package (with makepkg) :
it returns :
-> Creating working copy of foomatic-db-foo2zjs bzr repo...
bzr: ERROR: Not a branch: "/home/vmonteco/build/foomatic-db-foo2zjs/foomatic-db-foo2zjs/.bzr/branch/": location is a repository.
==> ERROR: Failure while creating working copy of foomatic-db-foo2zjs bzr repo
Aborting...
Any idea?
By the way, I also found a tutorial (in French, sorry) that is exactly what I was searching for (same case, same devices, same package...), I put it here in case it could help somebody else, even a non-french speaker with just the commands.
http://www.azurs.net/carnet/2013/09/raspberry-pi-serveur-impression-imprimante-hp-laserjet-p1006/
I'm stuck (see the two errors above) at the two last steps "L’AUR sans peine, mais avec yaourt" ("AUR without troubles, but with yaourt") and "Empaquetage avec makepkg" ("packaging with makepkg"). I tried both but both failed when I tried.
I finally managed to fix it.
I'll recapitulate :
I added swap and made a larger /tmp to get rid off space issues. (The first problem I was encountering)..
But I also had to mount the /tmp without "noexec" option, to permit yaourt to run the PKGBUILD file (as suggested here : https://bbs.archlinux.org/viewtopic.php?id=189625).
I still have an issue (filter failed) with installing my printer with cups with the new drivers, so I'll wait to have a solution for this too before I mark this post as "solved". :)
EDIT:
I finally reinstalled my printer with the hp-setup tool (hp-lip package) and it worked. :)
I hope it could help anybody else!

Trigger.io error "/usr/bin/codesign no identity found" can't create package or run the app on the device

I have a problem when trying to run my application on the device or create IPA file.
I followed the steps here and I have this error when trying to run on iOS option:
[ERROR] Failed when running /usr/bin/codesign: FdawaDev: no identity found
I tried to make it throw terminal with this command
forge package ios --ios.profile.provisioning_profile Development.mobileprovision
and I'm getting this error
/Applications/TriggerToolkit.app/Contents/MacOS/forge -v package ios --ios.profile.provisioning_profile Development.mobileprovision
[ INFO] Forge tools running at version 3.3.43
[ DEBUG] Checking for update zip...
[ ERROR] Couldn't import generation code: No module named generate_dynamic
[ DEBUG] Traceback (most recent call last):
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/async.py", line 98, in run
result = self._target(*self._args, **self._kwargs)
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/main.py", line 443, in package
generate_dynamic = forge_build.import_generate_dynamic()
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/build.py", line 67, in import_generate_dynamic
raise ForgeError("Couldn't import generation code: {0}".format(e))
ForgeError: Couldn't import generation code: No module named generate_dynamic
I removed TriggerToolkit and download the latest one, installed it again and I'm still getting the same error.
What am I missing?
The first error is a configuration problem: you're pointing at an iOS developer identity called "FdawaDev" when one doesn't exist in your Keychain.
Unless you have several identities, you can safely leave the "Certificate" Local Config setting empty in the Toolkit.
If you have several identities, you should specify one with something like iPhone Developer: James Brady.
For the second problem, when using the command line tools, you have to manually run a build before doing a run or package action, e.g.:
% forge build ios && forge package ios

Resources