gstreamer write to serial com port on a windows machine - windows

Is there a way to write a video stream to serial com port (i.e. com3, 19200 BAUD) with the gsteamer / gst-launch on a Windows machine ?
pseudo: gst-xxxxx-1.0.exe -v videotestsrc pattern=snow ! video/x-raw,width=320,height=240 ! filesink location=Com3
Clear: On Windows the Com ports are no files in the filesystem.
BR Joe

Related

ffmpeg windows av_interleaved_write_frame(): Operation not permitted failure

I'm trying to share my computer's camera with the remote computer. Local machine is linux(ubuntu 20.04.1) and remote machine is windows 10. I created virtual camera in windows machine with use OBS virtual cam and I want to share camera from local to remote machine. I could start stream from local linux machine and I got stream via windows machine. But when I try to write the stream into the virtual camera(output device), I get the error av_interleaved_write_frame (): Operation not permitted.
The command I wrote on the Windows side is as follows:
ffmpeg.exe -f mpegts -i udp://192.168.5.5:5010 -c:v rawvideo -r 30 -pix_fmt yuyv422 -s 1280x720 -f sdl "OBS-Camera"
The error message is as follows:
Extra Info1: In my experiments, if both the local and remote machines are Linux, it works successfully.
Extra Info2: I can view the stream that I received on windows side(remote) with the command ffplay.exe udp: //192.168.5.5: 5010.
Do you have any suggestion ?

How to read data from serial-to-usb device?

I have a sensor device connected to my Ubuntu 20 machine using a serial to usb cable. I understand that to stream data from it I need to run the following commands:
Enter root with sudo -I.
Setup a virtual COM port with stty -F /dev/ttyACM0 9600 cs8 -cstopb -parenb.
Send a command to the device to initiate data streaming with echo -e "some_string" > /dev/ttyACM0.
Stream data with cat < /dev/ttyACM0.
However, I cannot be sure that my device is connected as /dev/ttyACM0. How can I set this up? Currently it has the path /dev/bus/usb/001/005, although the last number changes every time the device is plugged in.
In response to the comment below, here is the output I get when I disconnect the device and run dmesg | tail (I've edited some real values):
[89092.291151] usb 1-1: USB disconnect, device number 11
[89100.310893] usb 1-1: new full-speed USB device number 12 using xhci_hcd
[89100.467562] usb 1-1: New USB device found, idVendor=SOME_ID, idProduct=SOME_PRODUCT, bcdDevice=SOME_BCD_DEVICE
[89100.467565] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[89100.467567] usb 1-1: Product: SOME_PRODUCT
[89100.467569] usb 1-1: Manufacturer: SOME_MANUFACTURER
EDIT: I have just found that I can use sudo modprobe usbserial vendor=SOME_ID product=SOME_PRODUCT to make ttyUSB0 available. However, plugging this into the above commands and running screen /dev/ttyUSB0 only returns lots of ``` characters. Note that this stops when the device is unplugged.
I managed to get this working. The commands were:
sudo -i
rmmod ftdi_sio
rmmod usbserial
modprobe ftdi-sio
echo -n VENDOR_ID PRODUCT_ID | sudo tee /sys/bus/usb-serial/drivers/ftdi_sio/new_id
stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb
echo -e "uud1\r" > /dev/ttyUSB0
screen /dev/ttyUSB0 9600

How to capture the traffic of Genymotion Emulator with tcpdump?

I have an android device (simulated with Genymotion on top off virtualBox) on my host computer(ubuntu).
which interface I should capture to have both incoming and outgoing traffic of android devices?
Download tcpdump for android from here: https://www.androidtcpdump.com/android-tcpdump/downloads
Use the following commands to setup all the things.
adb root
adb remount
adb push ./tcpdump /system/xbin/tcpdump
ToUse:
adb shell
tcpdump -D
tcpdump -vv -i any -s 0 -w /sdcard/dump.pcap
adb pull /sdcard/dump.pcap .
Then analyze the pcap file in Wireshark if you want.
This answer might help https://stackoverflow.com/a/48062718/20107. It's using Wireshark but it should be easy to adapt to tcpdump.

Streaming windows desktop using gstreamer

I have an customized i.MX6 Board which has a LCD Display connected to it. We have been streaming videos over IP using gstreamer udpsrc/udpsink pipelines..
Pipeline at PC:
C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v filesrc location=C:\\gstreamer\\1.0\\x86_64\\bin\\hash.h264 ! h264parse config-interval=-1 ! rtph264pay pt=96 config-interval=-1 ! udpsink host=<ip address> port=5004 sync=true
Pipeline on i.MX6:
gst-launch -v udpsrc port=5004 ! application/x-rtp, payload=96 ! rtph264depay ! vpudec low-latency=true ! imxv4l2sink sync=false
Is there any way I modify the PC pipeline to get the windows desktop streamed to embedded board display or what are the steps required to stream the windows desktop using gstreamer
The winscreencap plugin (https://github.com/agx/gst-plugins-bad/tree/master/sys/winscreencap) includes two elements for capturing windows desktops - dx9screencapsrc and gdiscreencapsrc.

Cant connect Android Wear Device via bluetooth

I have USB debugging on and I am showing that the Target is connected I however am unable to connect the host.
When I run the below command on my PC I get output indicating that the command is not complete.
adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
Output:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android Studio>adb forward
tcp: 4444 localabstract:/adb-hub;adb connect localhost:4444
Android Debug Bridge version 1.0.31
-a - directs adb to listen on all interfaces for a c
onnection
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
-H - Name of adb server host (default: localhost)
-P - Port of adb server (default: 5037)
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward --list - list all forward socket connections.
the format is a list of lines with the followin
g format:
<serial> " " <local> " " <remote> "\n"
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb forward --no-rebind <local> <remote>
- same as 'adb forward <local> <remote>' but fail
s
if <local> is already forwarded
adb forward --remove <local> - remove a specific forward socket connection
adb forward --remove-all - remove all forward socket connections
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --
iv <hex-encoded iv>] <file>
- push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
('--algo', '--key', and '--iv' mean the file is
encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
[-system|-nosystem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-obb|-noobb enable/disable backup of any insta
lled apk expansion
(aka .obb) files associated with each applic
ation; the default
is noobb.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
For your information, I finally solved the same problem by replacing port 4444 by 5601.
The 2 calls are:
adb forward tcp:5601 localabstract:/adb-hub
and
adb connect localhost:5601
(My Android Wear device is a LG G Watch and my Android tablet is an Asus Nexus 7)
This is easy to solve:
I had the same problem.
Just devide this into two calls.
First enter:
adb forward tcp:4444 localabstract:/adb-hub
hit Enter and after that:
adb connect localhost:4444
Enter and it should connect. If not try first to start the "adb start-server"
try Ip address instead of localhost when connecting
adb forward tcp:4444 localabstract:/adb-hub
adb connect 127.0.0.1:4444
I had this problem as well. After running the above commands in the Command Line, I solved it by activating the Developer Options on my Moto 360 (pressing the build number repeatedly in the settings like the phone). Enabling the ADB and Bluetooth Debugging on the watch and unpairing my watch with my phone.
After I did all these steps my computer finally sent the RSA permissions key for my Android Wear device through my phone.
The Complete solution for this issue..
1. Open Your-sdk-path in Explorer.
2. Open platform-tools.
3. Shift + Rightclick then select Open command window here.
4. adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444 (For Real Device).
5. adb -d forward tcp:5601 tcp:5601 (for EMulator).
Then after connect with emulator in Android wear companion app.
Before Doing step 4 please ensure that debugging over bluetooth is enabled in developer option.
Open Your-sdk-path in Explorer, and then "platform-tools", where it should be your adb.exe , in my case this is ( C:\Users\YourUser\AppData\Local\Android\sdk\platform-tools )
Shift + Rightclick then select Open command window here.
paste "adb forward tcp:4444 localabstract:/adb-hub"
And then paste "adb connect 127.0.0.1:4444" (do not put localhost it is giving problems).
you can check with "adb devices"
I also had issue adb debugging over bluethooth:
Debugging over Bluetooth was always Off for me. Apparently I had to choose a debugging wearable device here:
Android Wear -> Settings (gear icon) -> Debugging over Bluetooth -> Device to Debug
Then all other comments are helpful too.
Tried all of the above, nothing helped.
The one thing that helped me was to restart the phone...

Resources