senseshift / senseshift-firmware

Open-source firmware for VR accessories. Build your own DIY haptic vest, gloves, and more!
https://senseshift.github.io/
GNU General Public License v3.0
99 stars 10 forks source link

[Bug]: esp32 DevkitC v4 Looses Connection #32

Open Nubi123bty opened 1 year ago

Nubi123bty commented 1 year ago

For some reason, the Windows Client is unable to connect to the ESP, as soon as it is found and an attempt to connect is made it loses the connection to the board over BT. this is the error created by the player:

2022-11-28 15:47:40,361 [1] ERROR BhapticsPlayer.Internal.BhapticsLiteDB: BhapticsDB DB created
2022-11-28 15:47:40,438 [1] ERROR BhapticsPlayer.Utils.Utilities: Util Get BhapticsSettingValue 1
2022-11-28 15:47:40,439 [1] ERROR BhapticsPlayer.Utils.Utilities: CurrentCulture: de-AT
2022-11-28 15:47:40,439 [1] ERROR BhapticsPlayer.Utils.Utilities: Properties.Settings.Default.language Before: en-US
2022-11-28 15:47:40,439 [1] ERROR BhapticsPlayer.Utils.Utilities: Properties.Settings.Default.language: en-US
2022-11-28 15:47:40,731 [1] WARN  BhapticsPlayer.Internal.SettingsStore: CheckDfuFailure
2022-11-28 15:47:40,840 [1] ERROR BhapticsPlayer.Utils.AudioToHapticConfig: Load default setting
2022-11-28 15:47:41,014 [1] ERROR BhapticsPlayer.Audio.Utils.AudioDeviceWatcher: AudioDeviceWatcher() default selected. Die Sequenz enthält kein übereinstimmendes Element.
2022-11-28 15:47:41,131 [1] ERROR BhapticsPlayer.WebSocket.StudioReceiver: Listening on port 15881, and providing WebSocket services:
2022-11-28 15:47:41,145 [1] ERROR BhapticsPlayer.WebSocket.StudioReceiver: Listening on port 15882, and providing WebSocket Secure services: True
2022-11-28 15:47:41,145 [1] WARN  BhapticsPlayer.Utils.Utilities: Release Id : 2009
2022-11-28 15:47:41,145 [1] WARN  BhapticsPlayer.Utils.Utilities: releaseNum : 2009
2022-11-28 15:47:41,655 [1] WARN  BhapticsPlayer.Internal.SettingsStore: CheckDfuFailure
2022-11-28 15:47:41,745 [5] ERROR BhapticsModLauncher.Config.BhapticsContentsRepository: HttpWebResponse status: OK
2022-11-28 15:47:42,448 [5] ERROR BhapticsModLauncher.Config.BhapticsContentsRepository: BhapticsContentsRepository Exists DB
2022-11-28 15:47:42,486 [5] ERROR BhapticsModLauncher.Config.BhapticsContentsRepository: BhapticsContentsRepository SaveGameContents()
2022-11-28 15:47:52,765 [6] WARN  BhapticsPlayer.Bluetooth.DeviceWatcherService: Remove Device TactosyDevice {Name=TactSuitX40, Id=70518412007866, Paired=False, Connected=Disconnected}
2022-11-28 15:48:00,282 [30] WARN  BhapticsPlayer.Bluetooth.DeviceWatcherService: Remove Device TactosyDevice {Name=TactSuitX40, Id=70518412007866, Paired=False, Connected=Disconnected}

Serial output does not produce anything bt this:

>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
leon0399 commented 1 year ago

Thank you for submitting an issue! Please, help me investigate your issue. I'll need more detailed info, such as

Also, please, try switching to v0.1.2 version, which is confirmed to be working great with the following steps: Code_RRV9HMU6qJ

Nubi123bty commented 1 year ago

thank you for looking into it, Building the tactx40, but having the same issue with any other Build on the devkitC V4, Tried 4 different Boards, I am using the 1.2 as recommended, the Player version is 1.8.2.2, had the same issue with the previous release, the connection is breaking off several times until after 10 to 20 minutes there seems to be a connection. this is the final serial output on the serial port when connected. i also tried to downgrade ESP32 Library version to 2.0.0 while testing, with the same issue. Reinstalled and reset the player, EEprom is erased every time before another Version is copied onto it. clearly there must be a mistake on my side since no one seems to have encountered it, maybe my environment?

>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onDisconnect()
>>      onConnect()
>>      onConnect(*param)
>>      onRead (UUID: 6e400007-b5a3-f393-e0a9-e50e24dcca9e) 
        value: `␂␁`, len: 2
>>      onRead (UUID: 6e400008-b5a3-f393-e0a9-e50e24dcca9e) 
        value: `d`, len: 2
>>      onRead (UUID: 6e400003-b5a3-f393-e0a9-e50e24dcca9e) 
        value: `$��R=f)���`, len: 10
>>      onRead (UUID: 6e40000b-b5a3-f393-e0a9-e50e24dcca9e) 
        value: ``, len: 2

versions of VS: Version: 1.73.1 (user setup) Commit: 6261075646f055b99068d3688932416f2346dd3b Datum: 2022-11-09T04:27:29.066Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 Betriebssystem: Windows_NT x64 10.0.19045 Sandkasten: No

leon0399 commented 1 year ago

Have you tried connecting to ESP from your phone? Or Meta Quest of you have one

I have an idea why it might happening, I'll lol into it tomorrow

DFU is responsible for firmware update, and presumably bhaptics player trying to update firmware (?). I'll try bumping version to latest one and see how it performs

Nubi123bty commented 1 year ago

the mobile device paired right away.

leon0399 commented 1 year ago

I've bumped the firmware version to prevent it from trying to update, let's try a new version. Don't forget to checkout the latest master branch

Nubi123bty commented 1 year ago

no, still the same problem, only after many attempts is the connection established, I just recognized that the Second PWM on address 0x41 is not getting any signals, does it have to do something with this issue?

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
>> OutputAutoComponent()
leon0399 commented 1 year ago

Second PWM on address 0x41 is not getting any signals

Have you soldered address pin on PCA?

Nubi123bty commented 1 year ago

yes, I have, the first bit switched 3 boards and checked the boards with the sample code. I remember in an earlier version Serial output did give a success or fail message on finding the boards.

Nubi123bty commented 1 year ago

please ignore the problem with the PWM, apparently, the cable was broken, showing contact enough for phantom voltage but no current coming through.

Nubi123bty commented 1 year ago

ok one thing I was able to test the connection on Oculus Quest 2 (SW-Ver.: 415550688) Bhaptics Oculus Player Ver.: 0.7.14, Firmware on ESP Tact X40 V1.2. I can't connect with the Tact X40, The Gloves I made on the ESP32 Devkitv1 Work fine. no error message is produced.

leon0399 commented 1 year ago

The Gloves I made on the ESP32 Devkitv1 Work fine

By gloves, you mean "Tactosy for hands" compatible device?

leon0399 commented 1 year ago

I've just verified that it works correctly on the latest master branch, bHaptics Player 1.8.2.2 Consider joining our Discord, we've been discussing possible causes of this problem, one of them is the bad quality of either the Bluetooth adapter/dongle or the ESP chip itself and how to distinguish good quality ESPs from bad ones

image

Nubi123bty commented 1 year ago

Thank you very much, for your time looking into it. I will try to get another, than from AZ-Delivery, to try it out.

Nubi123bty commented 1 year ago

is there a possibility that the BT draws too much Power from the esp when connecting? what version of the ESP itself are you using or what brand is the Devkit?

leon0399 commented 1 year ago

what version of the ESP itself are you using or what brand is the Devkit?

I'm using this ESP32 devkit board from AliExpress: https://aliexpress.ru/item/32864722159.html?sku_id=12000028745117645 (ESP32-D CH9102 variant)

I've also started collecting a list of trusted links on these two pages: https://openhaptics.github.io/docs/hardware/mcu and https://openhaptics.github.io/guides/face-interface/quest2-esp32-breadboard (don't mind guide itself, it's not complete)

Akluma commented 8 months ago

I have same problem.