Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bluetooth COM Port function for Seika and Seika Notetaker Braille display #13142

Closed
moyanming opened this issue Dec 7, 2021 · 17 comments · Fixed by #13191
Closed

Add Bluetooth COM Port function for Seika and Seika Notetaker Braille display #13142

moyanming opened this issue Dec 7, 2021 · 17 comments · Fixed by #13191

Comments

@moyanming
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I have tested the NVDA 2021.3rc1 with Seika and Seika Notetaker Braille display, the default connection is USB and this works fine, but the "Port" is grey and can't use to select a Bluetooth COM Port which is supported by both Seika and Seika Noteatker Braille display.
We already added supported Seika Notetaker here #12598, the data protocol of the Bluetooth COM Port connection is the same as the USB connection, this means the Bluetooth COM Port or USB should be selectable but not fixed to USB for both Seika and Seika Notetaker Braille display.
If you select "Automatic" when selecting Braille display, the Seika and Seika Notetaker can't connect when no USB cable is connected but the Bluetooth is already connected.
BT COM Port is grey and can't use

@OzancanKaratas
Copy link
Collaborator

Are the Bluetooth and USB protocols using the same hardware ID?

@moyanming
Copy link
Contributor Author

Hi, @OzancanKaratas
I don't know the meaning of the same hardware ID of Bluetooth and USB.
Bluetooth and USB are not the same types of hardware there maybe not have the same hardware ID.
If I select some other Braille display, there is a list of all Bluetooth and USB VCP com ports, but the Seika and Seika Notetaker's "Port" is grey.

Best Regards,

@moyanming
Copy link
Contributor Author

I have tested this build, I found the Bluetooth COM port was added, but the Bluetooth COM port can't connect with Seika Notetaker.
There may be a USB HID of Seika Notetaker connected with the PC, but the customer may select Bluetooth COM Port manually in the Braille settings. Please refer to the log file, the USB HID name of Seika Notetaker may be used to connect even user selects COM port manually.
The COM port use: 9600,N,8,1, the data translation protocol of the COM port is the same as USB HID.

Here is the log:
Bluetooth COM Port.log

@feerrenrut
Copy link
Contributor

@moyanming For these issues please upload a debug log with hwIo enabled:

  • Set the log level to DEBUG via the general settings panel
  • enable hwIo logging in the advanced setting panel

@moyanming
Copy link
Contributor Author

@moyanming For these issues please upload a debug log with hwIo enabled:

  • Set the log level to DEBUG via the general settings panel
  • enable hwIo logging in the advanced setting panel

Hi, @feerrenrut
The NVDA 2021.3RC1 has no serial port selection for Seika Notetaker, but this build have added and I have tested it, please find the log file here.

@feerrenrut
Copy link
Contributor

This looks like the same log you have already uploaded, it is not a debug level log, and hwIo isn't enabled.

@feerrenrut
Copy link
Contributor

@cary-rowen It seems like this driver does not register itself to be considered as a bluetooth device. From your log, there are two potential candidates, can you advise if either of these represents the braille device?

DEBUG - hwPortUtils.listComPorts (08:51:58.279) - MainThread (13904):
{'hardwareID': 'BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&0002', 'port': 'COM3', 'bluetoothAddress': 8757810468, 'bluetoothName': 'TSM 3366', 'friendlyName': '蓝牙链接上的标准串行 (COM3)'}
DEBUG - hwPortUtils.listComPorts (08:51:58.279) - MainThread (13904):
{'hardwareID': 'BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&0000', 'port': 'COM4', 'bluetoothAddress': 0, 'friendlyName': '蓝牙链接上的标准串行 (COM4)'}

@cary-rowen
Copy link
Contributor

Hi, I am pretty sure that "TSM3366" represents my braille device.
The full content is this line: 'hardwareID': 'BTHENUM\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&0002', 'port': 'COM3', 'bluetoothAddress': 8757810468, 'bluetoothName': 'TSM 3366', 'friendlyName': '蓝牙链接上的标准串行 (COM3)'}

@cary-rowen
Copy link
Contributor

@feerrenrut
Hello, I used the latest TryBuild you provided in #13121 for testing. The Bluetooth function did not work properly, but I can use the Seaka add-on to work normally. Below I will provide two logs. The former represents the test results of TryBuild. The latter represents the test result of 2021.3.1rc1 with Seaka add-on add-on.

TryBuild_Log.txt

2021.3.1RC1_With_Seaka_Add-on.txt

@moyanming
Copy link
Contributor Author

Hi, @cary-rowen Thanks for your great job.
The Bluetooth serial maybe have two UUIDs: serial com port out, and serial com port in, so there are two Bluetooth COM ports for Seika Notetaker in the PC, but only one Bluetooth COM port can be used for connecting with Seika.

The driver should open the Bluetooth serial COM port one by one and try to connect with Seika, if there has handshake data coming from Seika, this is the right Bluetooth Com port and can be used for communication same as USB-HID does.

@moyanming
Copy link
Contributor Author

Hi, I am pretty sure that "TSM3366" represents my braille device. The full content is this line: 'hardwareID': 'BTHENUM{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&0002', 'port': 'COM3', 'bluetoothAddress': 8757810468, 'bluetoothName': 'TSM 3366', 'friendlyName': '蓝牙链接上的标准串行 (COM3)'}

Hi, @cary-rowen and @feerrenrut
Please note that the Bluetooth name of the Seika devices is "TSM abcd", where the "abcd" is a four-digit number, e.g. "TSM 3366", "TSM 0001", etc. There is a space between "TSM" and "abcd".

@feerrenrut
Copy link
Contributor

@cary-rowen @moyanming Thanks for the extra information, once we sort out the issues with braille in the 2021.3.1 release and merge that back to master I'll take a look at implementing this in alpha builds.

@feerrenrut
Copy link
Contributor

feerrenrut commented Dec 24, 2021

@moyanming and @cary-rowen Could you please test this build for autodetecting the seika notetaker over bluetooth.
Built from #13191
Thanks.

@cary-rowen
Copy link
Contributor

@feerrenrut
I tested the build Version, and unfortunately, NVDA did not connect to my device via Bluetooth.
Shows an error dialog
The following is the log with HWIO enabled:
log_#13191.txt

@feerrenrut
Copy link
Contributor

I have updated the approach to use serial connections for bluetooth.
The build will be available shortly via https://ci.appveyor.com/project/NVAccess/nvda/builds/42116723/artifacts

@feerrenrut
Copy link
Contributor

The COM port use: 9600,N,8,1, the data translation protocol of the COM port is the same as USB HID.

I am currently using (code) the following serial params:
Baud = 9600
Parity = None
Bytesize = 8
BitStop = 1

@moyanming what is your source for this information?

Note:

  • When connecting with USB-HID, hidDll.HidD_SetFeature is called with SEIKA_CMD_ON = b"\x41\x01". I don't know the purpose of this, and I'm not sure if an equivalent is required for Bluetooth / serial. See
    # Does the device need to be sent SEIKA_CMD_ON as per USB-HID?

@moyanming
Copy link
Contributor Author

moyanming commented Jan 10, 2022

@feerrenrut
what is your source for this information?
*** The Bluetooth module within the Seika Notetaker (and Seika) uses the 9600, N, 8, 1.

I don't know the meaning of the "SEIKA_CMD_ON = b"\x41\x01"", this may be needed by hwIo?

NVDA open the USB-HID or Bluetooth Serail COM port first, and then send "0xff, 0xff, 0xa1", the Seika Notetaker will send this back to NVDA means the connection is successful: "0xff, 0xff, 0xa2, N, B, C, R, S1~S(N-3)", where N is the following bytes length, B means button count, C and R means Cell and Routing count, S1~S(N-1) means char description of the current protocol.

feerrenrut added a commit that referenced this issue Jan 19, 2022
Fixes #13142

Summary:
Seika Notetaker devices are: MiniSeika (16, 24 cells), V6, and V6Pro (40 cells)
They can now be autodetected via Bluetooth.
Bluetooth COM port can now be manually selected.

Description of changes:
- Identify the Seika notetaker device when connected by Bluetooth as per #13142 (comment)
the Bluetooth name should be TSM, a space, then 4 digits.
- Clarifies user guide for Seika devices.
@nvaccessAuto nvaccessAuto added this to the 2022.1 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants