Bluetooth watch keeps on disconnecting and connecting in Raspberry PI? - raspberry-pi

I'm working with a smart watch and raspberry Pi, and I'm able to successfully connect smart watch and get data from smart watch, there is no problem with getting data from smart watch using raspberry pi, but only problem is connection, some I'm able to connect without any errors and problems, but sometimes watch keeps on connecting and disconnecting automatically, see this log of bluetoothctl.
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
[CHG] Device C3:52:C7:DF:30:E9 Connected: no
[CHG] Device C3:52:C7:DF:30:E9 Connected: yes
Raspberry Pi specs
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Related

Need help sending byte arry via bluetoothctl

how do I send a array looks like this
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 25, 255]
via bluetoothctl to my BLE device.
Here are my commands
Code: Select all
sudo bluetoothctl
[bluetooth]# connect EB:01:9D:FE:27:B1
Attempting to connect to EB:01:9D:FE:27:B1
[CHG] Device EB:01:9D:FE:27:B1 Connected: yes
Connection successful
[CHG] Device EB:01:9D:FE:27:B1 ServicesResolved: yes
[Nuimo]# menu gatt
[Nuimo]# select-attribute f29b152d-cb19-40f3-be5c-7241ecb82fd2
[Nuimo:/service001b/char002f]#
[Nuimo:/service001b/char002f]# write data="[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 25, 255]"
Invalid value at index 0
Attempting to write /org/bluez/hci0/dev_EB_01_9D_FE_27_B1/service001b/char002f
[Nuimo:/service001b/char002f]#
[Nuimo:/service001b/char002f]# attribute-info f29b152d-cb19-40f3-be5c-7241ecb82fd2
Characteristic - Vendor specific
UUID: f29b152d-cb19-40f3-be5c-7241ecb82fd2
Service: /org/bluez/hci0/dev_EB_01_9D_FE_27_B1/service001b
Flags: read
Flags: write-without-response
Flags: write
But nothing happend.....
You can select and write to an attribute without going in to the gatt menu by prepending gatt. to the command. For example:
gatt.select-attribute f29b152d-cb19-40f3-be5c-7241ecb82fd2
To write to a characteristic use the hex values in quotes. For example:
gatt.write "0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x19 0xff"
Here a log of a session on my system connecting to a BBC micro:bit:
$ bluetoothctl
Agent registered
[bluetooth]# connect E1:4B:6C:22:56:F0
Attempting to connect to E1:4B:6C:22:56:F0
[CHG] Device E1:4B:6C:22:56:F0 Connected: yes
Connection successful
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 0000fe59-0000-1000-8000-00805f9b34fb
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d6100-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d93af-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95d9882-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e95dd91d-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 UUIDs: e97dd91d-251d-470a-a062-fa1922dfa9a8
[CHG] Device E1:4B:6C:22:56:F0 ServicesResolved: yes
[BBC micro:bit [toveg]]# gatt.select-attribute e95d93ee-251d-470a-a062-fa1922dfa9a8
[BBC micro:bit [toveg]:/service0035/char0038]# gatt.write "0x42 0x4C 0x45 0x23"
Attempting to write /org/bluez/hci0/dev_E1_4B_6C_22_56_F0/service0035/char0038
[BBC micro:bit [toveg]:/service0035/char0038]#
This sent the values successfully.

Can't connect iPhone 6 to macOS virtual machine

I'm trying to test a flutter app on iOS using my macOS virtual machine, but I can't get my old iPhone 6 to connect. I was able to get it to connect once last week, but since then it will immediately disconnect from the guest and back to the host whenever I plug it in. Here's some info about my setup:
Host OS: Ubuntu 20.04
Guest OS: macOS Big Sur 11.2
Phone: iPhone 6, iOS 12.5.1
Virtualization: VMWare player 16.1.0
I have the vm stored in a 2TB external USB drive
I added the line usb.quirks.device0 = "0x05ac:0x12a8 skip-reset, skip-refresh, skip-setconfig" to my vmx file which at least stops an infinite loop of connecting and disconnecting.
I have the vm settings to USB 2 and have all the options checked
If I plug the phone into a USB 3 port, I get a driver error, and if I plug it into a USB 2 port I sometimes get a message saying the device is busy.
I also get similar messages in the vmware log
2021-02-15T20:41:21.288-07:00| vmx| I005: USBGA: device 1000001d05ac12a8 arrived
2021-02-15T20:41:21.291-07:00| vmx| I005: MsgHint: msg.usb.disconnectHostProcess
2021-02-15T20:41:21.291-07:00| vmx| I005+ The specified device is in use by process:3922 /usr/libexec/gvfs-gphoto2-volume-monitor on the host operating system. Continuing will detach the device from the host operating system.
2021-02-15T20:41:21.291-07:00| vmx| I005+ ---------------------------------------
2021-02-15T20:41:21.297-07:00| vmx| W003: USBGL: failed to claim device (fd=19), interface 0. Retrying
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: disconnect driver 'usbfs' from device 19, interface 0
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: claimed device 19, interface 0 successfully
2021-02-15T20:41:21.297-07:00| vmx| I005: USBGL: Connected device 0x1000001d05ac12a8 successfully
2021-02-15T20:41:21.297-07:00| vmx| I005: USBG: Quirks for device 05ac:12a8 (user-defined,skip-setconfig,skip-reset,skip-refresh,slow-reconnect)
...
2021-02-15T20:41:21.617-07:00| vcpu-1| I005: USBGL: Disable port is not supported.
2021-02-15T20:41:21.719-07:00| vcpu-0| I005: USBG: Skipping device reset for 0x1000001d05ac12a8
2021-02-15T20:41:21.874-07:00| vmx| I005: USBG: Skipping SetConfiguration(1) for 0x1000001d05ac12a8
2021-02-15T20:41:21.879-07:00| vmx| W003: USBGL: failed to set device 19 to config 5: Device or resource busy
2021-02-15T20:41:21.879-07:00| vmx| I005: USBGL: claimed device 19, interface 0 successfully
2021-02-15T20:41:26.578-07:00| vmx| W003: USBGL: failed to submit urb to device 19: Device or resource busy
...
2021-02-15T20:41:26.579-07:00| vmx| W003: USBGL: failed to submit urb to device 19: Device or resource busy
2021-02-15T20:41:53.340-07:00| vmx| I005: USB: Disconnecting device 0x1000001e05ac12a8
2021-02-15T20:41:53.340-07:00| vmx| I005: USBG: Disconnecting 1000001e05ac12a8, port:0 reservedPort:5574C8CD9D20
2021-02-15T20:41:53.340-07:00| vmx| I005: USBGA: device 1000001e05ac12a8 already disconnected from host
The iPhone shows up under USB in system information. Manually connecting or disconnecting the device in the removable devices section of vmware doesn't seem to do anything.
Is there any other setting I can change or something I can try to get the iPhone to stay connected to the guest macOS?
Thanks so much!
Had the same problem. Need disable gvfs-gphoto2-volume-monitor and usbmuxd services in host OS (Ubuntu). Detail solution found here: https://www.insanelymac.com/forum/topic/326555-vmware-cant-connect-iphone/
Is the usbmuxd daemon that you need to disable but also to mask in order to prevent it from auto start again.
When you need to attach your iPhone to the VMWare Guest you need to execute the following commands:
sudo systemctl mask usbmuxd
sudo systemctl stop usbmuxd
When you finished and need to enable again the usbmuxd daemon you need to execute the following commands:
sudo systemctl unmask usbmuxd
sudo systemctl start usbmuxd
Also you may need to kill gvfs-gphoto2-volume-monitor by executing:
sudo killall gvfs-afc-volume-monitor
Tested and working on Fedora 36 with WMWare Workstation 16.2.3 and OSX guest 12.4
in the vmx file.... change the following line
usb_xhci:7.speed = "4"
like this
usb_xhci:7.speed = "2"
but it resets.Change the line after you open vmware...before starting the virtual machine....
you can check the port that iphone connects to from log....
in my case ... usb_xhci:7

stlink-org / 1.6.1 / STM32F723 / Raspberry Pi4

I have a problem with flashing proc using https://github.com/stlink-org.
Using windows STM32-Utility all works fine on every programer.
I also using debug which works correctly
Tried on other version v1.6.1.8x or 1.5.1 - this same problem
My setup:
Raspbbery Pi 4 with NOOBs
STM32F723, also i tried on Nucleo programer and ST-LINK / V2
stlink version - v1.6.1-201-g4bfaab0
At this moment I can erase memory, but that's all. When I tried to flash it crashes.
./st-flash write test.bin 0x8000000
------------------------------------
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011480 erased
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011500 erased
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011580 erased
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011600 erased
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011680 erased
2021-02-05T10:26:04 INFO common.c: Flash page at addr: 0x08011700 erased
2021-02-05T10:26:04 INFO common.c: Finished erasing 559 pages of 128 (0x80) bytes
2021-02-05T10:26:04 INFO common.c: Starting Flash write for L0
2021-02-05T10:26:04 INFO common.c: Starting Half page flash write for STM32L core id
2021-02-05T10:26:04 INFO flash_loader.c: Successfully loaded flash loader in sram
2021-02-05T10:26:04 INFO common.c: Go to Thumb mode
2021-02-05T10:26:05 ERROR flash_loader.c: Flash loader run error (R2 0xF1000003 R15 0xF1000003 DHCSR 0x01080001 DFSR 0x0000000B)
2021-02-05T10:26:05 WARN common.c: l1_stlink_flash_loader_run(0x8000000) failed! == -1
2021-02-05T10:26:05 WARN common.c:
write_half_pages failed == -1
^C[!] send_recv send request failed: LIBUSB_ERROR_BUSY
[!] send_recv STLINK_DEBUG_READREG
2021-02-05T10:26:16 INFO common.c: Go to Thumb mode
[!] send_recv send request failed: LIBUSB_ERROR_BUSY
[!] send_recv STLINK_DEBUG_WRITEREG
[!] send_recv send request failed: LIBUSB_ERROR_BUSY
[!] send_recv STLINK_JTAG_WRITEDEBUG_32BIT
[!] send_recv send request failed: LIBUSB_ERROR_BUSY
[!] send_recv STLINK_JTAG_WRITEDEBUG_32BIT
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 060: ID 0483:374f STMicroelectronics STLINK-V3
Bus 001 Device 007: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
./st-info --probe
Found 1 stlink programmers
version: V3J7S1
serial: 303034343030333033303339353130353334333933383338
hla-serial: "\x30\x30\x34\x34\x30\x30\x33\x30\x33\x30\x33\x39\x35\x31\x30\x35\x33\x34\x33\x39\x33\x38\x33\x38"
flash: 196608 (pagesize: 128)
sram: 20480
chipid: 0x0447
descr: L0xx Category 5

Why does it print new client connected: network-2?

Sometimes the sbt prints the following:
[info] new client connected: network-2
[info] new client connected: network-3
[info] new client connected: network-4
[info] new client connected: network-5
[info] new client connected: network-6
[info] new client connected: network-7
[info] new client connected: network-8
[info] new client connected: network-9
[info] new client connected: network-10
[info] new client connected: network-11
[info] new client connected: network-12
[info] new client connected: network-13
[info] new client connected: network-14
[info] new client connected: network-15
[info] new client connected: network-16
[info] new client connected: network-17
[info] new client connected: network-18
[info] new client connected: network-19
[info] new client connected: network-20
[info] new client connected: network-21
[info] new client connected: network-22
[info] new client connected: network-23
[info] new client connected: network-24
[info] new client connected: network-25
[info] new client connected: network-26
[info] new client connected: network-27
[info] new client connected: network-28
Why?

NetGear N150 wireless usb stick not working with Raspbian Wheezy on my PI

I am running a RaspberryPi with raspbian-wheezy:
uname -a
Linux raspberrypi 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux
How i want to use a NetGear N150 Wireless USB stick as a wlan interface:
dmesg
[ 3.401856] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[ 3.523552] usb 1-1.2: New USB device found, idVendor=0846, idProduct=9043
[ 3.532493] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.541771] usb 1-1.2: Product: WNA1000Mv2
[ 3.547744] usb 1-1.2: Manufacturer: Realtek
[ 3.553858] usb 1-1.2: SerialNumber: 00e04c000001
The device is not automatically detected. After plugging in the stick into a windows machine, it seems as the stick uses a Realtek rtl8192cu chip. Loading the 8192cu kernel module does not seem to work, there is still no wlan0 device.
Any ideas?
Never mind, I found a solution:
The usb id is not detected by the 8192cu kernel module as a supported device. After tweaking a bit and adding the following code to the rc.local file, everything works as expected:
modprobe 8192cu
echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id
ifdown wlan0
ifup wlan0
To have this handled automatically on module insertion, put the following line in /etc/modprobe.d/netgear_n150.conf:
install 8192cu /sbin/modprobe --ignore-install 8192cu; echo "0846 9043" > /sys/bus/usb/drivers/rtl8192cu/new_id
Going the extra mile: having it load automatically is more system specific, but on Arch Linux, adding a file in /etc/modules.load.d containing the module name is sufficient.