Coral Dev Board - Can't get demo to run - google-coral

I recently purchased a used dev board to start working on. I managed to flash it with Mendel 5 (Eagle) enabled SSH and followed the instructions on the get started without any issue until I tried the demo.
I can't get it to work at all!
If I run edgetpu_demo --stream
I get:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Press 'q' to quit.
Press 'n' to switch between models.
Traceback (most recent call last):
File "/usr/bin/edgetpu_detect_server", line 11, in <module>
load_entry_point('edgetpuvision==1.0', 'console_scripts', 'edgetpu_detect_server')()
File "/usr/lib/python3/dist-packages/edgetpuvision/detect_server.py", line 33, in main
run_server(add_render_gen_args, render_gen)
File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 43, in run_server
camera = make_camera(args.source, next(gen), args.loop)
File "/usr/lib/python3/dist-packages/edgetpuvision/detect.py", line 144, in render_gen
engines, titles = utils.make_engines(args.model, DetectionEngine)
File "/usr/lib/python3/dist-packages/edgetpuvision/utils.py", line 53, in make_engines
engine = engine_class(model_path)
File "/usr/lib/python3/dist-packages/edgetpu/detection/engine.py", line 80, in __init__
super().__init__(model_path)
File "/usr/lib/python3/dist-packages/edgetpu/basic/basic_engine.py", line 92, in __init__
self._engine = BasicEnginePythonWrapper.CreateFromFile(model_path)
RuntimeError: No Edge TPU device detected!
running as root gives me:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Press 'q' to quit.
Press 'n' to switch between models.
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(edgetpu_detect_server:7283): Gtk-WARNING **: 02:24:31.914: cannot open display:
Which seems closer but no idea how to fix either. I've searched as much as I can (added the user the plugdev, made sure everything was installed correctly)
Any ideas? Pretty sure if this doesn't work something is fairly broken.

Thanks for reaching out, this is definitely not a good sign..
RuntimeError: No Edge TPU device detected!
Sounds like the board some how lost access to the edgetpu, could you send us an email to coral-support#google.coon this issue?

Related

Permission error accessing USB from homeassistant docker

I am running homeassistant in a docker container on a RPi 4 with Raspbian. I am using tributs scripts to elevate the need of running the docker image as root. This all works dandy. But now I am trying to add the dsmr integration but I am not succeeding. The integration requires to connect to the "Slimme meter" via USB. However, I get a permission error. my knowledge of both docker and linux privelages is too limited to know where to start debugging this. Does anyone have some pointers for me?
This is the error message homeassistant is throwing at me:
Logger: homeassistant.components.dsmr
Source: components/dsmr/config_flow.py:93
Integration: dsmr (documentation, issues)
First occurred: 21:18:17 (1 occurrences)
Last logged: 21:18:17
Error connecting to DSMR
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/dsmr/config_flow.py", line 93, in validate_connect
transport, protocol = await asyncio.create_task(reader_factory())
File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 445, in create_serial_connection
serial_instance = serial.serial_for_url(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
After some researching I figured that I needed to add the user to an extra group named dialout because only members of that group are allowed to access the USB ports (as well as other devices).
First I figured out the group id of the dialout group in the host machine (the machine running the docker container) by running
cat /etc/group | grep dialout
it returned 20 in my case. Luckily, the script of tributs has the possibility to add the user to an extra group via the environment variable EXTRA_GID. So all the relevant lines in the docker-compose file for accessing USB are (when using the script of tribut) are:
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
environment:
- PUID=1000
- PGID=1000
- EXTRA_GID=20 # this is the ID of the group 'dialout'

Coral Dev Board Windows 10 setup

I followed the windows host instructions described in the https://coral.ai/docs/dev-board/get-started/
When I run command mdt devices, I get following exception always:
$ mdt devices
Traceback (most recent call last):
File "c:\users\ram\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\ram\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Ram\AppData\Roaming\Python\Python38\Scripts\mdt.exe\__main__.py", line 7, in
<module>
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\mdt\main.py", line 162, in
main
exit(command.run(sys.argv[1:]))
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\mdt\devices.py", line 43, i
n run
self.discoverer.discover()
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\mdt\discoverer.py", line 40
, in discover
self.zeroconf = Zeroconf()
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\zeroconf\__init__.py", line
2508, in __init__
self._listen_socket, self._respond_sockets = create_sockets(
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\zeroconf\__init__.py", line
2343, in create_sockets
respond_socket = new_respond_socket(i, apple_p2p=apple_p2p)
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\zeroconf\__init__.py", line
2302, in new_respond_socket
respond_socket = new_socket(
File "C:\Users\Ram\AppData\Roaming\Python\Python38\site-packages\zeroconf\__init__.py", line
2250, in new_socket
s.bind((bind_addr[0], port, *bind_addr[1:]))
OSError: [WinError 10049] The requested address is not valid in its context
Versions of my set up:
$ python --version
Python 3.8.5
$ mdt version
MDT version 1.5.2
Can you please help me to resolve this issue?
The same happened to me. Skipping some IP addresses solved the issue. Try this code:
import logging
import zeroconf
import ifaddr
for adapter in ifaddr.get_adapters():
print("IPs of network adapter ", adapter.nice_name)
for ip in adapter.ips:
print(" %s/%s", ip.ip, ip.network_prefix)
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("zeroconf").setLevel(level=logging.DEBUG)
z = zeroconf.Zeroconf()
From the log, find
INFO:zeroconf:Address not available when adding XXX.XXX.XX.XX to multicast group, it is expected to happen on some systems
Along with the Zeroconf log, there should be a list of ip addresses and names. Please find the name of the hardware that is causing the problem.
Now, open zeroconf/__init__.py and goto get_all_addresses() and replace the code with below
adapters = [x for x in ifaddr.get_adapters()
if not "Microsoft Wi-Fi Direct Virtual Adapter" in x.nice_name
and not "Bluetooth Device" in x.nice_name]
return list(set(addr.ip for iface in adapters for addr in iface.ips if addr.is_IPv4))
Please replace the "Microsoft Wi-Fi Direct Virtual Adapter" and "Bluetooth Device" with the appropriate name.
This is not a neat way, so I'd be open to better answers.

404 on all assets with Latest odoo 13 image

I created an instance of the latest official odoo image with postgres behind and started using it. After recreation of the container due to odoo config changes I got a 404 on all assets after the recreation of the odoo container, which leads to an empty white page.
So at the moment I can't use odoo anymore.
Any ideas?
This is the output of the odoo container. I get a few of similar cache related exceptions:
2020-08-07 07:58:02,193 1 INFO XXXX
odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/filestore/XXXXXX/02/02141d5e40545807c7f22145c21af626c109ddfb
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 745, in get
value = self._data[field][record._ids[0]]
KeyError: 286
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 996, in
__get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 751, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(286,).datas', None)

How to close Appium driver properly in Python?

I am using Python 3.7 with Appium 1.15.1 on real Android Device.
When my script finish the job, I close the driver with these lines:
if p_driver:
p_driver.close()
but I get this error ouput:
File "C:\Users\Nino\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 688, in close
self.execute(Command.CLOSE)
File "C:\Users\Nino\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Nino\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\errorhandler.py", line 29, in check_response
raise wde
File "C:\Users\Nino\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\errorhandler.py", line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File "C:\Users\Nino\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined
I would like to understand what I am doing wrong?
What is the way to close properly the driver?
Can you help me please?
Step1: you should get the appium session dictionary first:
session_instance = webdriver.Remote(str(url), caps_dic)
where url is your appium server url. something like: "http://127.0.0.1:4723/wd/hub"
and caps_dic is a dictionary of all your desired capabilities
Step2: you run the quit() method on session:
session_instance[session].quit()
So the whole snippet is:
session_instance = webdriver.Remote(str(url), caps_dic)
session_instance[session].quit()

S3cmd not working in ubuntu

I have Installed s3cmd on my machine which is ubuntu 11.10 and when i am trying to download some data from s3 it gives me this error, I have also configure s3cmd with the access keys which i have (.s3cfg file is there in home folder)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the following lines to:
s3tools-bugs#lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Problem: KeyError: 'content-length'
S3cmd: 1.0.0
Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2006, in <module>
main()
File "/usr/bin/s3cmd", line 1950, in main
cmd_func(args)
File "/usr/bin/s3cmd", line 513, in cmd_object_get
response = s3.object_get(uri, dst_stream, start_position = start_position, extra_label = seq_label)
File "/usr/share/s3cmd/S3/S3.py", line 285, in object_get
response = self.recv_file(request, stream, labels, start_position)
File "/usr/share/s3cmd/S3/S3.py", line 691, in recv_file
size_left = int(response["headers"]["content-length"])
KeyError: 'content-length'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the above lines to:
s3tools-bugs#lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Please try a newer version of s3cmd, such as 1.5.0-alpha2 released last night on the s3tools project on SourceForge or in github. In this specific case, you are trying to download a 0-length file, which triggers this bug

Resources