T3.6 USB Host - Bluetooth

Only Bt Joy I have it PS3 - I forget the magic SYNC PGM buttons, I hit them once somehow and it said ~'no Bt controller found' [that post might be a good Post#1 footnote for *Special Features]
Your not the only one that forgot - me too :)
 
I updated my version of the JoystickBT to have the LEDs stuff like:
Code:
  if (buttons != buttons_prev) {
    uint8_t leds = 0;
    if (buttons & 0x8000) leds = 1;   //Srq
    if (buttons & 0x2000) leds = 2;   //Cir
    if (buttons & 0x1000) leds = 4;   //Tri
    if (buttons & 0x4000) leds = 8;   //X
    //Cross = 2
And now on both USB and BT on Sony PS3 it shows the leds of 1, 2, 3, 4

With the one that I have that is a Clone:
Manufacturer: SHANWAN (The PS button has P3 in it).

It appears to work BT, but maybe not USB, although it worked enough for me to do the pair sequence.
 
@mjs513 @defragster, and @milan7 - Please try sinking up and see if this helps.

I pushed up change that now hopefully properly processes the event: EV_INQUIRY_RESULTS_WITH_RSSI

The data size is identical to EV_INQUIRY_RESULT (old version) except some of the fields got pushed around a little, and one reserved field in the middle got used for RSSI, but it was at the end...

My RII keyboard is working now. Could test mouse again (but I am using it on my desktop) as I like it better than the logitech one ;)

Thanks alot! I will check it in 4 hours and hopefully it works. Also why there is tcode directory? I have installed Arduino IDE under C: program file. Is it an external drive? Just double checking I don't need any other libraries or dependencies.
 
Gave up on forum search - found this in Joy code: // PS button just pressed and select button pressed act like PS4 share like...
Again on power up this was shown:
Code:
*** Device Bluet a5c:21e8 - connected ***
  manufacturer: Broadcom Corp
  product: BCM20702A0
  Serial: 5CF37060D3E1
  BDADDR: 0:0:0:0:0:0

Had to unplug Bluet and replug - was noted in that post ...

Code:
*** Device Bluet a5c:21e8 - connected ***
  manufacturer: Broadcom Corp
  product: BCM20702A0
  Serial: 5CF37060D3E1
  BDADDR: e1:d3:60:70:f3:5c

Then I got :
Code:
PS3 Pairing Request - Attempt pair to: e1:d3:60:70:f3:5c
  Pairing complete (I hope), make sure Bluetooth adapter is plugged in and try PS3 without USB

Though PS3 Bt won't pair? - replugged Bluet again to get it to show address - that didn't help -

Had to recompile with not 'true':: JoystickController joystick1(myusb);

Then it powered up working - with Rumble button 2's and all - even though this was displayed: BDADDR: 0:0:0:0:0:0

Tried to repeat with alternate Bt Dongle and it failed associate - stuck on the first adapter? Hadn't done a reset - maybe it held the prior ADDR?
Seems so did a clean restart and Now Works ::
Code:
PS3 Pairing Request - Attempt pair to: 11:71:da:7d:1a:0

Something like this in post #1?
For PS3 controller it must be USB paired in advance - plug in cable to PS3 - then Bt Dongle to see non-zero BDADDR:
To initiate Bt pair - while on USB:: Hold select button and press PS button to set controller associate.
 
defragster said:
Something like this in post #1?
For PS3 controller it must be USB paired in advance - plug in cable to PS3 - then Bt Dongle to see non-zero BDADDR:
To initiate Bt pair - while on USB:: Hold select button and press PS button to set controller associate.
Yep - that's exactly whats needed and we should probably add to the sketch as well
 
Good work Kurt!

Glad I stopped being distracted long enough to fire up and test to catch that issue before it wasn't fresh enough to catch and fix it quickly.

Hopefully @milan7 has a good report?

Also good to edit in to post #1 might be my notes summarizing testing: 'true' versus not for New bind versus existing, Add Serial1 when DEBUG added if desired/needed.
 
@KurtE and @defragster

Kurt. Thanks for merging the joystick sketches update. Tim- I incorporated your PS3 pairing comment into the BT sketch :)

I added a couple of dongles that I have been using to post#1. Not sure if you want to add the USB joysticks or just stick with BT.
 
@mjs513 and @defragster - Thanks and it was easy to merge (just a couple mouse clicks ;) )

It is hard to figure out how/where to describe all of this stuff... So probably good place to describe some of the joysticks as well.

Probably should also update the Joystick thread posting 1 to also include information and maybe have links to each other.

Also another simple thing I probably should go through and maybe update, is I am probably displaying the bluetooth address incorrectly.

That is currently we have arrays like BDADDR[6], and I simply do something like:
Code:
          Serial.printf("  BDADDR: %x:%x:%x:%x:%x:%x\n", bdaddr[0], bdaddr[1], bdaddr[2], bdaddr[3], bdaddr[4], bdaddr[5]);
But I think the address is stored more or less LSB to MSB so maybe should output more like:
And
Code:
          Serial.printf("  BDADDR: %x:%x:%x:%x:%x:%x\n", bdaddr[5], bdaddr[4], bdaddr[3], bdaddr[2], bdaddr[1], bdaddr[0]);

At least I know that there are some places I have seen the address displayed in reverse order. Like on Linux running sixpair operation.
Probably should check to see if I can find anywhere where one of these is displayed. Like on the device itself of packing...
 
@KurtE

When I used the windows sixaxis I did notice that BDADDR was in the reverse order that you had it. The other I noticed for the BT dongle that I was using the SN of the BT dongle contained the BDADDR. Meant to mention it but kept getting side tracked with something else - sorry about that.

Probably would be good to keep all the info on whats been tested and works in one post and then reference that post in the other thread? You choice. :)

EDIT: Or we can also put it on the readme page for the USBHost_t36?
 
@mjs513 -

Device address: I plugged some dongle into windows and into T4:
On windows in device manager it showed up as: 0:1a:7d:da:71:13
And in our test app:
Code:
*** Device Hub1 5e3:608 - connected ***
  product: USB2.0 Hub
*** Device Bluet a12:1 - connected ***
  product: CSR8510 A10
  BDADDR: 13:71:da:7d:1a:0

So will try to update some/all of our test apps that show this data to reverse the order.

I agree one place would be great! As for choice where? For starter here may be as good as anywhere...

Alternative we could create new thread, something like: USBHost_t36 library - usage and tested devices
Someone could probably choose a better name :D

But as you said it would be great if we had information in one place that described what keyboards, and mice, and joysticks, and MIDI, USB Hubs... That we have tried and we believe is working and likewise some we know that are not working (example the Microsoft ... Mouse that uses LE to talk...)
 
@mjs513 - One thing I was noticing in the edit, is that there appears to be two versions of the JoystickBT example now:
https://github.com/KurtE/USBHost_t36/tree/WIP2-Bluetooth/examples/JoystickBT

and new:

https://github.com/KurtE/USBHost_t36/tree/WIP2-Bluetooth/examples/JoystickBT/JoystickBT

Wondering if you wanted the subdirectory version to be moved up to overwrite the previous version?

Or thinking that maybe there will be multiple different Joystick sketches so you wanted the new sub directory and maybe should remove the old version?
 
KurtE said:
Wondering if you wanted the subdirectory version to be moved up to overwrite the previous version?
Ok messed up the push - meant for it to overwrite what was already there - sorry.

I agree one place would be great! As for choice where? For starter here may be as good as anywhere...
Guess for now this is as good as anywhere else until we decided.
 
@mjs513 - Not a problem, I will go ahead and move it up...

@mjs513, @defragster, @Paul - Obviously another place that would be good to put some documentation for this would probably be in a Readme or Readme.md file as part of the project. ???

UPDATE: pushed up changes in order of Bluetooth Address printing, also moved the JoystickBT version up one level. You might want to double check I did not screw up something
 
Last edited:
@KurtE, @defragster

Thanks and agreed respectively :)

BTW - been busy updating the table in Post #1. Broke it up into two sections - dongles and devices. Figured it might be easier to read.
 
Oh … BTW ... good work on your part too @mjs513.

Clean New Thread seems called for - 15 pages of stuff here is now historical not perhaps overly useful going forward - except maybe the linux notes :)

Maybe a good thread name - not likely from me - with a Top Level posts for: README, HARDWARE, ISSUES? :: Teensy USBHost 2019 Dev and Usage

Having a usable distillation of USB from this HOST perspective would be good. It isn't the same as one step pairing on Phone/Computer where what actually happens is hidden? It was news here that the device was recording the Bt dongle ADDR#, not the other way around.

Would be nice to have a sample 'user app' tied to an ILI9341 or something that emulated real usage and message processing? Also a COMBO sketch showing Mouse/Joy/KBD where possible?

BTW: I last connected Bt PS3 to T_3.6 yesterday - and woke it a couple times last night to work processing messages { dongle blue light been active } just woke the PS3 and indeed the T_3.6 is awake and showing messages!
"T:\\arduino_1.8.9_146\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "T:\\TEMP\\arduino_build_JoystickBT.ino/JoystickBT.ino.elf"
Sketch uses 80744 bytes (7%) of program storage space. Maximum is 1048576 bytes.
Global variables use 19208 bytes (7%) of dynamic memory, leaving 242936 bytes for local variables. Maximum is 262144 bytes.

Speaking of Linux - did some trivial WSL stuff. I found and installed linux notepadqq (Notepad++) and that works with my Xming. Found my .bashrc and added some alias's to exd (export DISPLAY=:0) and npp (notepadqq &), and got rid of the hideous unreadable dark_UV_Blue. I tried to install SublimeText last week - and think it is installed - but won't show up - not sure of EXE name?

I also noted that 49-teensy.rules referred to [ KERNEL=="ttyACM*" ] but in WSL I see:
ls /dev
block tty3 ttyS112 ttyS128 ttyS143 ...
So wondering if the .rules needed an edit to associate the 'tty' devices as "ttyS*" instead of "ttyACM*" - or some other variation?
Difference between /dev/ttyACM0 and /dev/ttyS0 - maybe this needs to be changed in TyCommander?

And located a mapping of Dos Batch to Shell script CMDS - may try to port Compile.CMD … but limited value without getting working Arduino/TyComm
 
@KurtE - @defragster

Would be nice to have a sample 'user app' tied to an ILI9341 or something that emulated real usage and message processing? Also a COMBO sketch showing Mouse/Joy/KBD where possible?
funny you should mention it - was thinking about that last night. But put it on the back burner because trying to make sure we have the basics done first and everything working.

Was also thinking about a good real world example to show mapping to actual usage. Now very good with ILI9341 apps though - wish there was a GUI to design the screen - think I am getting spoiled with GUIs.

Oops - forgot working with tonton81 on his other Flexcan library for the T$ so jumping back and forth.

@defragster - just about doubled the size of your Post #1 list :)
 
Post #1 looking useful - editing that table is no fun.

Not sure about Ideal look for ILI9341 screen? Maybe:
> Reserved line for HUB ID - status of Device Cnt?
> Reserved line for Bt Dongle ID - status of Device Cnt?, Mode 'Pair "true"'?
> Reserved line(s) for JOY ID, position (x,y)'s, line for button state, 3DOF vals?
> Reserved line(s) similar for Mouse ID, (x,y) and buttons?
> Lower area scrolling lines of free form text from keyboard?, and device change notes?

Option to send status that are not SPEW to USB?

When I was doing Touch Dev I had interface to debug to Line# on some of the screen so status updated in place instead of scrolling for readability - similar to the 10 index elements I started debug_tt with.
 
Post #1 looking useful - editing that table is no fun.

Not sure about Ideal look for ILI9341 screen? Maybe:
> Reserved line for HUB ID - status of Device Cnt?
> Reserved line for Bt Dongle ID - status of Device Cnt?, Mode 'Pair "true"'?
> Reserved line(s) for JOY ID, position (x,y)'s, line for button state, 3DOF vals?
> Reserved line(s) similar for Mouse ID, (x,y) and buttons?
> Lower area scrolling lines of free form text from keyboard?, and device change notes?

Option to send status that are not SPEW to USB?

When I was doing Touch Dev I had interface to debug to Line# on some of the screen so status updated in place instead of scrolling for readability - similar to the 10 index elements I started debug_tt with.

Yeah - you are right, that table is no fun - but don't think I have anything else to add to it right now. :)

As for an example found this for a PS4 type joystick: https://forum.arduino.cc/index.php?topic=375394.0
 
@KurtE and @defragster and others

I started going through the reference pacman sketch for the due. The biggest problem I am seeing, for me is there use of the ili9341_due. It is based on the ILI9341_t3 lib for the Teensy with several added functions that I am not sure should be incorporated or modified. Supposedly it does have ref to dma but not 100% sure they are using it. If you all can have a look and let me know what you think and best way to go.

Thanks
Mike

Yes I am getting sidetracked again :) blame defragster this time
 
@mjs513 and @Sidetracker ;) - Looks like fun. If I remember correctly the ili9341_due used DMA as it was the only way to do fast SPI transfers on the DUE.

It has been awhile since I looked at the library, wonder how many of the different functions in this library I already have some form of in the ili9341_t3n library.
But I did clone the app and downloaded to my machine, so will see if I get side tracked as well.

Thanks all of you for editing posting #1 as well. There sure has to be a better way to edit such tables! I found Another BT adapter that I am not sure if it works or not.

I think I purchased this one a long time ago, I think to try to hook up to something like an SSC-32...
Code:
*** Device Bluet c10:0 - connected ***
  manufacturer: SiW
  product: SiW
  Serial: A643F1EF1300
  BDADDR: 0:1a:7d:da:71:13

It does appear to work with the Rii keyboard... I was able to do the pairing.

Earlier it did not appear to work with a couple of PS3 clones....

At least it did not appear to work with the one I have with Crifeir marked on the front:
https://smile.amazon.com/gp/product/B078WB8LLN

Trying to decide if it is worth trying to debug as it is cheap and feels like something lose inside... Could just be bad... Or maybe just slightly off on communications ...

Edit: Actually now it appears to be working...
 
@mjs513 and @Sidetracker ;) - Looks like fun. If I remember correctly the ili9341_due used DMA as it was the only way to do fast SPI transfers on the DUE.

It has been awhile since I looked at the library, wonder how many of the different functions in this library I already have some form of in the ili9341_t3n library.
But I did clone the app and downloaded to my machine, so will see if I get side tracked as well.

Thanks all of you for editing posting #1 as well. There sure has to be a better way to edit such tables! I found Another BT adapter that I am not sure if it works or not...…..
To be honest Kurt never looked at t3n just t3 :( So I just decided to see if I can kludge it to work with a PS4. Got through all the changes and errors I got (just using SPI.transfer) - which is my kludge to start but stuck on the silliest error - probably because I am tired:
Code:
D:\Users\Merli\Documents\Arduino\Pacman-Arduino-Due-NESPAD\Pacman-Arduino-Due-NESPAD.ino:533:1: error: 'Playfield' does not name a type

 Playfield _game =  Playfield();;

No problem with the table - figured I better get it updated before I forgot or get sidetracked :)

Playfield is a class that is embedded in the sketch. Anyway I am attaching my changes if you want to check it out:
 

Attachments

  • Pacman-Arduino-Due-NESPAD.zip
    180.5 KB · Views: 52
@mjs513 - Looks like you are having fun!

I try to get distracted enough to take a look.

I also did some more updating of the table, while I was at it, I also tried my Kinesis FreeStyle2 Blue keyboard and it worked (shown in table).

As for the Table: Over the last year or so, I have tested with quite a few other things along the way and not sure I have the energy to put all of them into the table.

Things like: Probably 10 different keyboards like: Microsoft Sculpt Mouse and keyboard combo. Logitech Ergo mouse/keyboard combo, Logitech K400+, HP Keyboard, Dell Keyboard with built in USB Hub, Gigabyte Force K83 keyboard, Another random DELL keyboard,

Likewise Mice: Some in the above, A wired Dell mouse, wired HP house, Wired Belkin Mouse,

Wacom Tablet:
Code:
*** Device HID1 56a:d8 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: CTH-661
*** Device HID2 56a:d8 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: CTH-661
*** HID Device Mouse1 56a:d8 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: CTH-661

Several different HUBs ...
 
Wow Kurt - you have been busy - maybe we should just make a list instead of continuing to update the table. It is a bit much to keep updating. :) I do have a Wacom tablet - I should give it a try :)
 
Back
Top