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

(CHINESE COPY) Device not connected #1

Open
CorrederaJorge opened this issue Nov 7, 2019 · 36 comments
Open

(CHINESE COPY) Device not connected #1

CorrederaJorge opened this issue Nov 7, 2019 · 36 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@CorrederaJorge
Copy link

CorrederaJorge commented Nov 7, 2019

Hi:

I have managed to compile and run the project in an ESP32 but when I try to connect I am not able to make it work.

The wiimote lights keep blinking and it receive CONFIGURATION RESPONSE but it doesn´t receive if(data[0]==0xA1){ // HID 0xA1 to connect so when I push the buttons it doesn´t do anything at all.

What am I doing wrong?.

I attach the debug output from Esp32 port.

Kind regards

[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 78 0C B8 C6 96 74
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00
[D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
[D][Wiimote.cpp:157] start_scan(): queued reset.
[D][Wiimote.cpp:786] handle(): SEND => 01 03 0C 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00
[D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:786] handle(): SEND => 01 09 10 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 43 FE 8E 2D E6 B4
[D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=43 FE 8E 2D E6 B4
[D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:786] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00
[D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:786] handle(): SEND => 01 24 0C 03 04 05 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00
[D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:786] handle(): SEND => 01 1A 0C 01 03
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00
[D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:786] handle(): SEND => 01 01 04 05 33 8B 9E 05 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04
[D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 00 18 00 14 15 C5
[D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 04 25 00
[D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = 79 17
[D][Wiimote.cpp:293] process_inquiry_result_event(): queued remote_name_request.
[D][Wiimote.cpp:786] handle(): SEND => 01 19 04 0A C5 15 14 00 18 00 01 00 17 F9
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 19 04
[D][Wiimote.cpp:246] process_command_status_event(): remote_name_request pending!
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=07 len=255 data=00 C5 15 14 00 18 00 4E 69 6E 74 65 6E 64 6F 20 52 56 4C 2D 43 4E 54 2D 30 31 00 00 00 00 ...
[D][Wiimote.cpp:314] process_remote_name_request_complete_event(): remote_name_request_complete status=00
[D][Wiimote.cpp:317] process_remote_name_request_complete_event():   BD_ADDR = 00 18 00 14 15 C5
[D][Wiimote.cpp:320] process_remote_name_request_complete_event():   REMOTE_NAME = Nintendo RVL-CNT-01
[D][Wiimote.cpp:327] process_remote_name_request_complete_event(): queued inquiry_cancel.
[D][Wiimote.cpp:336] process_remote_name_request_complete_event(): queued create_connection.
[D][Wiimote.cpp:786] handle(): SEND => 01 02 04 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 02 04 00
[D][Wiimote.cpp:225] process_command_complete_event(): inquiry_cancel OK.
[D][Wiimote.cpp:786] handle(): SEND => 01 05 04 0D C5 15 14 00 18 00 08 00 01 00 17 F9 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 05 04
[D][Wiimote.cpp:254] process_command_status_event(): create_connection pending!
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=03 len=11 data=00 81 00 C5 15 14 00 18 00 01 00
[D][Wiimote.cpp:463] process_connection_complete_event(): connection_complete status=00
[D][Wiimote.cpp:471] process_connection_complete_event():   Connection_Handle  = 0x0081
[D][Wiimote.cpp:472] process_connection_complete_event():   BD_ADDR            = 00 18 00 14 15 C5
[D][Wiimote.cpp:473] process_connection_complete_event():   Link_Type          = 01
[D][Wiimote.cpp:474] process_connection_complete_event():   Encryption_Enabled = 00
[D][Wiimote.cpp:356] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
[D][Wiimote.cpp:786] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 01 04 00 13 00 45 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00
[D][Wiimote.cpp:739] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:698] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 45 00 01 00 02 00
[D][Wiimote.cpp:504] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:505] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:506] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:507] process_l2cap_connection_response():   source_cid      = 0045
[D][Wiimote.cpp:508] process_l2cap_connection_response():   result          = 0001
[D][Wiimote.cpp:509] process_l2cap_connection_response():   status          = 0002
[D][Wiimote.cpp:698] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 45 00 00 00 00 00
[D][Wiimote.cpp:504] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:505] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:506] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:507] process_l2cap_connection_response():   source_cid      = 0045
[D][Wiimote.cpp:508] process_l2cap_connection_response():   result          = 0000
[D][Wiimote.cpp:509] process_l2cap_connection_response():   status          = 0000
[D][Wiimote.cpp:536] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
[D][Wiimote.cpp:786] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 02 08 00 40 00 00 00 01 02 40 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00
[D][Wiimote.cpp:739] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:698] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 02 0A 00 45 00 00 00 00 00 01 02 40 00
[D][Wiimote.cpp:548] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
[D][Wiimote.cpp:549] process_l2cap_configuration_response():   identifier      = 02
[D][Wiimote.cpp:550] process_l2cap_configuration_response():   len             = 000A
[D][Wiimote.cpp:551] process_l2cap_configuration_response():   source_cid      = 0045
[D][Wiimote.cpp:552] process_l2cap_configuration_response():   flags           = 0000
[D][Wiimote.cpp:553] process_l2cap_configuration_response():   result          = 0000
[D][Wiimote.cpp:554] process_l2cap_configuration_response():   config          = 01 02 40 00
[D][Wiimote.cpp:698] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 04 01 08 00 45 00 00 00 01 02 FF 00
[D][Wiimote.cpp:564] process_l2cap_configuration_request(): L2CAP CONFIGURATION REQUEST
[D][Wiimote.cpp:565] process_l2cap_configuration_request():   identifier      = 01
[D][Wiimote.cpp:566] process_l2cap_configuration_request():   len             = 08
[D][Wiimote.cpp:567] process_l2cap_configuration_request():   destination_cid = 0045
[D][Wiimote.cpp:568] process_l2cap_configuration_request():   flags           = 0000
[D][Wiimote.cpp:569] process_l2cap_configuration_request():   config          = 01 02 FF 00
[D][Wiimote.cpp:581] process_l2cap_configuration_request():   MTU=255
[D][Wiimote.cpp:605] process_l2cap_configuration_request(): queued **acl_l2cap_single_packet(CONFIGURATION RESPONSE)**
[D][Wiimote.cpp:786] handle(): SEND => 02 81 20 12 00 0E 00 01 00 05 01 0A 00 40 00 00 00 00 00 01 02 FF 00
[D][Wiimote.cpp:721] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00
[D][Wiimote.cpp:739] process_hci_event():   (Number Of Completed Packets Event)
@takeru
Copy link
Owner

takeru commented Nov 7, 2019

Hi!

Arduino 1.8.9
M5StickC
esp32-core 1.0.4 (Library/Arduino15/packages/esp32/hardware/esp32/1.0.4)
macbook 10.14.6

I ran sketch at README.
This is my log. It is working. I will check yours..

04:21:15.004 -> [D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00 
04:21:15.004 -> [D][Wiimote.cpp:157] start_scan(): queued reset.
04:21:15.004 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
04:21:15.042 -> [D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
04:21:15.042 -> [D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
04:21:15.042 -> [D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00 
04:21:15.042 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 7A B7 51 1D A0 D8 
04:21:15.042 -> [D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=7A B7 51 1D A0 D8 
04:21:15.042 -> [D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
04:21:15.077 -> [D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
04:21:15.077 -> [D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
04:21:15.077 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
04:21:15.077 -> [D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
04:21:15.115 -> [D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
04:21:15.115 -> [D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00 
04:21:15.115 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
04:21:15.115 -> [D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
04:21:15.115 -> [D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
04:21:15.115 -> [D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03 
04:21:15.149 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
04:21:15.149 -> [D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
04:21:15.149 -> [D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
04:21:15.149 -> [D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
04:21:15.149 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
04:21:15.182 -> [D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
04:21:21.537 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00 
04:21:21.568 -> [D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
04:21:21.568 -> [D][Wiimote.cpp:157] start_scan(): queued reset.
04:21:21.568 -> [D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00 
04:21:21.568 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
04:21:21.568 -> [D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
04:21:21.605 -> [D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
04:21:21.605 -> [D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00 
04:21:21.605 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 7A B7 51 1D A0 D8 
04:21:21.605 -> [D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=7A B7 51 1D A0 D8 
04:21:21.605 -> [D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
04:21:21.605 -> [D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
04:21:21.638 -> [D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
04:21:21.638 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
04:21:21.638 -> [D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
04:21:21.638 -> [D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
04:21:21.672 -> [D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00 
04:21:21.672 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
04:21:21.672 -> [D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
04:21:21.672 -> [D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
04:21:21.706 -> [D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03 
04:21:21.706 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
04:21:21.706 -> [D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
04:21:21.706 -> [D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
04:21:21.706 -> [D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
04:21:21.706 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
04:21:21.740 -> [D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
04:21:22.442 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=04 len=10 data=9B 0C 3D 1D 19 00 04 25 00 01 
04:21:22.442 -> [D][Wiimote.cpp:737] process_hci_event(): !!! process_hci_event no impl !!!
04:21:27.577 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=03 len=11 data=10 80 00 9B 0C 3D 1D 19 00 01 00 
04:21:27.615 -> [D][Wiimote.cpp:461] process_connection_complete_event(): connection_complete status=10
04:21:27.615 -> [D][Wiimote.cpp:469] process_connection_complete_event():   Connection_Handle  = 0x0080
04:21:27.615 -> [D][Wiimote.cpp:470] process_connection_complete_event():   BD_ADDR            = 00 19 1D 3D 0C 9B 
04:21:27.615 -> [D][Wiimote.cpp:471] process_connection_complete_event():   Link_Type          = 01
04:21:27.615 -> [D][Wiimote.cpp:472] process_connection_complete_event():   Encryption_Enabled = 00
04:21:27.650 -> [D][Wiimote.cpp:354] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
04:21:27.650 -> [D][Wiimote.cpp:780] handle(): SEND => 02 80 20 0C 00 08 00 01 00 02 01 04 00 13 00 45 00 
04:21:27.650 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=10 len=1 data=00 
04:21:27.650 -> [D][Wiimote.cpp:737] process_hci_event(): !!! process_hci_event no impl !!!
04:21:28.103 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00 
04:21:28.103 -> [D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
04:21:28.136 -> [D][Wiimote.cpp:157] start_scan(): queued reset.
04:21:28.136 -> [D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00 
04:21:28.136 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
04:21:28.136 -> [D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
04:21:28.136 -> [D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
04:21:28.170 -> [D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00 
04:21:28.170 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 7A B7 51 1D A0 D8 
04:21:28.170 -> [D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=7A B7 51 1D A0 D8 
04:21:28.170 -> [D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
04:21:28.170 -> [D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
04:21:28.203 -> [D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
04:21:28.203 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
04:21:28.203 -> [D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
04:21:28.203 -> [D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
04:21:28.239 -> [D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00 
04:21:28.239 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
04:21:28.239 -> [D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
04:21:28.239 -> [D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
04:21:28.239 -> [D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03 
04:21:28.239 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
04:21:28.274 -> [D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
04:21:28.274 -> [D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
04:21:28.274 -> [D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
04:21:28.274 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
04:21:28.274 -> [D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
04:21:34.671 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00 
04:21:34.671 -> [D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
04:21:34.671 -> [D][Wiimote.cpp:157] start_scan(): queued reset.
04:21:34.671 -> [D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00 
04:21:34.704 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
04:21:34.704 -> [D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
04:21:34.704 -> [D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
04:21:34.704 -> [D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00 
04:21:34.704 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 7A B7 51 1D A0 D8 
04:21:34.738 -> [D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=7A B7 51 1D A0 D8 
04:21:34.738 -> [D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
04:21:34.738 -> [D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
04:21:34.738 -> [D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
04:21:34.772 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
04:21:34.772 -> [D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
04:21:34.772 -> [D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
04:21:34.772 -> [D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00 
04:21:34.772 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
04:21:34.810 -> [D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
04:21:34.810 -> [D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
04:21:34.810 -> [D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03 
04:21:34.810 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
04:21:34.810 -> [D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
04:21:34.810 -> [D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
04:21:34.844 -> [D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
04:21:34.844 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
04:21:34.844 -> [D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
04:21:37.858 -> [D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 00 19 1D 3D 0C 9B 
04:21:37.858 -> [D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
04:21:37.858 -> [D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 04 25 00
04:21:37.858 -> [D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = 4D 76
04:21:37.892 -> [D][Wiimote.cpp:293] process_inquiry_result_event(): queued remote_name_request.
04:21:37.892 -> [D][Wiimote.cpp:780] handle(): SEND => 01 19 04 0A 9B 0C 3D 1D 19 00 01 00 76 CD 
04:21:37.892 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 19 04 
04:21:37.892 -> [D][Wiimote.cpp:246] process_command_status_event(): remote_name_request pending!
04:21:38.030 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=07 len=255 data=00 9B 0C 3D 1D 19 00 4E 69 6E 74 65 6E 64 6F 20 52 56 4C 2D 43 4E 54 2D 30 31 00 00 00 00 ...
04:21:38.066 -> [D][Wiimote.cpp:314] process_remote_name_request_complete_event(): remote_name_request_complete status=00
04:21:38.066 -> [D][Wiimote.cpp:317] process_remote_name_request_complete_event():   BD_ADDR = 00 19 1D 3D 0C 9B 
04:21:38.066 -> [D][Wiimote.cpp:320] process_remote_name_request_complete_event():   REMOTE_NAME = Nintendo RVL-CNT-01
04:21:38.066 -> [D][Wiimote.cpp:327] process_remote_name_request_complete_event(): queued inquiry_cancel.
04:21:38.100 -> [D][Wiimote.cpp:336] process_remote_name_request_complete_event(): queued create_connection.
04:21:38.100 -> [D][Wiimote.cpp:780] handle(): SEND => 01 02 04 00 
04:21:38.100 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 02 04 00 
04:21:38.100 -> [D][Wiimote.cpp:225] process_command_complete_event(): inquiry_cancel OK.
04:21:38.100 -> [D][Wiimote.cpp:780] handle(): SEND => 01 05 04 0D 9B 0C 3D 1D 19 00 08 00 01 00 76 CD 00 
04:21:38.136 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 05 04 
04:21:38.136 -> [D][Wiimote.cpp:254] process_command_status_event(): create_connection pending!
04:21:39.188 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=03 len=11 data=00 81 00 9B 0C 3D 1D 19 00 01 00 
04:21:39.188 -> [D][Wiimote.cpp:461] process_connection_complete_event(): connection_complete status=00
04:21:39.188 -> [D][Wiimote.cpp:469] process_connection_complete_event():   Connection_Handle  = 0x0081
04:21:39.227 -> [D][Wiimote.cpp:470] process_connection_complete_event():   BD_ADDR            = 00 19 1D 3D 0C 9B 
04:21:39.227 -> [D][Wiimote.cpp:471] process_connection_complete_event():   Link_Type          = 01
04:21:39.227 -> [D][Wiimote.cpp:472] process_connection_complete_event():   Encryption_Enabled = 00
04:21:39.227 -> [D][Wiimote.cpp:354] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
04:21:39.227 -> [D][Wiimote.cpp:780] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 01 04 00 13 00 45 00 
04:21:39.263 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
04:21:39.263 -> [D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
04:21:39.263 -> [D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 43 00 45 00 01 00 00 00 
04:21:39.263 -> [D][Wiimote.cpp:502] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
04:21:39.301 -> [D][Wiimote.cpp:503] process_l2cap_connection_response():   identifier      = 01
04:21:39.301 -> [D][Wiimote.cpp:504] process_l2cap_connection_response():   destination_cid = 0043
04:21:39.301 -> [D][Wiimote.cpp:505] process_l2cap_connection_response():   source_cid      = 0045
04:21:39.301 -> [D][Wiimote.cpp:506] process_l2cap_connection_response():   result          = 0001
04:21:39.301 -> [D][Wiimote.cpp:507] process_l2cap_connection_response():   status          = 0000
04:21:39.334 -> [D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 43 00 45 00 00 00 00 00 
04:21:39.334 -> [D][Wiimote.cpp:502] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
04:21:39.334 -> [D][Wiimote.cpp:503] process_l2cap_connection_response():   identifier      = 01
04:21:39.334 -> [D][Wiimote.cpp:504] process_l2cap_connection_response():   destination_cid = 0043
04:21:39.368 -> [D][Wiimote.cpp:505] process_l2cap_connection_response():   source_cid      = 0045
04:21:39.368 -> [D][Wiimote.cpp:506] process_l2cap_connection_response():   result          = 0000
04:21:39.368 -> [D][Wiimote.cpp:507] process_l2cap_connection_response():   status          = 0000
04:21:39.368 -> [D][Wiimote.cpp:533] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
04:21:39.402 -> [D][Wiimote.cpp:780] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 02 08 00 43 00 00 00 01 02 40 00 
04:21:39.402 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
04:21:39.402 -> [D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
04:21:39.402 -> [D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 02 0A 00 45 00 00 00 00 00 01 02 40 00 
04:21:39.436 -> [D][Wiimote.cpp:545] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
04:21:39.436 -> [D][Wiimote.cpp:546] process_l2cap_configuration_response():   identifier      = 02
04:21:39.436 -> [D][Wiimote.cpp:547] process_l2cap_configuration_response():   len             = 000A
04:21:39.436 -> [D][Wiimote.cpp:548] process_l2cap_configuration_response():   source_cid      = 0045
04:21:39.474 -> [D][Wiimote.cpp:549] process_l2cap_configuration_response():   flags           = 0000
04:21:39.474 -> [D][Wiimote.cpp:550] process_l2cap_configuration_response():   result          = 0000
04:21:39.474 -> [D][Wiimote.cpp:551] process_l2cap_configuration_response():   config          = 01 02 40 00 
04:21:39.474 -> [D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 04 05 08 00 45 00 00 00 01 02 B9 00 
04:21:39.474 -> [D][Wiimote.cpp:561] process_l2cap_configuration_request(): L2CAP CONFIGURATION REQUEST
04:21:39.508 -> [D][Wiimote.cpp:562] process_l2cap_configuration_request():   identifier      = 05
04:21:39.508 -> [D][Wiimote.cpp:563] process_l2cap_configuration_request():   len             = 08
04:21:39.508 -> [D][Wiimote.cpp:564] process_l2cap_configuration_request():   destination_cid = 0045
04:21:39.508 -> [D][Wiimote.cpp:565] process_l2cap_configuration_request():   flags           = 0000
04:21:39.545 -> [D][Wiimote.cpp:566] process_l2cap_configuration_request():   config          = 01 02 B9 00 
04:21:39.545 -> [D][Wiimote.cpp:578] process_l2cap_configuration_request():   MTU=185
04:21:39.545 -> [D][Wiimote.cpp:599] process_l2cap_configuration_request(): queued acl_l2cap_single_packet(CONFIGURATION RESPONSE)
04:21:39.545 -> [D][Wiimote.cpp:780] handle(): SEND => 02 81 20 12 00 0E 00 01 00 05 05 0A 00 43 00 00 00 00 00 01 02 B9 00 
04:21:39.545 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
04:21:39.580 -> [D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
04:21:39.580 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0D len=21 data=00 81 00 00 01 A4 06 00 00 00 00 00 00 10 27 00 00 FF FF FF FF 
04:21:39.616 -> [D][Wiimote.cpp:735] process_hci_event():   (QoS Setup Complete Event)
04:21:39.616 -> [D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=12 data=81 20 08 00 04 00 45 00 A1 30 00 00 
04:21:39.616 -> [D][Wiimote.cpp:372] _set_led(): queued acl_l2cap_single_packet(Set LEDs)
04:21:39.616 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 00 
04:21:39.650 -> 00 00 
04:21:39.650 -> [D][Wiimote.cpp:780] handle(): SEND => 02 81 20 07 00 03 00 43 00 A2 11 10 
04:21:39.650 -> [D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
04:21:39.650 -> [D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
04:21:44.185 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 01 
04:21:44.185 -> wiimote number=0 len=4 A1 30 00 01 
04:21:44.292 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 00 
04:21:44.292 -> wiimote number=0 len=4 A1 30 00 00 
04:21:44.397 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 01 
04:21:44.397 -> wiimote number=0 len=4 A1 30 00 01 
04:21:44.501 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 00 
04:21:44.501 -> wiimote number=0 len=4 A1 30 00 00 
04:21:44.639 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 01 
04:21:44.639 -> wiimote number=0 len=4 A1 30 00 01 
04:21:44.744 -> [D][Wiimote.cpp:604] process_report(): REPORT len=4 data=A1 30 00 00 
04:21:44.744 -> wiimote number=0 len=4 A1 30 00 00 

@takeru
Copy link
Owner

takeru commented Nov 7, 2019

Line numbers are not same. Which did you use branch?

スクリーンショット 2019-11-08 4 42 08

@takeru
Copy link
Owner

takeru commented Nov 7, 2019

http://wiibrew.org/wiki/Wiimote#HID_Interface
Establishing a HID connection with the Wii Remote can be done on PSM 0x11 for the control pipe and PSM 0x13 for the data pipe using the Bluetooth L2CAP protocol.

The original Wiimotes (RVL-CNT-01) allowed sending commands using SET REPORT (0x52) over the control pipe, instead of using the data pipe; however, this form does not work on the newer RVL-CNT-01-TR, and as such is not recommended.

https://github.com/takeru/Wiimote/blob/master/Wiimote.cpp#L474
With my wiimote, not needed 0x0011 connection.
But I don't know we need it or not for yours.

@takeru takeru added help wanted Extra attention is needed question Further information is requested labels Nov 8, 2019
@nathanRamaNoodles
Copy link

Are you using the Arduino IDE?

@takeru
Copy link
Owner

takeru commented Nov 9, 2019

Are you using the Arduino IDE?

yes

@nathanRamaNoodles
Copy link

Huh, for some reason, I'm not getting any output in the Serial Monitor. I even changed the Serial.printf to Serial.print. I copy and pasted your example code from the README and put it into a *.ino file and then copy and pasted the other .cpp and .h files with the .ino file.

I wonder if I should be using the ESP-idf alone?

@takeru
Copy link
Owner

takeru commented Nov 9, 2019

スクリーンショット 2019-11-09 15 10 07

First, you should to get working with Arduino IDE.

@CorrederaJorge
Copy link
Author

CorrederaJorge commented Nov 9, 2019

http://wiibrew.org/wiki/Wiimote#HID_Interface
Establishing a HID connection with the Wii Remote can be done on PSM 0x11 for the control pipe and PSM 0x13 for the data pipe using the Bluetooth L2CAP protocol.

The original Wiimotes (RVL-CNT-01) allowed sending commands using SET REPORT (0x52) over the control pipe, instead of using the data pipe; however, this form does not work on the newer RVL-CNT-01-TR, and as such is not recommended.

https://github.com/takeru/Wiimote/blob/master/Wiimote.cpp#L474
With my wiimote, not needed 0x0011 connection.
But I don't know we need it or not for yours.

I have done the test with:
Arduino 1.8.9
Wemos Lolin
esp32-core 1.0.4 (Library/Arduino15/packages/esp32/hardware/esp32/1.0.4)
Pc Windows 10

I ran sketch at README.

I have uncommented both lines:
_l2cap_connect(connection_handle, 0x0011, 0x0044);
_l2cap_connect(connection_handle, 0x0013, 0x0045);

The log, but I am not able to make it run properly. Mtu is still 255 but the other point seems to be not important because it waits until the connection is properly done that is in the next lines.

I attach the log.

Thank you for your help.

[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=05 len=4 data=00 81 00 08 
[D][Wiimote.cpp:482] process_disconnection_complete_event(): disconnection_complete status=00
[D][Wiimote.cpp:487] process_disconnection_complete_event():   Connection_Handle  = 0x0081
[D][Wiimote.cpp:488] process_disconnection_complete_event():   Reason             = 08
[D][Wiimote.cpp:157] start_scan(): queued reset.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
[D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 D3 FD 8E 2D E6 B4 
[D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=D3 FD 8E 2D E6 B4 
[D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
[D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
[D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
[D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
[D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:265] process_inquiry_result_event(): inquiry_result num=1
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 00 18 00 14 15 C5 
[D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 04 25 00
[D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = B9 25
[D][Wiimote.cpp:293] process_inquiry_result_event(): queued remote_name_request.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 19 04 0A C5 15 14 00 18 00 01 00 25 B9 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 19 04 
[D][Wiimote.cpp:246] process_command_status_event(): remote_name_request pending!
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=07 len=255 data=00 C5 15 14 00 18 00 4E 69 6E 74 65 6E 64 6F 20 52 56 4C 2D 43 4E 54 2D 30 31 00 00 00 00 ...
[D][Wiimote.cpp:314] process_remote_name_request_complete_event(): remote_name_request_complete status=00
[D][Wiimote.cpp:317] process_remote_name_request_complete_event():   BD_ADDR = 00 18 00 14 15 C5 
[D][Wiimote.cpp:320] process_remote_name_request_complete_event():   REMOTE_NAME = Nintendo RVL-CNT-01
[D][Wiimote.cpp:327] process_remote_name_request_complete_event(): queued inquiry_cancel.
[D][Wiimote.cpp:336] process_remote_name_request_complete_event(): queued create_connection.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 02 04 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 02 04 00 
[D][Wiimote.cpp:225] process_command_complete_event(): inquiry_cancel OK.
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 01 05 04 0D C5 15 14 00 18 00 08 00 01 00 25 B9 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 05 04 
[D][Wiimote.cpp:254] process_command_status_event(): create_connection pending!
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=03 len=11 data=00 81 00 C5 15 14 00 18 00 01 00 
[D][Wiimote.cpp:461] process_connection_complete_event(): connection_complete status=00
[D][Wiimote.cpp:469] process_connection_complete_event():   Connection_Handle  = 0x0081
[D][Wiimote.cpp:470] process_connection_complete_event():   BD_ADDR            = 00 18 00 14 15 C5 
[D][Wiimote.cpp:471] process_connection_complete_event():   Link_Type          = 01
[D][Wiimote.cpp:472] process_connection_complete_event():   Encryption_Enabled = 00
[D][Wiimote.cpp:354] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
[D][Wiimote.cpp:354] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 01 04 00 11 00 44 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 01 04 00 13 00 45 00 
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 44 00 01 00 02 00 
[D][Wiimote.cpp:502] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:503] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:504] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:505] process_l2cap_connection_response():   source_cid      = 0044
[D][Wiimote.cpp:506] process_l2cap_connection_response():   result          = 0001
[D][Wiimote.cpp:507] process_l2cap_connection_response():   status          = 0002
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 44 00 00 00 00 00 
[D][Wiimote.cpp:502] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:503] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:504] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:505] process_l2cap_connection_response():   source_cid      = 0044
[D][Wiimote.cpp:506] process_l2cap_connection_response():   result          = 0000
[D][Wiimote.cpp:507] process_l2cap_connection_response():   status          = 0000
[D][Wiimote.cpp:533] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 02 08 00 40 00 00 00 01 02 40 00 
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 44 00 00 00 00 00 
[D][Wiimote.cpp:502] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:503] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:504] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:505] process_l2cap_connection_response():   source_cid      = 0044
[D][Wiimote.cpp:506] process_l2cap_connection_response():   result          = 0000
[D][Wiimote.cpp:507] process_l2cap_connection_response():   status          = 0000
[D][Wiimote.cpp:533] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 02 08 00 40 00 00 00 01 02 40 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 02 0A 00 44 00 00 00 00 00 01 02 40 00 
[D][Wiimote.cpp:545] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
[D][Wiimote.cpp:546] process_l2cap_configuration_response():   identifier      = 02
[D][Wiimote.cpp:547] process_l2cap_configuration_response():   len             = 000A
[D][Wiimote.cpp:548] process_l2cap_configuration_response():   source_cid      = 0044
[D][Wiimote.cpp:549] process_l2cap_configuration_response():   flags           = 0000
[D][Wiimote.cpp:550] process_l2cap_configuration_response():   result          = 0000
[D][Wiimote.cpp:551] process_l2cap_configuration_response():   config          = 01 02 40 00 
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 04 01 08 00 44 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:561] process_l2cap_configuration_request(): L2CAP CONFIGURATION REQUEST
[D][Wiimote.cpp:562] process_l2cap_configuration_request():   identifier      = 01
[D][Wiimote.cpp:563] process_l2cap_configuration_request():   len             = 08
[D][Wiimote.cpp:564] process_l2cap_configuration_request():   destination_cid = 0044
[D][Wiimote.cpp:565] process_l2cap_configuration_request():   flags           = 0000
[D][Wiimote.cpp:566] process_l2cap_configuration_request():   config          = 01 02 FF 00 
[D][Wiimote.cpp:578] process_l2cap_configuration_request():   MTU=255
[D][Wiimote.cpp:599] process_l2cap_configuration_request(): queued acl_l2cap_single_packet(CONFIGURATION RESPONSE)
[D][Wiimote.cpp:775] handle(): esp_vhci_host_check_send_available=1
[D][Wiimote.cpp:780] handle(): SEND => 02 81 20 12 00 0E 00 01 00 05 01 0A 00 40 00 00 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:692] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 02 0A 00 44 00 00 00 00 00 01 02 40 00 
[D][Wiimote.cpp:545] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
[D][Wiimote.cpp:546] process_l2cap_configuration_response():   identifier      = 02
[D][Wiimote.cpp:547] process_l2cap_configuration_response():   len             = 000A
[D][Wiimote.cpp:548] process_l2cap_configuration_response():   source_cid      = 0044
[D][Wiimote.cpp:549] process_l2cap_configuration_response():   flags           = 0000
[D][Wiimote.cpp:550] process_l2cap_configuration_response():   result          = 0000
[D][Wiimote.cpp:551] process_l2cap_configuration_response():   config          = 01 02 40 00 
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:733] process_hci_event():   (Number Of Completed Packets Event)

@nathanRamaNoodles
Copy link

nathanRamaNoodles commented Nov 9, 2019

I got the debugging to work :). I forgot esp32 had different debug levels. @takeru

It works surprisingly well with my old Wiimote and responds to all button presses. However, it did not work on my Chinese Wiimote. The Chinese Wiimote has the same output as @CorrederaJorge and doesn't respond to button presses.

Maybe there is a different protocol as @CorrederaJorge mentioned? I'd be happy to help figure out that protocol.

Edit: Also, where are the motion controls?

@CorrederaJorge
Copy link
Author

As @nathanRamaNoodles says I am using a chinese copy. I am afraid the protocol is different...
Please @takeru could you give us some information if there is another protocol?. It would be great to be able to use it too.
Thanks.

@takeru
Copy link
Owner

takeru commented Nov 10, 2019

I don't know about chinese wiimote.
If you find infomation about deffernces in official and chniese one, please let me know. I will fix if I can do.
The best document about wiimote that I know is http://wiibrew.org/wiki/Wiimote

@CorrederaJorge

I have uncommented both lines:

It is not enough.

To handle two or more connections, fix this "BUG" is required I think, when I wrote it.
BUG: l2cap_connection_list's key must be used "connection_handle+psm"??

Can I find chinese version wiimote at aliexpress?

@nathanRamaNoodles
Copy link

yes, it's super cheap: Aliexpress Link or this one

You can find them cheaper somewhere else, but the remote must say "NEW 2in1" at the middle of the remote. like this:
wiiremote2in1

@takeru
Copy link
Owner

takeru commented Nov 10, 2019

Thanks.
Ah, but I have 4 wiimotes. I don't need more :)

@nathanRamaNoodles
https://github.com/takeru/Wiimote/blob/master/Wiimote.cpp#L626
http://wiibrew.org/wiki/Wiimote#0x31:_Core_Buttons_and_Accelerometer

You can change type of data from wiimote, accelerometer or IR sensor or, ...

@takeru takeru changed the title Device not connected (CHINESE COPY) Device not connected Nov 10, 2019
@nathanRamaNoodles
Copy link

nathanRamaNoodles commented Nov 10, 2019

I'm quite interested in how you connected a wii remote to an esp32. Where did you learn about HID? Also, my goal is to try to connect an xbox one s controller to the esp32 using a similar technique using HID, and I was wondering if it is possible.

@takeru
Copy link
Owner

takeru commented Nov 10, 2019

Please try this branch.
https://github.com/takeru/Wiimote/commits/control_pipe

@nathanRamaNoodles
Copy link

It works 0.0

Great Job 👍. I'm surprised you got it without having the remote :0

@nathanRamaNoodles
Copy link

Actually, there is one bug.
The buttons on the Wiimote don't respond after 20 button presses or 15 seconds after the first connection. After that, the esp32 stops receiving anything but the "1st player" LED on the Wiimote stays lit.

@takeru
Copy link
Owner

takeru commented Nov 10, 2019

nice!

after 20 button presses

any resource is leaked??

15 seconds after

any timeout?
can we extend timer by sending some command??

@nathanRamaNoodles
Copy link

Actually, It's just after 15 seconds. the 20 buttons presses were irrelevant after further testing. So I guess we need to figure out what keeps the connection going every 15 seconds.

The output is at the bottom; I changed the Serial output only for the wiimote number=0 len=4 161 48 0 0 Other than that, everything is from the master branch.

can we extend timer by sending some command??

I have no idea. I looked on the internet, and can't figure out why it won't keep the connection. Also, I don't know if it helps, but after the 15-second disconnection, pressing the sync button on the Wiimote does nothing; the Wiimote LEDs are still in "1st player" and the only way to get back into sync is to replace the battery and press sync again.

[D][Wiimote.cpp:177] start_scan(): queued reset.
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
[D][Wiimote.cpp:184] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:187] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:806] handle(): SEND => 01 09 10 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:195] process_command_complete_event(): read_bd_addr OK. BD_ADDR=FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:198] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:201] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:806] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
[D][Wiimote.cpp:209] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:213] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:806] handle(): SEND => 01 24 0C 03 04 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
[D][Wiimote.cpp:221] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:224] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:806] handle(): SEND => 01 1A 0C 01 03 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
[D][Wiimote.cpp:232] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:237] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:806] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
[D][Wiimote.cpp:258] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00 
[D][Wiimote.cpp:328] process_inquiry_complete_event(): inquiry_complete status=00
[D][Wiimote.cpp:177] start_scan(): queued reset.
[D][Wiimote.cpp:806] handle(): SEND => 01 03 0C 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
[D][Wiimote.cpp:184] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:187] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:806] handle(): SEND => 01 09 10 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:195] process_command_complete_event(): read_bd_addr OK. BD_ADDR=FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:198] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:201] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:806] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
[D][Wiimote.cpp:209] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:213] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:806] handle(): SEND => 01 24 0C 03 04 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
[D][Wiimote.cpp:221] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:224] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:806] handle(): SEND => 01 1A 0C 01 03 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
[D][Wiimote.cpp:232] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:237] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:806] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
[D][Wiimote.cpp:258] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:297] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:299] process_inquiry_result_event():     Class_of_Device = 04 25 00
[D][Wiimote.cpp:300] process_inquiry_result_event():     Clock_Offset = 16 50
[D][Wiimote.cpp:313] process_inquiry_result_event(): queued remote_name_request.
[D][Wiimote.cpp:806] handle(): SEND => 01 19 04 0A 52 9E BF 83 FC 0C 01 00 50 96 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 19 04 
[D][Wiimote.cpp:266] process_command_status_event(): remote_name_request pending!
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:321] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:321] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00 
[D][Wiimote.cpp:328] process_inquiry_complete_event(): inquiry_complete status=00
[D][Wiimote.cpp:177] start_scan(): queued reset.
[D][Wiimote.cpp:806] handle(): SEND => 01 03 0C 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00 
[D][Wiimote.cpp:184] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:187] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:806] handle(): SEND => 01 09 10 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:195] process_command_complete_event(): read_bd_addr OK. BD_ADDR=FB 5D EA 2D E6 B4 
[D][Wiimote.cpp:198] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:201] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:806] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00 
[D][Wiimote.cpp:209] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:213] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:806] handle(): SEND => 01 24 0C 03 04 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00 
[D][Wiimote.cpp:221] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:224] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:806] handle(): SEND => 01 1A 0C 01 03 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00 
[D][Wiimote.cpp:232] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:237] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:806] handle(): SEND => 01 01 04 05 33 8B 9E 05 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04 
[D][Wiimote.cpp:258] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:297] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:299] process_inquiry_result_event():     Class_of_Device = 04 25 00
[D][Wiimote.cpp:300] process_inquiry_result_event():     Clock_Offset = 95 64
[D][Wiimote.cpp:313] process_inquiry_result_event(): queued remote_name_request.
[D][Wiimote.cpp:806] handle(): SEND => 01 19 04 0A 52 9E BF 83 FC 0C 01 00 64 95 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 19 04 
[D][Wiimote.cpp:266] process_command_status_event(): remote_name_request pending!
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:321] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:293] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:321] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=07 len=255 data=00 52 9E BF 83 FC 0C 4E 69 6E 74 65 6E 64 6F 20 52 56 4C 2D 43 4E 54 2D 30 31 00 00 00 00 ...
[D][Wiimote.cpp:334] process_remote_name_request_complete_event(): remote_name_request_complete status=00
[D][Wiimote.cpp:337] process_remote_name_request_complete_event():   BD_ADDR = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:340] process_remote_name_request_complete_event():   REMOTE_NAME = Nintendo RVL-CNT-01
[D][Wiimote.cpp:347] process_remote_name_request_complete_event(): queued inquiry_cancel.
[D][Wiimote.cpp:356] process_remote_name_request_complete_event(): queued create_connection.
[D][Wiimote.cpp:806] handle(): SEND => 01 02 04 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 02 04 00 
[D][Wiimote.cpp:245] process_command_complete_event(): inquiry_cancel OK.
[D][Wiimote.cpp:806] handle(): SEND => 01 05 04 0D 52 9E BF 83 FC 0C 08 00 01 00 64 95 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 05 04 
[D][Wiimote.cpp:274] process_command_status_event(): create_connection pending!
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=03 len=11 data=00 81 00 52 9E BF 83 FC 0C 01 00 
[D][Wiimote.cpp:491] process_connection_complete_event(): connection_complete status=00
[D][Wiimote.cpp:499] process_connection_complete_event():   Connection_Handle  = 0x0081
[D][Wiimote.cpp:500] process_connection_complete_event():   BD_ADDR            = 0C FC 83 BF 9E 52 
[D][Wiimote.cpp:501] process_connection_complete_event():   Link_Type          = 01
[D][Wiimote.cpp:502] process_connection_complete_event():   Encryption_Enabled = 00
[D][Wiimote.cpp:374] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 01 04 00 11 00 40 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 40 00 01 00 02 00 
[D][Wiimote.cpp:529] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:530] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:531] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:532] process_l2cap_connection_response():   source_cid      = 0040
[D][Wiimote.cpp:533] process_l2cap_connection_response():   result          = 0001
[D][Wiimote.cpp:534] process_l2cap_connection_response():   status          = 0002
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 01 08 00 40 00 40 00 00 00 00 00 
[D][Wiimote.cpp:529] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:530] process_l2cap_connection_response():   identifier      = 01
[D][Wiimote.cpp:531] process_l2cap_connection_response():   destination_cid = 0040
[D][Wiimote.cpp:532] process_l2cap_connection_response():   source_cid      = 0040
[D][Wiimote.cpp:533] process_l2cap_connection_response():   result          = 0000
[D][Wiimote.cpp:534] process_l2cap_connection_response():   status          = 0000
[D][Wiimote.cpp:555] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 02 08 00 40 00 00 00 01 02 40 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 02 0A 00 40 00 00 00 00 00 01 02 40 00 
[D][Wiimote.cpp:567] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
[D][Wiimote.cpp:568] process_l2cap_configuration_response():   identifier      = 02
[D][Wiimote.cpp:569] process_l2cap_configuration_response():   len             = 000A
[D][Wiimote.cpp:570] process_l2cap_configuration_response():   source_cid      = 0040
[D][Wiimote.cpp:571] process_l2cap_configuration_response():   flags           = 0000
[D][Wiimote.cpp:572] process_l2cap_configuration_response():   result          = 0000
[D][Wiimote.cpp:573] process_l2cap_configuration_response():   config          = 01 02 40 00 
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 04 01 08 00 40 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:583] process_l2cap_configuration_request(): L2CAP CONFIGURATION REQUEST
[D][Wiimote.cpp:584] process_l2cap_configuration_request():   identifier      = 01
[D][Wiimote.cpp:585] process_l2cap_configuration_request():   len             = 08
[D][Wiimote.cpp:586] process_l2cap_configuration_request():   destination_cid = 0040
[D][Wiimote.cpp:587] process_l2cap_configuration_request():   flags           = 0000
[D][Wiimote.cpp:588] process_l2cap_configuration_request():   config          = 01 02 FF 00 
[D][Wiimote.cpp:600] process_l2cap_configuration_request():   MTU=255
[D][Wiimote.cpp:621] process_l2cap_configuration_request(): queued acl_l2cap_single_packet(CONFIGURATION RESPONSE)
[D][Wiimote.cpp:374] _l2cap_connect(): queued acl_l2cap_single_packet(CONNECTION REQUEST)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 12 00 0E 00 01 00 05 01 0A 00 40 00 00 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 0C 00 08 00 01 00 02 03 04 00 13 00 41 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 03 08 00 41 00 41 00 01 00 02 00 
[D][Wiimote.cpp:529] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:530] process_l2cap_connection_response():   identifier      = 03
[D][Wiimote.cpp:531] process_l2cap_connection_response():   destination_cid = 0041
[D][Wiimote.cpp:532] process_l2cap_connection_response():   source_cid      = 0041
[D][Wiimote.cpp:533] process_l2cap_connection_response():   result          = 0001
[D][Wiimote.cpp:534] process_l2cap_connection_response():   status          = 0002
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 03 03 08 00 41 00 41 00 00 00 00 00 
[D][Wiimote.cpp:529] process_l2cap_connection_response(): L2CAP CONNECTION RESPONSE
[D][Wiimote.cpp:530] process_l2cap_connection_response():   identifier      = 03
[D][Wiimote.cpp:531] process_l2cap_connection_response():   destination_cid = 0041
[D][Wiimote.cpp:532] process_l2cap_connection_response():   source_cid      = 0041
[D][Wiimote.cpp:533] process_l2cap_connection_response():   result          = 0000
[D][Wiimote.cpp:534] process_l2cap_connection_response():   status          = 0000
[D][Wiimote.cpp:555] process_l2cap_connection_response(): queued acl_l2cap_single_packet(CONFIGURATION REQUEST)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 10 00 0C 00 01 00 04 04 08 00 41 00 00 00 01 02 40 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=22 data=81 20 12 00 0E 00 01 00 05 04 0A 00 41 00 00 00 00 00 01 02 40 00 
[D][Wiimote.cpp:567] process_l2cap_configuration_response(): L2CAP CONFIGURATION RESPONSE
[D][Wiimote.cpp:568] process_l2cap_configuration_response():   identifier      = 04
[D][Wiimote.cpp:569] process_l2cap_configuration_response():   len             = 000A
[D][Wiimote.cpp:570] process_l2cap_configuration_response():   source_cid      = 0041
[D][Wiimote.cpp:571] process_l2cap_configuration_response():   flags           = 0000
[D][Wiimote.cpp:572] process_l2cap_configuration_response():   result          = 0000
[D][Wiimote.cpp:573] process_l2cap_configuration_response():   config          = 01 02 40 00 
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=20 data=81 20 10 00 0C 00 01 00 04 02 08 00 41 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:583] process_l2cap_configuration_request(): L2CAP CONFIGURATION REQUEST
[D][Wiimote.cpp:584] process_l2cap_configuration_request():   identifier      = 02
[D][Wiimote.cpp:585] process_l2cap_configuration_request():   len             = 08
[D][Wiimote.cpp:586] process_l2cap_configuration_request():   destination_cid = 0041
[D][Wiimote.cpp:587] process_l2cap_configuration_request():   flags           = 0000
[D][Wiimote.cpp:588] process_l2cap_configuration_request():   config          = 01 02 FF 00 
[D][Wiimote.cpp:600] process_l2cap_configuration_request():   MTU=255
[D][Wiimote.cpp:621] process_l2cap_configuration_request(): queued acl_l2cap_single_packet(CONFIGURATION RESPONSE)
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 12 00 0E 00 01 00 05 02 0A 00 41 00 00 00 00 00 01 02 FF 00 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:718] process_acl_data(): **** ACL_DATA len=16 data=81 20 0C 00 08 00 41 00 A1 20 00 00 00 00 00 48 
[D][Wiimote.cpp:402] _set_led(): queued acl_l2cap_single_packet(Set LEDs)
[D][Wiimote.cpp:421] _set_reporting_mode(): queued acl_l2cap_single_packet(Set reporting mode)
[D][Wiimote.cpp:630] process_report(): REPORT len=8 data=A1 20 00 00 00 00 00 48 
32 0 0 0 0 0 72 
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 07 00 03 00 41 00 A2 11 10 
[D][Wiimote.cpp:630] process_report(): REPORT len=4 data=A1 30 00 00 
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 08 00 04 00 41 00 A2 12 00 30 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:630] process_report(): REPORT len=6 data=A1 22 00 00 11 00 
0 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:630] process_report(): REPORT len=6 data=A1 22 00 00 12 00 
0 
[D][Wiimote.cpp:421] _set_reporting_mode(): queued acl_l2cap_single_packet(Set reporting mode)
[D][Wiimote.cpp:630] process_report(): REPORT len=8 data=A1 20 00 00 10 00 00 48 
0 0 72 
[D][Wiimote.cpp:806] handle(): SEND => 02 81 20 08 00 04 00 41 00 A2 12 00 30 
[D][Wiimote.cpp:741] process_hci_event(): **** HCI_EVENT code=13 len=5 data=01 81 00 01 00 
[D][Wiimote.cpp:759] process_hci_event():   (Number Of Completed Packets Event)
[D][Wiimote.cpp:630] process_report(): REPORT len=6 data=A1 22 00 00 12 00 
wiimote number=0 len=6 161 34 0 0 18 0 
[D][Wiimote.cpp:630] process_report(): REPORT len=4 data=A1 30 00 02 
wiimote number=0 len=4 161 48 0 2 
[D][Wiimote.cpp:630] process_report(): REPORT len=4 data=A1 30 00 00 
wiimote number=0 len=4 161 48 0 0 
[D][Wiimote.cpp:630] process_report(): REPORT len=4 data=A1 30 00 01 
wiimote number=0 len=4 161 48 0 1 
[D][Wiimote.cpp:630] process_report(): REPORT len=4 data=A1 30 00 00 
wiimote number=0 len=4 161 48 0 0 

@takeru
Copy link
Owner

takeru commented Nov 10, 2019

Please compare two logs: official wiimote and chinese.
I found "QoS Setup Complete Event" is in official, but not in chinese.
Any other changes?

To send some command from ESP32 to wiimote:
Please add here
https://github.com/takeru/Wiimote/blob/control_pipe/Wiimote.cpp#L709

if(UP button is pushed){
  _set_led(connection_handle, 0b0001);
}
if(DOWN button is pushed){
  _set_led(connection_handle, 0b0010);
}

_set_led may extend timer.

@nathanRamaNoodles
Copy link

Nope, still gets stuck after 15 seconds. I also have a newer Official Wii remote and it doesn't connect to the esp32; in fact, it behaves just like the output of @CorrederaJorge's remote. At least the Chinese one works for a while ;)

@takeru
Copy link
Owner

takeru commented Nov 11, 2019

hmm, can you try _set_reporting_mode() to extend timer?
if you fork repo and share me modified code, it may help our communications.

Your newer official one is wii remore plus? or do you know revision? please check the wiki document.

Mine is very old, it is not have plus sensors. I have plug-in sensors.

@nathanRamaNoodles
Copy link

fork repo

Alright, if I can get it working.

Your newer official one is wii remote plus?

yes, it has plus motion included.
I think the controller needs to vibrate/rumble at least once after connection for the new remotes. Is there a way to get that to work? The command is 0x10, but I don't know how to execute that using a method similar to set_led.

@CorrederaJorge
Copy link
Author

CorrederaJorge commented Nov 11, 2019

@takeru @nathanRamaNoodles I compiled, uploaded and it works at first. I need to check stability problems as @nathanRamaNoodles said.

Great job!!!. Thank you very much!!!.

@takeru
Copy link
Owner

takeru commented Nov 12, 2019

4fec324

@nathanRamaNoodles
Yes, it is 0x10. You are almost done.
Please diff with _set_led. It is easy.

@CorrederaJorge
Copy link
Author

hmm, can you try _set_reporting_mode() to extend timer?
if you fork repo and share me modified code, it may help our communications.

Your newer official one is wii remore plus? or do you know revision? please check the wiki document.

Mine is very old, it is not have plus sensors. I have plug-in sensors.

Hi:

It disconnects after 15 seconds but if I set continuous reporting mode with _set_reporting_mode instruction it keeps sending info.

Kind regards.

@nathanRamaNoodles
Copy link

It disconnects after 15 seconds but if I set continuous reporting mode with _set_reporting_mode instruction it keeps sending info.

@CorrederaJorge, Can I see your code, I can't seem to get it to work.
@takeru
Here is my Fork of the project with code

@CorrederaJorge
Copy link
Author

Replace _set_reporting_mode(connection_handle, 0x30, false); by _set_reporting_mode(connection_handle, 0x30, true); and _set_reporting_mode(connection_handle, 0x32, false) by _set_reporting_mode(connection_handle, 0x32, true) in @takeru code.

@nathanRamaNoodles
Copy link

I tried that, but in the serial monitor it continues printing the buttons pressed and then stops after 5-7 seconds. I don't know what's going on. I also have genuine wii remotes that are the latest ones(2017) and they don't connect at all.

@takeru
Copy link
Owner

takeru commented Nov 17, 2019

@nathanRamaNoodles

"Wii Motion Plus" is one of extension controller.
http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus

But, I tested and implemented only Nunchuck.
https://github.com/takeru/Wiimote/blob/master/Wiimote.cpp#L657

You may have to initialize the "Plus".
Do you have wiimote without "Plus" ?

@CorrederaJorge
Did your wiimote have "Plus" ? or not ?

@nathanRamaNoodles
Copy link

I have a wii mote with plus.

@milkpirate
Copy link

Hey, I also having trouble with connecting my WiiMote Plus. I seem a legit Nintendo one... here is the log:

$ pio device monitor
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM11  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

<press 1+2 on wiimote>

[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 08 05 00
[D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = B4 0D
[D][Wiimote.cpp:295] process_inquiry_result_event(): skiped to remote_name_request. (not Wiimote COD)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00
[D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
[D][Wiimote.cpp:157] start_scan(): queued reset.
[D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00
[D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 5A F1 68 1C 52 10
[D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=5A F1 68 1C 52 10
[D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00
[D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00
[D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00
[D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04
[D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 08 05 00
[D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = 33 22
[D][Wiimote.cpp:295] process_inquiry_result_event(): skiped to remote_name_request. (not Wiimote COD)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=01 len=1 data=00
[D][Wiimote.cpp:308] process_inquiry_complete_event(): inquiry_complete status=00
[D][Wiimote.cpp:157] start_scan(): queued reset.
[D][Wiimote.cpp:780] handle(): SEND => 01 03 0C 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 03 0C 00
[D][Wiimote.cpp:164] process_command_complete_event(): reset OK.
[D][Wiimote.cpp:167] process_command_complete_event(): queued read_bd_addr.
[D][Wiimote.cpp:780] handle(): SEND => 01 09 10 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=10 data=05 09 10 00 5A F1 68 1C 52 10
[D][Wiimote.cpp:175] process_command_complete_event(): read_bd_addr OK. BD_ADDR=5A F1 68 1C 52 10
[D][Wiimote.cpp:178] process_command_complete_event(): sizeof(name)=15
[D][Wiimote.cpp:181] process_command_complete_event(): queued write_local_name.
[D][Wiimote.cpp:780] handle(): SEND => 01 13 0C F8 45 53 50 33 32 2D 42 54 2D 4C 32 43 41 50 00 00 00 00 00 00 00 00 00 00 00 00 ...
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 13 0C 00
[D][Wiimote.cpp:189] process_command_complete_event(): write_local_name OK.
[D][Wiimote.cpp:193] process_command_complete_event(): queued write_class_of_device.
[D][Wiimote.cpp:780] handle(): SEND => 01 24 0C 03 04 05 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 24 0C 00
[D][Wiimote.cpp:201] process_command_complete_event(): write_class_of_device OK.
[D][Wiimote.cpp:204] process_command_complete_event(): queued write_scan_enable.
[D][Wiimote.cpp:780] handle(): SEND => 01 1A 0C 01 03
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0E len=4 data=05 1A 0C 00
[D][Wiimote.cpp:212] process_command_complete_event(): write_scan_enable OK.
[D][Wiimote.cpp:217] process_command_complete_event(): queued inquiry.
[D][Wiimote.cpp:780] handle(): SEND => 01 01 04 05 33 8B 9E 05 00
[D][Wiimote.cpp:715] process_hci_event(): **** HCI_EVENT code=0F len=4 data=00 05 01 04
[D][Wiimote.cpp:238] process_command_status_event(): inquiry pending!
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:277] process_inquiry_result_event():     Page_Scan_Repetition_Mode = 01
[D][Wiimote.cpp:279] process_inquiry_result_event():     Class_of_Device = 08 05 00
[D][Wiimote.cpp:280] process_inquiry_result_event():     Clock_Offset = B3 36
[D][Wiimote.cpp:295] process_inquiry_result_event(): skiped to remote_name_request. (not Wiimote COD)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
[D][Wiimote.cpp:273] process_inquiry_result_event(): **** inquiry_result BD_ADDR(0/1) = 9C E6 35 C8 54 5C
[D][Wiimote.cpp:301] process_inquiry_result_event():  (dup idx=0)
...

<keeps repeating>

Could you help out with that one?

@SuperTankMan
Copy link

Please try this branch. https://github.com/takeru/Wiimote/commits/control_pipe

Hi Takeru,

First thank you so much for your efforts in this project.
Are you planning to merge the control_pipe branch to the main branch? If not please explain why not?

@takeru
Copy link
Owner

takeru commented Oct 29, 2023

https://github.com/takeru/Wiimote/network

I never thought it would be a code that would last this long. Thank you.

I don't know where the best code is.
I can't even decide if it's good to merge or not, but I think the other one is better than MASTER.

I'd be happy to look into what master should be and let you know.

@SuperTankMan
Copy link

Its just I used the MASTER code first but could not get my cheap copy of Wiimote to work until I saw that some one else also had this issue. The I used your control_pipe build and it worked wonders :)

I think it would be nice to have a :
#define ORIGNAL_WIIMOTE true //false - for cheap copy type1
then use #if ORIGNAL_WIIMOTE {....}
That way you can choose the WiiMote type at compile time,
Its just an idea but perhaps you can do something similar or smarter. :p

@takeru
Copy link
Owner

takeru commented Nov 1, 2023

The original also work with the newer branch, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants