ADB connect to <IP> not working anymore or endless install process - android-studio

I have a MacBook Pro 16 and Galaxy S10 combo and I used "wifi adb" over month by "WIFI ADB ULTIMATE" plugin, but once it broken and I can't connect to my device. I restarted the MB and the S10 many many times, I tried suggested solutions from other post but no final solution.
When I used "adb usb..." solution then I could connect but when I removed usb cable then I got an endless install process. I use same wifi on both devices.
$ adb kill-server && adb start-server && adb tcpip 5555 && adb connect 192.168.68.103
* daemon not running; starting now at tcp:5037
* daemon started successfully
restarting in TCP mode port: 5555
connected to 192.168.68.103:5555
For example I could connect but when I unplugged the usb cable I got this:
The android studio see the device (toolbar) but waiting for it.
So it's working only with USB cable.

Related

Bluez fails on Raspberry Pi running Jessie Headless

I've run out of tutorials and tricks that worked for others but not for me.
I'm trying to pair a remote bluetooth speaker with my PI Zero.
When I attempt to connect I get the error message:
[bluetooth]# connect XX:XX:XX:XX:XX:XX
Attempting to connect to XX:XX:XX:XX:XX:XX
Failed to connect: org.bluez.Error.Failed
[bluetooth]#
And the log reports:
org.bluez.Manager.GetProperties() failed:
org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with
signature "" on interface "org.bluez.Manager" doesn't exist
I have no idea where to begin addressing that. The logs also report
Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported:
Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
and
a2dp-sink profile connect failed for XX:XX:XX:XX:XX:XX: Protocol not
available a2dp-source profile connect failed for XX:XX:XX:XX:XX:XX:
Protocol not available
I'm sure there's useful information in there but every time I think I've googled a solution I'm disappointed. Moving the load of the discoverable module until after X11 load didn't work. Purging pulseaudio and reinstalling it didn't help. Any ideas?
Somewhere on some thread someone said that Pulseaudio had to be version 6.0 or greater, which led me down the rabbit hole of installing version 7, which broke on Jessie due to incompatible dependencies.
Ultimately I purged the following:
apt-get purge pulseaudio pulseaudio-module-bluetooth libpulse0
And reinstalled
apt-get install pulseaudio pulseaudio-module-bluetooth
I then unpaired the Alexa from the pi via the Alexa app on my phone
and ran
bluetoothctl
[bluetooth]# remove XX:XX:XX:XX:XX:XX
Reboot and voilĂ , Pulseaudio running and paired on the Pi and working! Only issue I have now is that I can't seem to get it to start automatically on boot. I've added to /etc/rc.local:
su -c 'pulseaudio --start' - pi
echo connect XX:XX:XX:XX:XX:XX | bluetoothctl
su -c 'pacmd set-card-profile bluez_card.68_54_FD_82_A9_BF a2dp' - pi
Well, to be precise, it pairs automatically on boot, but then drops out. If I manually run
pulseaudio --start
and
bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# connect XX:XX:XX:XX:XX:XX
Then all works fine, stays rock solid. Despite the fact that I STILL have these error messages in the log:
cat /var/log/syslog | grep dbus
org.bluez.Manager.GetProperties() failed:
org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with
signature "" on interface "org.bluez.Manager" doesn't exist
Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported:
Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Bluetooth LE on Raspbian does not bond with nRF

I have an Rpi3 and I want to bond it with nRF which is connected to my laptop via UART. This nRF-laptop connection shows me whether Rpi3 is connected and/or paired with nRF. I am able to connect to the nRF device by running:
gatttool -t random -b XX:XX:XX:XX:XX:XX -I
I found that to be able to pair it, all I need to do is run the following command after I connected using gattool:
sec-level medium
However, nRF device only showed "Connected".
Then I tried using bluetoothctl command. I made sure the power is on, agent is on, it's discoverable and etc. After I ran the command pair XX:XX:XX:XX:XX:XX, it said it was successful. This was also confirmed after running info XX:XX:XX:XX:XX:XX. Yet nRF device did not react to the pairing. If I connect to nRF device through my phone using "nRF Connect" app, then nRF shows that my phone is paired.
I am running:
Linux 4.9.13-v7+ #974 SMP Wed Mar 1 20:09:48 GMT 2017 armv7l GNU/Linux
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
Bluez-5.44
I followed tutorials from adafruit and stackoverflow. I read that for Bluez-5.44 I do not need to run bluetooth in the experimental mode.
What am I missing? I would appreciate any help.
To any lost souls who might have also been stuck in this situation, here is how I solved it (you need to run sudo for the following commands):
$ service bluetooth stop
$ /etc/init.d/bluetooth start
If the nRF device has been paired once and then restarted, that means the pairing key is still on Pi's side which needs to be removed and can be done by:
$ bluetoothctl
$ remove XX:XX:XX:XX:XX:XX
$ exit
After this you need to start bluetooth device:
$ hciconfig hci0 up

bluetooth pairing and connection from command line

I want to connect and pair to available nearby bluetooth devices from command line in linux.
I have searched through internet, and found that we can pair through simple-agent, but it is not available in my device.
following commands are available in device:
hcitool, hciconfig, hcidump, sdptool, l2ping, rfcomm.
for connecting to remote device i am running the following command.
hcitool cc BD_ADDRESS
but above command is connecting the device for a while, and again the device is getting disconnected. in hcidump output , i am seeing the disconnection event. Is there anyway in linux command line through which i can test my bluetooth? What can be the reason for device is getting disconnected after a while?
I saw the same issue once and was able to solve it with the rfcomm command. Try the following:
# rfcomm connect /dev/rfcomm0 00:11:22:33:44:55 1 &
Additionally, it is good practice to enable secure simple pairing and enable page and inquiry scan with the following commands:
# hciconfig hci0 sspmode 1
# hciconfig hci0 piscan
Let me know if you still have problems.

Raspberry Pi Bluetooth LE connection to RedBearLab shield

I am trying to connect to RedBearLab BLE shield from RaspPi. I am using
CSR4.0 USB dongle http://www.adafruit.com/products/1327
Raspberry Pi Rev-B board with Raspbian OS
Bluez-5.11
I have the RedBearLab BLE shield connected to Arduino UNO R3. I am trying to connect to the shield from the RaspPi(attached CSR4.0). But it can't connect - connection attempts time out/resource busy.
Below steps I use
$ sudo hcitool lescan
LE Scan ...
xx:xx:xx:xx:xx:xx BLE Shield
$ sudo hcitool lecc xx:xx:xx:xx:xx:xx
Could not create connection: Connection timed out
Using gatttool doesn't solve the problem either
$ sudo gatttool -b xx:xx:xx:xx:xx:xx --interactive
[ ][xx:xx:xx:xx:xx:xx][LE]> **connect**
Attempting to connect to xx:xx:xx:xx:xx:xx
Error: connect error: Device or resource busy (16)
[xx:xx:xx:xx:xx:xx][LE]>
Thanks a bunch!
Seems like your adapter is busy. Something is using it. Is there any other device connected to your adapter? Try resetting your adapter with:
$ sudo hciconfig hci0 reset
Some BLE devices require a random address at connection time. Try:
sudo gatttool -t random -b xx:xx:xx:xx:xx:xx --interactive

How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)?

I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303.
I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
$ sudo minicom --device /dev/ttyUSB0
minicom: cannot open /dev/ttyUSB0: No such file or directory
$ sudo lsusb -v
Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
bLength 18
bDescriptorType 1
$ tail /var/log/syslog #then removed and attached the device.
Mar 13 23:31:49 ubuntu kernel: [807996.786805] usb 2-1: pl2303 converter now attached to ttyUSB0
Mar 13 23:34:44 ubuntu kernel: [808172.155129] usb 2-1: USB disconnect, address 7
Mar 13 23:34:44 ubuntu kernel: [808172.156321] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
Mar 13 23:34:44 ubuntu kernel: [808172.156374] pl2303 2-1:1.0: device disconnected
Mar 13 23:34:52 ubuntu kernel: [808179.497856] usb 2-1: new full speed USB device using uhci_hcd and address 8
Mar 13 23:34:52 ubuntu kernel: [808179.785845] pl2303 2-1:1.0: pl2303 converter detected
Mar 13 23:34:52 ubuntu kernel: [808179.872309] usb 2-1: pl2303 converter now attached to ttyUSB0
First check with dmesg | grep tty if system recognize your adapter.
Then try to run minicom with sudo minicom -s, go to "Serial port setup" and change the first line to /dev/ttyUSB0.
Don't forget to save config as default with "Save setup as dfl". It works for me on Ubuntu 11.04 on VirtualBox.
You will need to set the permissions every time you plug the converter in.
I use PuTTY to connect. In order to do so, I have created a little Bash script to sort out the permissions and launch PuTTY:
#!/bin/bash
sudo chmod 666 /dev/ttyUSB0
putty
P.S. I would never recommend that permissions are set to 777.
Long time reader, first time helper ;)
I'm going through the same hellish experience here with a Prolific USB <> Serial adapter and so far Linux is the easiest to get it to work.
On CentOS, I didn't need to install any drivers etc.. That said,
dmesg | grep -i tty or dmesg | grep -i usb showed me /dev/ttyUSB0.
screen ttyUSB0 9600 didn't do the trick for me like it did in OSX
minicom is new to me but it was complaining about lack of /dev/modem
However, this helped: https://www.centos.org/forums/viewtopic.php?t=21271
So install minicom (yum install minicom) then enter its settings (minicom -s).
Then select Serial Port Setup and change the Serial Device (Option A) to /dev/ttyUSB0, or whatever your device file is as it slightly differs per distro.
Then change the Bps (Option E) to 9600 and the rest should be default (8N1 Y N)
Save as default, then simply minicom and Bob's your uncle.
HTH.
The serial port communication programs moserial or gtkterm provide an easy way to check connectivity and modify /dev/ttyUSB0 (or /dev/ttyUSB1!) settings. Even though there maybe only a single USB to RS232 adapter, the n designation /dev/ttyUSBn can and does change periodically! Both moserial and gtkterm will show what port designation is relevant in their respective pull down menus when selecting an appropriate port to use.
Check out help.ubuntu.com/community/Minicom for details on minicom.
I had fix this with adduser *username* dialout. I never had this error again, even though previously the only way to get it to work was to reboot the PC or unplug and replug the usb to serial adapter.
I get get the same minicom error, "cannot open /dev/ttyUSB0: No such file or directory"
Three notes:
I get the error when the device attached to the serial port end of my Prolific Technology PL2303 USB/Serial adapter is turned off. After turning on the device (an embedded controller running Linux) minicom connected fine.
I have to run as super user (i.e. sudo minicom)
Sometimes I have to unplug and plug back in the USB-to-serial adapter to get minicom to connect to it.
I am running Ubuntu 10.04 LTS (Lucid Lynx) under VMware (running on Windows 7). In this situation, make sure the device is attached to VM operating system by right clicking on the USB/Serial USB icon in the lower right of the VMware window and select Connect (Disconnect from Host).
Remember to press Ctrl + A to get minicom's prompt, and type X to exit the program. Just exiting the terminal session running minicom will leave the process running.
I had the exact same problem, and it was fixed by doing a chmod 777 /dev/ttyUSB0. I never had this error again, even though previously the only way to get it to work was to reboot the VM or unplug and replug the USB-to-serial adapter. I am running Ubuntu 10.04 (Lucid Lynx) VM on OS X.
I suggest that newbies connect a PL2303 to Ubuntu, chmod 777 /dev/ttyUSB0 (file-permissions) and connect to a CuteCom serial terminal. The CuteCom UI is simple \ intuitive. If the PL2303 is continuously broadcasting data, then Cutecom will display data in hex format
I just got my GUC232A cable with a molded-in PL2302 converter chip.
In addition to adding myself and br to group dialout, I found this helpful tip in the README.Debian file in /usr/share/doc/bottlerocket:
This package uses debconf to configure the /dev/firecracker symlink,
should you need to change the symlink in the future run this command:
dpkg-reconfigure -pmedium bottlerocket
That will then prompt you for your new serial port and modify the
symlink. This is required for proper use of bottlerocket.
I did that and voila! bottlerocket is able to communicate with my X-10
devices.
Putty on ubuntu
There is no need to install the driver for PL2303
So only type the command to enable the putty
Sudo chmod 666 /dev/ttyUSB0
Done
Open the putty.

Resources