openvino crashes after running inference some seconds in raspberry pi 4 - python-3.x

I tried to use Intel Neural Compute Stick 2 as an inference engine for my smart car.
I installed l_openvino_toolkit_runtime_raspbian_p_2019.2.242.tgz followed by this link, and run the code for testing.
Everything was fine at the beginning of 10 - 20 seconds(sometimes less, sometimes longer), Then crashed with the following errors:
E: [xLink] [ 327401] [EventRead00Thr] dispatcherEventReceive:336 dispatcherEventReceive() Read failed (err -4) | event 0xaf1fdddc XLINK_READ_REL_REQ
E: [xLink] [ 327401] [EventRead00Thr] eventReader:223 eventReader thread stopped (err -4) E: [xLink] [ 327402] [python3] XLinkReadDataWithTimeOut:1323 Event data is invalid
E: [ncAPI] [ 327402] [python3] ncFifoReadElem:3445 Packet reading is failed. terminate called after throwing an instance of 'InferenceEngine::details::InferenceEngineException'
what(): Failed to read output from FIFO: NC_ERROR
Aborted
I tried to insert it into the USB hub with a self-power adapter, but it still got the same errors.
I also tried to insert it into the USB2.0, but still not working.
I checked out the dmesg, I found the Intel Neural Compute Stick 2 will be auto-mounted when I called net.forward() at some point.
I got dmesg information by following steps:
check the ncs2 device is ok(I can find the device) before running the code.
clear dmesg
running the code
waiting for it crashed. then, check out the dmesg.
the dmesg showing:
[87255.685160] usb 1-1.1: USB disconnect, device number 25
[87255.831256] usb 2-1: new SuperSpeed Gen 1 USB device number 18 using xhci_hcd
[87255.861963] usb 2-1: New USB device found, idVendor=03e7, idProduct=f63b, bcdDevice= 1.00
[87255.861970] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[87255.861975] usb 2-1: Product: VSC Loopback Device
[87255.861980] usb 2-1: Manufacturer: Intel Corporation
[87255.861985] usb 2-1: SerialNumber: 41440410119541BC00
[87280.181479] usb 1-1.1: new high-speed USB device number 26 using xhci_hcd
[87280.312042] usb 1-1.1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[87280.312048] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[87280.312053] usb 1-1.1: Product: Movidius MyriadX
[87280.312058] usb 1-1.1: Manufacturer: Movidius Ltd.
[87280.312063] usb 1-1.1: SerialNumber: 03e72485
[87280.691784] usb 2-1: USB disconnect, device number 18
My environment is:
Raspberry Pi 4 (4GB)
Raspbian Buster
I have debugged it serval days, but have no idea to solve this problem.
Is there anything I missed?
Thanks!

The error seems to be related to the NCS2 device being reset for inference and fail to initialize during runtime. Verify you have added the USB Rules for the Intel® Neural Compute Stick 2 device by performing the following steps.
Add the current Linux user to the users group:
$ sudo usermod -a -G users "$(whoami)"
Log out and log in for it to take effect.
Run setupvars.sh again after logging in:
$ source /opt/intel/openvino/bin/setupvars.sh
Install the USB rules running the install_NCS_udev_rules.sh script:
$ sh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh
Proceed to run the demo application:
$ python3 SingleStickSSDwithUSBCamera_OpenVINO_NCS2.py
Note the l_openvino_toolkit_runtime_raspbian_p_2019.2.242 is now quite outdated, and there have been newer software packages released. Checkout the OpenVINO™ Toolkit packages storage for the most recent release available (at the time of this post, 2021.4.1 - l_openvino_toolkit_runtime_raspbian_p_2021.4.689.tgz).
I've executed the demo application you listed with OpenVINO 2021.4.1 for longer than 10 minutes and the error can't reproduce:

Related

Raspberry Pi Pico doesn't create tty file

I've been using Raspberry Pi Pico for some time already and I'm using minicom for serial communication. But one day Pico stopped generating tty/ATCM0 when connected to USB port. Before this everything worked perfectly fine.
I can still upload software and it's executing, but there's no serial communication because of it.
I've tried switching USB ports, uploading software that worked fine before and I even bought new Pico, as I suspected a hardware issue, but it still didn't help. My best guess is that there's something wrong with USB drivers, though I don't remember doing anything to them.
I've checked /dev for new tty files when connecting Pico, but nothing appears.
dmesg output after connecting Pico:
[ 2418.974093] usb 3-2: new full-speed USB device number 28 using xhci_hcd
[ 2434.570047] usb 3-2: device descriptor read/64, error -110 // <-- Warning
dmesg output after connecting in BOOTLOADER mode and uploading file
[ 2901.230259] usb 3-2: new full-speed USB device number 30 using xhci_hcd // <-- connected as BOOTLOADER
[ 2901.397715] usb 3-2: New USB device found, idVendor=2e8a, idProduct=0003, bcdDevice= 1.00
[ 2901.397726] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2901.397729] usb 3-2: Product: RP2 Boot
[ 2901.397732] usb 3-2: Manufacturer: Raspberry Pi
[ 2901.397735] usb 3-2: SerialNumber: E0C912D24340
[ 2901.399735] usb-storage 3-2:1.0: USB Mass Storage device detected
[ 2901.399885] scsi host2: usb-storage 3-2:1.0
[ 2902.412571] scsi 2:0:0:0: Direct-Access RPI RP2 1 PQ: 0 ANSI: 2
[ 2902.413038] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 2902.413315] sd 2:0:0:0: [sdb] 262144 512-byte logical blocks: (134 MB/128 MiB)
[ 2902.413731] sd 2:0:0:0: [sdb] Write Protect is off
[ 2902.413734] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 2902.415755] sd 2:0:0:0: [sdb] No Caching mode page found // <-- Warning
[ 2902.415761] sd 2:0:0:0: [sdb] Assuming drive cache: write through // <-- Warning
[ 2902.424350] sdb: sdb1
[ 2902.427764] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 2907.724687] usb 3-2: USB disconnect, device number 30 // <-- uploaded uf2 file
[ 2907.725456] blk_update_request: I/O error, dev sdb, sector 260 op 0x1:(WRITE) flags 0x100000 phys_seg 1 prio class 0 // <-- Warning
[ 2907.725471] Buffer I/O error on dev sdb1, logical block 259, lost async page write // <-- Warning
[ 2907.733492] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty // <-- Warning
[ 2908.102068] usb 3-2: new full-speed USB device number 31 using xhci_hcd
[ 2923.530076] usb 3-2: device descriptor read/64, error -110 // <-- Warning
lsusb -tv lists these two entries only when Pico is in BOOTLOADER mode:
...
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 2: Dev 35, If 0, Class=Mass Storage, Driver=usb-storage, 12M
ID 2e8a:0003
|__ Port 2: Dev 35, If 1, Class=Vendor Specific Class, Driver=, 12M
ID 2e8a:0003
...

Adalm Pluto works on Ubuntu but NOT on Ubuntu Server 20.04 LTS

I'm running ubuntu server and have tried installing libiio packages from both source and apt-get repositories. I can detect the adalm pluto sdr device with iio_info -s (as root because I have not installed the udev rules) but it does not assume an ip address (e.g. 192.168.2.1) like it does on ubuntu 20.04 LTS.
>iio_info -s
Library version: 0.19 (git tag: v0.19)
Compiled with backends: local xml ip usb serial
Available contexts:
0: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial=104473b04a060006ffff1c00dd1f8473f8 [usb:3.2.5]
I've followed the instructions here: https://wiki.analog.com/university/tools/pluto/drivers/linux
The output of dmesg when the pluto is plugged in is this:
[380299.366375] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[380299.520117] usb 3-1: New USB device found, idVendor=0456, idProduct=b673, bcdDevice= 4.19
[380299.520120] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[380299.520122] usb 3-1: Product: PlutoSDR (ADALM-PLUTO)
[380299.520123] usb 3-1: Manufacturer: Analog Devices Inc.
[380299.520124] usb 3-1: SerialNumber: 104473b04a060006ffff1c00dd1f8473f8
[380299.553556] usb-storage 3-1:1.2: USB Mass Storage device detected
[380299.555040] scsi host4: usb-storage 3-1:1.2
[380299.555206] usbcore: registered new interface driver usb-storage
[380299.555732] cdc_acm 3-1:1.3: ttyACM0: USB ACM device
[380299.558342] usbcore: registered new interface driver cdc_acm
[380299.558344] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[380299.560691] usbcore: registered new interface driver uas
[380299.569781] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[380299.570205] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[380299.574968] usbcore: registered new interface driver cdc_ether
[380299.578953] rndis_host 3-1:1.0 eth0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, 00:e0:22:81:0c:b6
[380299.579489] usbcore: registered new interface driver rndis_host
[380299.583238] usbcore: registered new interface driver rndis_wlan
[380299.595374] rndis_host 3-1:1.0 enx00e022810cb6: renamed from eth0
[380300.582838] scsi 4:0:0:0: Direct-Access Linux File-Stor Gadget 0419 PQ: 0 ANSI: 2
[380300.583349] sd 4:0:0:0: Attached scsi generic sg1 type 0
[380300.584030] sd 4:0:0:0: [sdb] 61441 512-byte logical blocks: (31.5 MB/30.0 MiB)
[380300.584266] sd 4:0:0:0: [sdb] Write Protect is off
[380300.584274] sd 4:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[380300.584510] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[380300.607978] sdb: sdb1
[380300.623364] sd 4:0:0:0: [sdb] Attached SCSI removable disk
This is not consistent with what the guide shows from analog devices' wiki.
I'm at a loss here as to what I'm doing wrong. The device shows up and I have the drivers and required kernel modules (I check with lsmod). Any ideas on what would make this work in ubuntu but not ubuntu server.

QCA9377 not coming up with ath10k

Device Model : Linksys WUSB6100M |
Kernel : 4.14.0-rc5-wt-ath+, 4.2 |
Backports version : 4.14-rc4, 4.14-rc5
Kernel Source : https://github.com/erstrom/linux-ath
Am trying to bringup the above specified USB card with ath10k driver. After reading the FW files am getting the following logs.
[ 6218.904243] usb 2-1.4: new high-speed USB device number 14 using ehci-pci
[ 6219.014440] usb 2-1.4: New USB device found, idVendor=13b1, idProduct=0042
[ 6219.014446] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 6219.014450] usb 2-1.4: Product: USBWLAN
[ 6219.014454] usb 2-1.4: Manufacturer: Qualcomm Atheros
[ 6219.014457] usb 2-1.4: SerialNumber: 12345678
[ 6219.015314] usb 2-1.4: WARNING: ath10k USB support is incomplete, don't expect anything to work!
[ 6219.015672] usb 2-1.4: Direct firmware load for ath10k/pre-cal-usb-2-1.4.bin failed with error -2
[ 6219.015695] usb 2-1.4: Direct firmware load for ath10k/cal-usb-2-1.4.bin failed with error -2
[ 6219.016134] usb 2-1.4: qca9377 hw1.1 target 0x05020001 chip_id 0x00000000 sub 0000:0000
[ 6219.016138] usb 2-1.4: kconfig debug 1 debugfs 1 tracing 0 dfs 0 testmode 0
[ 6219.017441] usb 2-1.4: firmware ver WLAN.TF.1.0-00002-QCATFSWPZ-5 api 6 features ignore-otp crc32 c3e0d04f
[ 6219.055734] usb 2-1.4: board_file api 1 bmi_id N/A crc32 544289f7
[ 6221.308242] usb 2-1.4: Service connect timeout
[ 6221.308252] usb 2-1.4: Invalid resp message ID 0x1
[ 6221.308257] usb 2-1.4: failed to connect htt (-71)
[ 6221.412265] usb 2-1.4: could not init core (-71)
[ 6221.412358] usb 2-1.4: could not probe fw (-71)
If anyone experienced and fixed this issue please share the details.
Else if anyone aware of the driver and kernel version please suggest that.
Thanks ,
Vikas

Arduino to Ubuntu USB connection

I am having trouble getting an Ubuntu device to connect to an Arduino Uno. Before I begin talking about the device in question the Arduino is communicating correctly with my Windows pc, and also an Ubuntu VM on that PC.
The device in question is an nVidia Jetson TX2. The Arduino IDE is installed, and when run using sudo the only serial port available is /dev/ttyS0.
The following line is lsusb being run and it detecting the Arduino.
Bus 001 Device 008: ID 2341:0001 Arduino SA Uno (CDC ACM)
The following lines is the output from dmesg from the time that the Arduino is connected.
[ 6609.813385] usb 1-2.3: new full-speed USB device number 13 using xhci-tegra
[ 6609.923568] usb 1-2.3: New USB device found, idVendor=2341, idProduct=0001
[ 6609.930495] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 6609.938049] usb 1-2.3: Product: Arduino Uno
[ 6609.942268] usb 1-2.3: Manufacturer: Arduino (www.arduino.cc)
[ 6609.948065] usb 1-2.3: SerialNumber: 7563830333735121D160
[ 6609.953998] usb 1-2.3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
And lastly the following is the output from ls -a /dev/tty*
/dev/tty /dev/tty18 /dev/tty28 /dev/tty38 /dev/tty48 /dev/tty58 /dev/ttyS1
/dev/tty0 /dev/tty19 /dev/tty29 /dev/tty39 /dev/tty49 /dev/tty59 /dev/ttyS2
/dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6 /dev/ttyS3
/dev/tty10 /dev/tty20 /dev/tty30 /dev/tty40 /dev/tty50 /dev/tty60 /dev/ttyTHS1
/dev/tty11 /dev/tty21 /dev/tty31 /dev/tty41 /dev/tty51 /dev/tty61 /dev/ttyTHS3
/dev/tty12 /dev/tty22 /dev/tty32 /dev/tty42 /dev/tty52 /dev/tty62
/dev/tty13 /dev/tty23 /dev/tty33 /dev/tty43 /dev/tty53 /dev/tty63
/dev/tty14 /dev/tty24 /dev/tty34 /dev/tty44 /dev/tty54 /dev/tty7
/dev/tty15 /dev/tty25 /dev/tty35 /dev/tty45 /dev/tty55 /dev/tty8
/dev/tty16 /dev/tty26 /dev/tty36 /dev/tty46 /dev/tty56 /dev/tty9
/dev/tty17 /dev/tty27 /dev/tty37 /dev/tty47 /dev/tty57 /dev/ttyS0
I don't believe that a driver is being called to create /dev/ttyACM0 but I am not sure how to solve this issue. Any help would be great! Let me know if I need to update with the output from any other commands.
You haven't posted what the error is but I'm guessing it is an access type error, have you done the part at the end of the install for linux?
At the end of https://www.arduino.cc/en/Guide/Linux there is section on permissions for the serial port.

Raspberry Pi USB to serial - multiple ACM0 devices spawning

I am trying to get a Raspberry Pi running Octoprint (a kind of 3D print server) to talk to my Lulzbot Kittaz (RAMBo controller board, an Arduino Mega derivative), but something keeps creating bogus serial ports that seem to be getting in the way.
Here's what I know:
I try and connect over USB and here is the error message I get in the octoprint console:
Error: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Further googling has lead me to SSH in to the pi and run
dmesg | grep tty
and I get:
[ 6.117809] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 28.949094] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 35.389154] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 36.119582] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
... on and on
[ 146.219829] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 156.209130] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 166.450016] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 167.590072] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
If I reboot the pi, without the printer connected, the output is:
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0x10 bcm2708.serial=0x6024d696 smsc95xx.macaddr=B8:27:EB:24:D6:96 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 0.001437] console [tty1] enabled
[ 0.646366] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3
[ 1.033111] console [ttyAMA0] enabled
As soon as I connect the printer to the RasPi, ACM0 and sometimes ACM1 devices start spawning, with a new one appearing every 3-10 seconds. Which seems like that would be a problem for a USB to serial connection. I'm guessing this is the problem. Any ideas on what could be causing it?
Here's what I've done so far:
Disabled getty
Gotten the printer to work with another (lost) install of octopi in the same hardware
Re-installed octopi 3 times
Gotten the printer to connect to my Windows machine
Re-uploaded the firmware to the printer

Resources