Teensy 3.x NATIVE USB HOST PREVIEW AVAILABLE

Status
Not open for further replies.
MajorTom, a few people have contributed their valuable time to implement this very difficult feature of the Teensy. The designers of this library are in no way forced to spend time doing this. Some have very busy lives. The users are also not entitled to anything, as your comment seems to imply.
I hope you understand that demanding things in the way you've done is not only rude, but also counterproductive. How is anybody going to help you when you write a message like that?
Please, rewrite you message, follow the forum rules (especially that one at the very top of this page), and hopefully we all can have a productive and pleasant discussion.
 
I think its not rude.. its desperately.

I have also criticized the crappy Blender 3D user interface... since years before V1.5/1.6 ... again and again in their forum, because 3D Max had a perfect interface, and my question was "why the hell are you doing nothing against the crappy user interface? You are did awesome code and inserted amazing features... but who can operate with that crappy interface?! Do it like 3D Max ... make it usable!"

After 2 years... they did it in the v1.5/1.6 ... and now its the best freeware 3D Studio ever.

The same here ... UHS30 is maybe amazing and working... but that does not work if you do not explain to people how they can use it. Write a short nice simple tutorial. That's it. Its maybe done in 15 Minutes... and then usable (and you will help hundreds of people). At this time only the hardcore coders can use it. This makes no sense... and then do not release it, or make it so simple that everyone can understand it (self explaining).

I've written a lot tutorials and instructions, and they love it ("Amazing!"), because I'm sometimes an idiot... and I know what I have to do that everybody understand it (include myself). Make it for idiots.
 
Last edited:
... people have contributed their valuable time ... demanding things in the way you've done is not only rude, but also counterproductive. How is anybody going to help you when you write a message like that?
Please, rewrite you message, follow the forum rules (especially that one at the very top of this page), and hopefully we all can have a productive and pleasant discussion.

+1 - well said Pedvide . . .
 
... people have contributed their valuable time ... demanding things in the way you've done is not only rude, but also counterproductive. How is anybody going to help you when you write a message like that?
Please, rewrite you message, follow the forum rules (especially that one at the very top of this page), and hopefully we all can have a productive and pleasant discussion.

it is an incentive... most people need that. Often they are doing something... and not thinking about it.
 
it is an incentive... most people need that. Often they are doing something... and not thinking about it.


Incentive is great - offer to help - be appreciative - explain why you are in dire need and how it would be ever so helpful and how you'd work to test it - show what you tried or where you got stuck -

- I read the post as the opposite . . . not only rude, but also counterproductive . . .
 
Ok, I also wisht the USB hosting feature would work, and the examples given would actually compile. I've spent hours/days/weeks tearing my hair out trying to understand how it works.
It works perfectly on the MegaADK I have.
I bought some mini USB host for arduino modules. But have not implemented them because there is only a single example project that compiles and functions and is understandable.
So I gave up. As you use the libraries provided you can almost feel how close you are to cracking it and gettign usable USB hosting functions (I was planning to controll a DSLR with the usb host).
I have tried to get in contact with the authors, but have been told to wait for the senior programmer of the PTP . I have contacted him a number of times, but unfortunately I never got a response.

Major tom - it is rude what you have said.

I too feel your pain. I lost my patience and gave up - but I didn't lose my temper.

I use 3ds Max all the time :) legally :)
I've said my 2 cents.
 
Ok, I also wisht the USB hosting feature would work, and the examples given would actually compile. I've spent hours/days/weeks tearing my hair out trying to understand how it works.

:)

I have no problem with normal Android + USB Jost shield or Arduino Mega ADK. But Teensy 3.x is different... here you have only one USB port. And that should work as USB Host. BUt as I said... there is no tutorial, so I can not use it. I think I have to wait 2 years, like with Blender 3D.

I use 3ds Max all the time :) legally :)

Me too, paid: ~8000€ for 3D Max Studio + Combustion
 
Hello xxajk

Great that you made a USB host library.
But there is absolutely no documentation.
On Github the Wiki es empty.

So I have no idea how to use it.

I don't even understand why there are several folders USB_HOST_SHIELD in your code ?

I understood from your first posting that this library is for using the Teensy WITHOUT Host shield.

There are several examples but there is not even one comment explaining what the sample is for.

It is obvious that you made this library only for you but not for the comunity.
That is sad.

Do I ask too much to inverst maybe 2 hours to write at least a small tutorial ?

Currently your code is completely useless for me.
 
First, and foremost, the library set is beta.

Secondly, it does not have a lot of drivers yet, due to my limited time.
Please try to explain what you are looking for specifically. What you may be expecting to be there may be still unwritten anyway.

Third, the several directories are there because each component is now a separate library.
This makes it easier to have a third party write a driver independently, and also keeps everything organized.
As a side bonus, you don't have to compile what you don't want. The older versions compiled every driver -- even if you didn't use it.

Lastly, there really isn't much to understand, and there are demos for the Kinetis USB host mode. This is one for storage.
https://github.com/felis/UHS30/tree/master/libraries/UHS_host/UHS_BULK_STORAGE/examples/UHS_KINETIS_FS_HOST/TEST_BULK_K
If you are looking for the serial example to work, it is a one define statement change.

Read the source, you'll find it is mostly self documenting. :)
Everything happens in the background, no more polling junk from your loop, which was IMHO a huge mistake anyway.

If I *HAD* time, I wouldn't be writing docs, I would be porting more drivers from the UHS2 library instead.
 
@xxxajk
From Wikipedia - - Software usable only by the author is unfortunate if it is publicized.

Documentation and agile development controversy

"The resistance to documentation among developers is well known and needs no emphasis."[9] This situation is particularly ambivalent in agile software development because these methodologies try to avoid any unnecessary activities that do not directly bring value. Specifically, the Agile Manifesto advocates valuing "working software over comprehensive [or no (ed.)] documentation", which could be interpreted cynically as "We want to spend all our time coding. Remember, real programmers don't write documentation."[10]

A survey among software engineering experts revealed, however, that documentation is by no means considered unnecessary in agile development. Yet it is acknowledged that there are motivational problems in development, and that documentation methods tailored to agile development (e.g. through Reputation systems and Gamification) may be needed.[11][12]
 
Last edited:
Hi xxajk

As you see: You are alone here with your opinion.

It's me, it's stevech and Major Tom against your opinion that documentation is unneccessary.


> If I *HAD* time, I wouldn't be writing docs, I would be porting more drivers from the UHS2 library instead.

To whom will it be usefull to have more drivers but still not knowing how to use your library ?

It is the contrary:
With a good documentation everybody could add his own drivers.
Even if you implement more drivers, there will still be millions of USB devices that will be missing.
How high is the probability that the driver that I need has been integrated by you ?
Not very high.
It is more probable that MY device is missing and I have to implement it on my own.
A good documentation would help me implementing my own driver.


> Lastly, there really isn't much to understand, and there are demos for the Kinetis USB host mode.

For you everything is clear.
But as you see in this thead not all people share your opinion.


And your samples do not help much.
There is not even one comment in them describing what the sample does.
 
Last edited:

Com'on.
Are you really saying, that Andrew has not the right to make SW available for everyone to work with, even if not finished?
Nobody is forced to use it.
Should Andrew withdraw the SW, because his ideas on what is important to him does not coincide with "the community"?

It seems that so many are desperate to have usb-host software developed for teensy, but few are willing to contribute to the development, there seem to be only demanding 'users'.
 
Com'on.
Are you really saying, that Andrew has not the right to make SW available for everyone to work with, even if not finished?
Nobody is forced to use it.
Should Andrew withdraw the SW, because his ideas on what is important to him does not coincide with "the community"?

It seems that so many are desperate to have usb-host software developed for teensy, but few are willing to contribute to the development, there seem to be only demanding 'users'.
Yep, people think I'm some kid at home, with nothing better to do.
Thank you for understanding, and you are correct, people don't want to do the leg work or be bothered to learn.

@Elmue @stevech
The actual API is still in flux... things may change in a way that breaks something written today.
I released it early mainly for people who are experienced enough to give feedback. This way you get an API that you want.
There are some people and companies already using it, and have helped to find bugs.

The main reason for no docs is total lack of time.
My work is very demanding, sometimes I go 36 hours straight.
I actually wish I had more time to add more code and documentation, it isn't that I do not want to.
If that bothers you, I'm really sorry. There are only so many hours in a day.

If you are experienced enough, you could help out and contribute.
It isn't going to be easy to understand the internals even with documentation to anyone who is inexperienced, mainly because of the fact everything runs in an ISR context..
If you have experience with coding with multiple threads, and OS kernels, you would totally get it. Most people do not.

Demos are another story... They are short because the whole API has been abstracted and simplified for you.
Most of the demos are there to simply be used as tests to verify code works.

It is actually much easier to use than you think because 99.9% of the actual work is abstracted away, runs in the background, and once started requires no additional code to monitor the state of a device. Don't worry though, more is on the way.
 
Yep, people think I'm some kid at home, with nothing better to do.
Thank you for understanding, and you are correct, people don't want to do the leg work or be bothered to learn.

You picked the Avatar! :) Of course I'm not really an Eagle either - they just hang out at my house.

I haven't looked at your code yet for lack of need - I think it is cool that you are interested in doing it and making it work and sharing it though. I find my samples make sense to me - at least when I write them - positive feedback helps me see interest to continue - then I have to move on. Comments or documentation are cool - but take time and can quickly disagree with the code as it evolves. I'm sure if somebody got halfway into it and got stuck questions would be answered and provide good info - seems like a documented sample would be a good thing for somebody trying to learn and use the code to contribute.
 
You picked the Avatar! :) Of course I'm not really an Eagle either - they just hang out at my house.
:cool:
I haven't looked at your code yet for lack of need - I think it is cool that you are interested in doing it and making it work and sharing it though. I find my samples make sense to me - at least when I write them - positive feedback helps me see interest to continue - then I have to move on. Comments or documentation are cool - but take time and can quickly disagree with the code as it evolves. I'm sure if somebody got halfway into it and got stuck questions would be answered and provide good info - seems like a documented sample would be a good thing for somebody trying to learn and use the code to contribute.
That is partly the idea. Looking for contributions.
Go ahead, look, and play.

As to why I did it:
1: The older code sucked. Having to poll is going to cause latency problems, etc
2: The older code is full of pitfalls and spec bugs. Not to say mine is perfect, but it is closer.
3: The older code isn't USB host agnostic.
4: The older code can't support > 1 interface without major bloat.
 
Just wanted to lend a word of encouragement. USB host capability is the one of the most frequently requested features. I'm looking forward to trying it, but no promises as to when.

Some projects I'd love to make or see:
  • A 'toy' computer with USB mouse and keyboard
  • In-line USB packet logging, injection and filtering (like Bus Pirate, et.al.)
  • USB network bridging, e.g. USB to HopeRF to USB
  • Wifi or Bluetooth dongle support, e.g. TL-WN723N for Wifi support, etc.

I'm sure there are many more. ;)
 
Last edited:
Hello!

I wanted to chime in here, it seems its been a while since this topic has been brought up.

I for one, would love to see USB MIDI host capabilities - in order to connect a USB MIDI keyboard lets say, to the Teensy and be able to use the usbMIDI object to interface with it.

Is this much different than HID interactions? I wouldn't think so, but I don't really know. The USB stuff kind of mystifies me.

If someone were to point me to the correct place where something like that might be coded, I might be able to futz around, but I really have no clue!

EDIT: after posting this, i realize that it is probably all in the cores/usb_hid and cores/usb_midi folders.


Thank you xxxajk for your work, this seems to be pretty awesome!

T
 
Last edited:
Yes, I can do that, if you are willing to test it. Please note that currently only the low/full speed connector is supported. The upcoming board support for high-speed is in progress.

Please note that some devices do not follow the specification properly.
Most notable offender I have is an Arturia keyboard. It will drop keypresses during a mashup, and confuse the code. Breifly: it is supposed to buffer these, and it does not!

The AKAI and Yamaha keyboards I have _DO_ follow the spec.

Your success/failures will depend upon the device properly following the specification.

Keep watching the repository. I should be able to have something in about 2 weeks, after the dust settles here with work and whatnot.
 
Ah yes! I can test it!

I only have the Keith McMillen QuNexus keyboard, but I am most interested in USB sync with Elektron gear (drum machines etc..).

I can and will hunt down other MIDI gear to test as well. This is great news!
With USB MIDI host mode, is there any chance that it would also work as a slave device without uploading new code? My scenario is that I would like my device to receive MIDI input from keyboards to control, but also to be able to MIDI sync to a computer. I am thinking if this can't happen simultaneously a hardware jumper might be a good way to select which functionality it needs...

Edit: of course after I post things, I realize I have research to do, and it seems that USB OTG is what allows a device to behave as a device or a host. Would this be the case for a MIDI host mode?

Thank you!
 
Last edited:
Yes, this is possible, but that would be a separate entity, and not Host mode (which is what the 'H' in UHS means).
If you mean dynamically doing OTG, that is complicated, but possible.
Right now the code is firmly focused on host mode.
Meanwhile it may be better to forward MIDI between two teensy 3's over serial. Doing this is pretty simple, for me at least.
 
I have a product I would like to use this in. For hobbyist stuff I would agree with you, but I don't have the space for an additional teensy in this device :D

Having to re-code the device would be fine by me. I look forward to testing your code!

Thank you!
 
If I could get it to work, of course I would, but I am not quite sure where to start on that one. If you gave me a bit of guidance on where to start poking, or what papers to read I might be able to get a handle on it.
 
As long as you have in your design implemented the ID pin...
...all you need to do (in a nutshell, there are some finer details....)
....is flip between host and device based on the state of that I/O line.
You also need to have a USB switch that changes the power on the VBUS line in hardware.
it isn't that hard to implement. Just a lot of details.
 
Status
Not open for further replies.
Back
Top