How to get data from USB?

8 views
Skip to first unread message

Kiril

unread,
Sep 28, 2017, 10:34:51 AM9/28/17
to SerialPundit
Good day!

My device is connected to USB-port and all the time sends to PC a byte-code.
How can I receive this data in my java using Pundit library?
What Class and method response for receiving such information?

I tried to find this functionality but I couldn't.

Thank you, Rishi!.

Andreas Kuhtz

unread,
Sep 28, 2017, 3:20:52 PM9/28/17
to Kiril, SerialPundit
Hi Kiril,

Does your device open a COM-port on your PC or is it "just" a USB device?
You can check this in the device manager if you're using windows.

If it does not create a COM-port then I guess you have to use something like libusb to directly access the USB-port.

Cheers,
Andreas

--
You received this message because you are subscribed to the Google Groups "SerialPundit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/SerialPundit/efaaba79-1298-482a-9726-279d95653412%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kiril

unread,
Sep 28, 2017, 7:34:12 PM9/28/17
to SerialPundit
Thanks Andreas for your reply.

I have both cases.
When you wrote about libusb did you mean this library? http://libusb.info/
Please can you suggest how integrat C library into java-project?

Thank you!

четверг, 28 сентября 2017 г., 22:20:52 UTC+3 пользователь Andreas Kuhtz написал:
Hi Kiril,

Does your device open a COM-port on your PC or is it "just" a USB device?
You can check this in the device manager if you're using windows.

If it does not create a COM-port then I guess you have to use something like libusb to directly access the USB-port.

Cheers,
Andreas
2017-09-28 16:34 GMT+02:00 Kiril <kharkov...@gmail.com>:
Good day!

My device is connected to USB-port and all the time sends to PC a byte-code.
How can I receive this data in my java using Pundit library?
What Class and method response for receiving such information?

I tried to find this functionality but I couldn't.

Thank you, Rishi!.

--
You received this message because you are subscribed to the Google Groups "SerialPundit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit...@googlegroups.com.

Kiril

unread,
Sep 28, 2017, 7:40:27 PM9/28/17
to SerialPundit
and by the way... should I use SerialComManager and SerialComHID in COM-port case?
What difference between SerialComUSBdevice and SerialComUSBHIDdevice?


четверг, 28 сентября 2017 г., 22:20:52 UTC+3 пользователь Andreas Kuhtz написал:
Hi Kiril,

Does your device open a COM-port on your PC or is it "just" a USB device?
You can check this in the device manager if you're using windows.

If it does not create a COM-port then I guess you have to use something like libusb to directly access the USB-port.

Cheers,
Andreas

2017-09-28 16:34 GMT+02:00 Kiril <kharkov...@gmail.com>:
Good day!

My device is connected to USB-port and all the time sends to PC a byte-code.
How can I receive this data in my java using Pundit library?
What Class and method response for receiving such information?

I tried to find this functionality but I couldn't.

Thank you, Rishi!.

--
You received this message because you are subscribed to the Google Groups "SerialPundit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit...@googlegroups.com.

Rishi Gupta

unread,
Sep 29, 2017, 12:10:06 AM9/29/17
to SerialPundit
- There are various options/softwares. Please provide details about your hardware and application use-case.
-  SerialComUSBdevice represents a usb device and SerialComUSBHIDdevice represents a usb-hid device like CP2110

Kiril

unread,
Sep 29, 2017, 5:34:25 PM9/29/17
to SerialPundit
I'm working with accelerometer and it sends to USB-port byte-code packages according to it's registers.
Which library can receive this data? Maybe you can write somekind of code example?

Thank you, Rishi!

пятница, 29 сентября 2017 г., 7:10:06 UTC+3 пользователь Rishi Gupta написал:

Rishi Gupta

unread,
Sep 29, 2017, 11:05:57 PM9/29/17
to SerialPundit
Hi Kiril,
An accelerometer typically sends data using either i2c or uart protocol. Please provide link to accelerometer datasheet so that i can understand give example to use it.

Kiril

unread,
Sep 30, 2017, 8:44:54 AM9/30/17
to SerialPundit
I work with MPU9250 accelerometer. 
Here is pdf-documentation. 
https://cdn.sparkfun.com/assets/learn_tutorials/5/5/0/MPU9250REV1.0.pdf

Also in near future I will have to process the GPS-data from GPS-receiver by UBX protocal. Most likely I will use U-Blox 8 receiver model.
Here is it's documentation.

суббота, 30 сентября 2017 г., 6:05:57 UTC+3 пользователь Rishi Gupta написал:

Rishi Gupta

unread,
Sep 30, 2017, 11:20:16 PM9/30/17
to SerialPundit
This accelermoter does not have USB. Are you using usb-uart converter like FT232 or CP2102.
Please share your connection block diagram computer <---> device

Kiril

unread,
Oct 2, 2017, 5:04:02 AM10/2/17
to SerialPundit
Sorry for long response. 

I use Teensy 3.6. with MK66FN2M0VMD18 microcontroller. In practice windows sees it like usb device and creats it's own COM-port for data exchange, so windows use somekind of it's own-converter. 

Here is Teensy 3.5 & 3.6 Schematic:

and pins docs:


воскресенье, 1 октября 2017 г., 6:20:16 UTC+3 пользователь Rishi Gupta написал:

Rishi Gupta

unread,
Oct 3, 2017, 11:55:41 AM10/3/17
to SerialPundit
Thanks for info. Is teraterm working https://ttssh2.osdn.jp/index.html.en with teensy in your computer.

Kiril

unread,
Oct 5, 2017, 6:23:25 PM10/5/17
to SerialPundit
ok, and how can I use this util for my Java code?
Did I understand correctly that I can't use SerialPundit library for data exchange between my device and PC?



вторник, 3 октября 2017 г., 18:55:41 UTC+3 пользователь Rishi Gupta написал:

Rishi Gupta

unread,
Oct 6, 2017, 2:10:34 AM10/6/17
to SerialPundit
- serialpundit library can be used for your application
- using teraterm is to make sure that drivers for your board are installed and you become familiar with usb-uart ports
then connect teensy board and run the above test.
You will get COM Port and then use other APIs of serialpundit.

Kiril

unread,
Oct 8, 2017, 8:48:27 AM10/8/17
to SerialPundit
Thank you!

I will try it.

пятница, 6 октября 2017 г., 9:10:34 UTC+3 пользователь Rishi Gupta написал:
Reply all
Reply to author
Forward
0 new messages