Eryux / miband-heartrate

Enable and monitor heartrate with Mi Band 2, 3 or 4 on Windows 10.
MIT License
57 stars 14 forks source link

Mi BAND4 #18

Open Vik1922 opened 2 years ago

Vik1922 commented 2 years ago

hi all, need help with the generation of the exe file please. its been a long while since i have used visual studio! thanks in advance

Using visual studio community 2022 windows 10 64bit mi band 4


getting stuck at- Right-click on MiBand-Heartrate-2 solution and select generate no "generate" option! using build instead! end up getting the errors below.

should i first connect the band first to the laptop before starting visual studio??

Error: image

Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 4 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 3 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 5 Active Error CS0234 The type or namespace name 'Storage' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 6 Active Error CS0246 The type or namespace name 'DeviceWatcher' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 14 Active Error CS0246 The type or namespace name 'DeviceWatcher' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 16 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\BLE.cs 64 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 4 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 12 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 14 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 24 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 26 Active Error CS0246 The type or namespace name 'DeviceWatcher' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 81 Active Error CS0246 The type or namespace name 'DeviceInformationUpdate' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 81 Active Error CS0246 The type or namespace name 'DeviceWatcher' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 89 Active Error CS0246 The type or namespace name 'DeviceInformationUpdate' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 89 Active Error CS0246 The type or namespace name 'DeviceWatcher' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 100 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\ConnectionWindowViewModel.cs 100 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 7 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 8 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 9 Active Error CS0234 The type or namespace name 'Storage' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 10 Active Error CS0246 The type or namespace name 'BluetoothLEDevice' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 30 Active Error CS0246 The type or namespace name 'GattDeviceService' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 33 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 35 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 37 Active Error CS0246 The type or namespace name 'GattDeviceService' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 39 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 50 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 101 Active Error CS0246 The type or namespace name 'GattValueChangedEventArgs' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 101 Active Error CS0246 The type or namespace name 'BluetoothLEDevice' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 193 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 337 Active Error CS0246 The type or namespace name 'GattValueChangedEventArgs' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand2_3_Device.cs 337 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 6 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 7 Active Error CS0234 The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 8 Active Error CS0234 The type or namespace name 'Storage' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 9 Active Error CS0246 The type or namespace name 'BluetoothLEDevice' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 29 Active Error CS0246 The type or namespace name 'GattDeviceService' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 32 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 34 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 36 Active Error CS0246 The type or namespace name 'GattDeviceService' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 38 Active Error CS0246 The type or namespace name 'DeviceInformation' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 49 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 106 Active Error CS0246 The type or namespace name 'GattValueChangedEventArgs' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 106 Active Error CS0246 The type or namespace name 'BluetoothLEDevice' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 198 Active Error CS0246 The type or namespace name 'GattCharacteristic' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 342 Active Error CS0246 The type or namespace name 'GattValueChangedEventArgs' could not be found (are you missing a using directive or an assembly reference?) MiBand-Heartrate-2 C:\NEUROPROGS\mihrv\MiBand-Heartrate-2\Devices\MiBand4_Device.cs 342 Active Warning The referenced component 'Windows' could not be found. MiBand-Heartrate-2

alirezafarnoosh commented 2 years ago

hello you didnt installed windows sdk as the author mentiones in "readme". the address or your missing assembly is "C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0\Windows.winmd" that surely means you need windows sdk . I use "Rebuild" and it creates exe without problem (today). and I have mi band4 and vs2022 of course you dont need to connect your band for developing or building the project sry for bad english btw

Vik1922 commented 1 year ago

funny thing is i lost the damn band :-( after all the hard work thanks all the same for yur response, much appreciated!