error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): in function 'cv::icvExtractPattern' - rtsp

I'm trying to publish an RTSP Stream from a Jetson AGX Board using Intel RealSense Cameras and receive the stream on a remote device using Yolov5 (on the same VLAN).
RTSP server is running on the jetson board Simple RTSP (IP Address:10.160.51.19):
docker run --rm -it -e RTSP_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 aler9/rtsp-simple-server
For publishing the Intel RealSense Camera stream on the RTSP Server, I used ffmpeg:
ffmpeg -pix_fmt uyvy422 -i /dev/video6 -video_size 640x320 -f rtsp -framerate 90 rtsp://localhost:8554/mystream
For receiving the stream on the remote computer using yolov5 (on the same VLAN), I used to following:
git clone https://github.com/ultralytics/yolov5.git
cd yolov5
pip install -r requirements.txt
python detect.py --source rtsp://10.160.51.19:8554/mystream
I got the following error in yolov5:
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients [ERROR:0#93.109] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap.cpp (166) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp://10.160.51.19:8554/mystream in function 'cv::icvExtractPattern' Traceback (most recent call last): File "C:\Users\5G\yolov5\detect.py", line 252, in main(opt) File "C:\Users\5G\yolov5\detect.py", line 247, in main run(**vars(opt)) File "C:\Users\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "C:\Users\5G\yolov5\detect.py", line 100, in run dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt) File "C:\Users\5G\yolov5\utils\datasets.py", line 328, in init assert cap.isOpened(), f'{st}Failed to open {s}' AssertionError: 1/1: rtsp://10.160.51.19:8554/mystream... Failed to open rtsp://10.160.51.19:8554/mystream
IMPORTANT NOTE:
Please note that when I publish the RTSP stream on other Linux machines (POP!_OS), the error doesn't occur and I'm able to receive the stream in Yolov5.
The above photo shows the stream can be viewed using Yolov5 locally(Linux) and remote (windows terminal) when the stream is published from Pop!_OS.
Even though both operating systems run on Debian Ubuntu, I'm getting the error in the Jetson AGX running Tegra, not Pop!_OS.
Thank you

Related

RabbitMQ fails to startup when I start a docker container

I have installed RabbitMQ inside a docker container on Ubuntu 20.04 using the following steps: https://computingforgeeks.com/how-to-install-latest-rabbitmq-server-on-ubuntu-linux/
It works as expected and I can use it in a sample python program.
After installation I exit the container and save it to a new docker image using:
docker commit *my_container_id* *my_new_container_name*
docker save -o image_with_rabbitmq.tar *my_new_container_name*
I then load this new image and run it like so:
docker load -i image_with_rabbitmq.tar
docker run --rm --gpus all -it *my_image_id*
But now I find that I cannot start or use rabbitmq anymore. I get the following error:
service rabbitmq-server status
Distribution failed: {{:shutdown, {:failed_to_start_child, :net_kernel, {:EXIT, :nodistribution}}}, {:child, :undefined, :net_sup_dynamic, {:erl_distribution, :start_link, [[:"rabbitmqcli-184-rabbit#231b2003671d", :shortnames, 15000], false, :net_sup_dynamic]}, :permanent, false, 1000, :supervisor, [:erl_distribution]}}
Here is the startup log message:
cat /var/log/rabbitmq/startup_err
BOOT FAILED
===========
Exception during startup:
error:{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel, {'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_9642#localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}
rabbit_prelaunch_dist:duplicate_node_check/1, line 78
rabbit_prelaunch_dist:setup/1, line 23
rabbit_prelaunch:do_run/0, line 115
rabbit_prelaunch:run_prelaunch_first_phase/0, line 32
supervisor:do_start_child_i/3, line 414
supervisor:do_start_child/2, line 400
supervisor:-start_children/2-fun-0-/3, line 384
supervisor:children_map/4, line 1250
Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_9642#localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}})
Crash dump is being written to: erl_crash.dump...done
How can I ensure this starts up properly when my container starts?

What's the problem with serial connection in the following code (running on Raspberry Pi 4, Raspbian OS)?

this serial connection thing on RPi should not be this challenging, though right now I'm facing something quite weird
This is the code:
.
.
import serial
.
.
ser=serial.Serial(
port='/dev/ttyUSB0',
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
.
.
The Error is:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyUSB0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Desktop/rtu-v4/dnp3/rtu.py", line 27, in <module>
timeout=1
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
I alraedy checked out:
https://www.raspberrypi.org/forums/viewtopic.php?t=224369
https://github.com/brendan-w/python-OBD/issues/137
and ran the following commands in terminal:
sudo pip3 uninstall serial
sudo pip3 install pyserial
The Device is a Raspberry Pi 4
Any Help would be appreciated.
Thnx.
The message "No such file or directory: '/dev/ttyUSB0'" means that you do not have a device conected to you USB0.
You can use the command:
lsusb
to find out which ports are available and then change in you code de USB name to connect with the rigth device.
Since you are trying to communicate (I assume) with a USB to serial adapter, you can use dmesg to get the device that it is attached to the ttyUSB0.
In a terminal type this command:
dmesg|grep ttyUSB*
It will print out all the devices that are attached to all ttyUSBs.
In my case the result is:
[ 5072.316991] usb 3-1: ch341-uart converter now attached to ttyUSB0
If there were more devices connected, the result would have listed ttyUSB1/2..etc.
Should you disconnect the device, running the same command in a terminal will show the disconnection message:
dmesg|grep ttyUSB*
[ 5361.353142] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

Modbus cant read data from epever tracer 1210a to raspberry

i want to make a monitoring program for tracer
i use rs485 usb converter to connect epever tracer1210a to raspberry pi 3 model b
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
client = ModbusClient(method = 'rtu', port = '/dev/ttyACM0', baudrate = 115200)
client.connect()
print( client)
result = client.read_input_registers(0x3100,6,unit=1)
print (result)
solarVoltage = float(result.registers[0] /100.0)
solarCurrent = float(result.registers[1] /100.0)
batteryVoltage = float(result.registers[4] /100.0)
chargeCurrent = float(result.registers[5] /100.0)
print("solar voltage : ",solarVoltage)
print("solar current : ",solarCurrent)
print("battery volatage : ",batteryVoltage)
print("charge current : ",chargeCurrent)
client.close()
and i get error like this:
ModbusSerialClient(rtu baud[115200])
Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)
Traceback (most recent call last):
File "yutub.py", line 9, in
solarVoltage = float(result.registers[0] /100.0)
AttributeError: 'ModbusIOException' object has no attribute 'registers'
please help me to fix this problem
I had faced the same problem.
Follow the below steps to fix the issue:
git clone https://github.com/kasbert/epsolar-tracer/tree/master/xr_usb_serial_common-1a
Follow the installation steps from Readme.
You might face problem when you execute make. In such case do sudo apt-get install linux-headers.
Check that the USB UART is detected by the system
lsusb
Check that the CDC-ACM driver was not installed for the Exar USB UART
ls /dev/tty*
To remove the CDC-ACM driver and install the driver:
sudo rmmod cdc-acm
sudo modprobe -r usbserial
sudo modprobe usbserial
sudo insmod ./xr_usb_serial_common.ko
After this when you do ls /dev/tty* you will see /dev/ttyXRUSB0. This means the driver is installed and you are in good shape.
Change the port in your code to '/dev/ttyXRUSB0'.
See the output image
After you restart the PI you might not see the ttyXRUSB0 instead you will see ttyACM0. In such case execute sudo echo blacklist cdc-acm > /etc/modprobe.d/blacklist-cdc-acm.conf. If PI does not allow you to execute then create the file in the path and write blacklist cdc-acm.
Reboot and verify if ttyACM0 is still displayed in ls /dev/tty*.

BlueZ 5 - Connecting to a Bluetooth LE heart rate watch

I'm pretty much new to using BlueZ 5 and I've been experimenting with a Bluetooth LE heart rate watch. I would really appreciate if someone can point me to the right direction.
When I run the "test-heartrate" test, I see the following error:
Traceback (most recent call last):
File "./test-heartrate", line 88, in <module>
properties = dev_prop.GetAll(HEARTRATE_INTERFACE)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line
651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs:
No such interface 'org.bluez.HeartRate1'
Not sure what I'm doing wrong. Here're some relevant information
BlueZ version installed: 5.24
For installation, I followed the steps listed in: http://www.linuxfromscratch.org/blfs/view/svn/general/bluez.html (with one addition: I added --enable-experimental during configuration)
It seems I'm facing the same issue as described at:
http://comments.gmane.org/gmane.linux.bluez.kernel/47931
I've followed the suggestion provided as well as tried passing -E to
bluetoothd while running it but to no avail.
I can successfully run:
test-discovery : To discover devices, including the heart-rate watch
test-device connect : To connect to this device
But the one that is failing for me is test-heartrate
Even after connecting to the device, when I try to introspect:
dbus-send --system --dest=org.bluez --print-reply [obj_path] org.freedesktop.DBus.Introspectable.Introspect, I don't see the
org.bluez.HeartRate1 interface showing up, with its appropriate methods.
I can post the entire introspection data, along with the device properties that I get, if that helps.
Would really appreciate any helpful pointer in this regard. Thanks!!

cygwin rsync between local disks fails with rsync error: error in rsync protocol data stream (code 12)

I'm using cygwin rsync to backup my local disk to a USB 3.0 external disk. Frequently, the process fails with the following error:
alex/Pictures/AppData/Lightroom/Current
Db/Lightroom
Previews.lrdata/0/03E9/03E9CB0E-96B7-4602-BBAE-CBF820381731-514d8ee17112aeee3852fda5392a8ee8.lr-preview.noindex
rsync: writefd_unbuffered failed to write 4092 bytes to socket
[sender]: Software caused connection
abort (113)
rsync: connection unexpectedly closed (35523 bytes received so far)
[sender]
rsync error: error in rsync protocol data stream (code 12) at
/home/lapo/package/rsync-3.0.8-1/src/rsync-3.0.8/io.c(601)
[sender=3.0.8]
Traceback (most recent call last):
File "simpleBackupTest.py", line 23, in <module>
subprocess.check_call(rsyncCommand,
shell=True)
File "/usr/lib/python2.6/subprocess.py",
line 498, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'rsync -v
--log-file=/cygdrive/c/data/logs/rsync/rsync_backup_task.log
-a /cygdrive/c/Users/ /cygdrive/j/backup/Users' returned
non-zero exit status 12
The local disk seems to be available before & after this error, so I don't think its the drive being disconnected.
Any ideas what could be causing this?

Resources