Home > Arduino, Bluetooth, TKJ Electronics, USB > Documentation added for the USB Host Library

Documentation added for the USB Host Library

February 20th, 2013 Leave a comment Go to comments

I’m happy to announce that documentation is now available for all the libraries I have written for the USB Host Shield library.
The documentation is available at the following link: http://felis.github.com/USB_Host_Shield_2.0.
The documentation is generated using Doxygen which is a free documentation-generator based upon the header files in the source code.

For instance the following comment will end up looking like this in the documentation:

I hope this will be useful for people who is new to the USB host library or even people who just want a quick overview.
If you spot any typos or got any comments please let me know in the comments below.

Categories: Arduino, Bluetooth, TKJ Electronics, USB Tags:
  1. Kareem
    February 23rd, 2013 at 23:06 | #1

    Awesome Lauszus,
    Thank you very much

  2. March 8th, 2013 at 08:39 | #2

    Thank you for this.
    It would be great if the same could be made for the PTP lib.
    I’m struggling with being able to compile the examples for this library and cannot find an accurate guide and help…

  3. March 8th, 2013 at 11:45 | #3

    @Adi Soffer
    I haven’t wrote that library, so I’m afraid that I’m not able to do that.
    What version of the QP library are you using? Actually I have never used that library.

  4. March 8th, 2013 at 20:39 | #4

    @Lauszus
    Hey – thanks for taking the time here –
    after reading extensively about it I’m using 4.3

  5. March 8th, 2013 at 21:14 | #5

    @Adi Soffer
    Here is a zip file with the code: PTP_20.zip. I have made the necessary changes, in order for the library to compile.
    Also make sure that the USB Host library directory is called: “USB_Host_Shield_20”

  6. March 8th, 2013 at 21:47 | #6

    I really appreciate this.
    Since I’ve gone through all sorts of library editing after reading comments and tips,
    I’ll let you know the changes I’ve made:
    1. Replaced qp_ccp (as was recommended by Oleg)
    2. Commented out these lines in the qp_port.cpp: (as was recommended by Alex)
    // void operator delete(void *) {
    // Q_ERROR(); // this operator should never be actually called
    // }
    3. Added the following line to eoseventhandler.h file found in EOSCamController folder:
    virtual void OnObjectCreated(const EOSEvent *evt) {};
    (as was recommended by Alex)

    All this led to being able to compile all – but the EOSRemote sketch – that compiled with the following error:
    EOSRemote.cpp: In member function â??virtual void CamStateHandlers::OnDeviceInitializedState(PTP*)â??:
    EOSRemote.pde:-1: error: cannot declare variable â??hndâ?? to be of abstract type â??EosEventHandlersâ??
    /eoseventhandlers.h:12: note: because the following virtual functions are pure within â??EosEventHandlersâ??:
    C:Program Files (x86)arduino-1.0.1librariesptp/eoseventparser.h:37: note: virtual void EOSEventHandlers::OnObjectCreated(const EOSEvent*)

    Now, after dl your zip and renaming as instructed, EOSCamController is no longer able to compile. I’m pasting jsut the first few lines of the error log so as not to clog everything up here:
    qpqp.cpp.o: In function `QEP::getVersion()’:
    C:Program Files (x86)arduino-1.0.3librariesqp/qp.cpp:95: multiple definition of `QEP::getVersion()’
    PTP_20qp.cpp.o:C:Program Files (x86)arduino-1.0.3librariesPTP_20/qp.cpp:95: first defined here

    Once again, thanks a lot

  7. March 8th, 2013 at 21:50 | #7

    @soffer
    Simply delete both the PTP and QP libraries downloaded and download the zip file I provided! I have made the necessary changes to make it work.

  8. March 8th, 2013 at 22:11 | #8

    Oh man – It is finally compiling!
    Thank you so much!
    This is great, and I’m truly thankful.

    I can finally begin testing this with my 5D mkII

    🙂

  9. March 8th, 2013 at 22:20 | #9

    @soffer
    You are welcome 🙂

  10. Jose Wilson
    March 13th, 2013 at 19:03 | #10

    Mil gracias por informacion tan valiosa. Será de gran ayuda para realizar proyectos con arduino.

  11. March 13th, 2013 at 19:18 | #11

    @Jose Wilson
    You are welcome 🙂

  12. Moofleta
    July 15th, 2013 at 03:11 | #12

    downloading the current USB_Host_Shield_20 then your PTP_20 above, can not compile any of the files due to PrintHex:

    (example from EOSRemote)

    C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp: In member function ‘virtual void EOSEventDump::Parse(uint16_t, const uint8_t*, const uint32_t&)’:
    C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:38: error: no matching function for call to ‘PrintHex(unsigned char&)’
    C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:67: error: no matching function for call to ‘PrintHex(unsigned char&)’
    C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:81: error: no matching function for call to ‘PrintHex(unsigned char&)’
    C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:99: error: no matching function for call to ‘PrintHex(unsigned char&)’

    @Lauszus – any chance that the PrintHex is either not being loaded or changed? I could not find (maybe I missed) where its including printhex.h also I saw that many of the other examples were modified to use: D_PrintHex recently.
    Could you please assist?

  13. July 15th, 2013 at 18:54 | #13

    @Moofleta
    That’s because the libraries has been changes since.
    I believe Oleg has already made the changes to the PTP library: https://github.com/felis/PTP_2.0/commits/master.

    Please see the following comment I wrote: http://www.circuitsathome.com/camera-control/ptp-2-0-library-function-turns-on-bulb-mode-on-nikon-dslr-camera-via-usb/comment-page-1#comment-18312.
    It shows all the steps you need to do in order for it to compile 🙂

  14. Moofleta
    July 21st, 2013 at 20:32 | #14

    Thank you for the tips, any idea if Canon 5D Mark 3 is supported?

  15. July 23rd, 2013 at 01:59 | #15

    @Moofleta
    Yes it is supported 😉

  16. Harpix
    August 3rd, 2014 at 23:10 | #16

    Lauszus
    I’m not able to compile your ptp_20 library.
    Using IDE 1.05 here on osx.
    Can you recap the correct procedure and files to be downloaded?

    Thak you

  17. August 5th, 2014 at 14:12 | #17
  18. Harpix
    August 6th, 2014 at 11:15 | #18

    Thank you Lauszus.
    I’ve tried several times with your file but no way…I will try again with your instructions but the main issue are the qp libraries ver 4.3.0 for arduino, not available for download.
    I will try to ask also for Oleg’s help.

    Best Regards

  19. August 7th, 2014 at 10:43 | #19

    @Harpix
    You should properly ask for the old version at the product page: http://www.state-machine.com/arduino/.

  20. Prieni
    June 22nd, 2016 at 13:03 | #20

    I can see that you invest a lot of time and work into this whole thing. Alas, it’s not a documentation. I’m not able to find out what the examples are supposed to do. I don’t see a general overview of how it all works. I don’t see any explanation for the functions. Yes, it’s down to my stupidity, but there is no place where I can find the basics about it.

    This is all very frustrating when things seem not to run through as they should and you have no handle at all to find out what actually may go wrong.

  21. June 24th, 2016 at 09:00 | #21

    @Prieni
    I do realise that the examples are not that well documented, but if you upload the code and plug in your controller/dongle then I am sure that you would be able to figure out what is going on based on the output shown in the serial monitor 🙂

    It will also be a good idea to enable serial debugging: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging.

  22. DAVID Vincent
    October 1st, 2019 at 15:39 | #22

    Hi,
    I’m trying to use the USB Host shield stack with a thrustmaster joystick and I think it is not detected correclty.
    When I activate the debugging I’ve
    Start
    HU Init
    Addr:01
    NC:01
    Cnf:01
    HU configured

    When the data written in the serial plotter are false.
    All the data are uint_8 but the joystick have 16 bits value.
    How can I modify to make a correct parser ?
    Thanks for this huge works.

  1. February 21st, 2013 at 06:38 | #1
  2. April 14th, 2013 at 01:40 | #2