Maker Pro
Maker Pro

How to talk to a usb device

r4dn0t

Nov 20, 2016
3
Joined
Nov 20, 2016
Messages
3
Dear Fellows,

I'm a computer programmer with no background about electronics. I have a scenario and I want you to help me to achieve my project objectives.

I have a portable 4g modem with WiFi internet sharing and I want to use this modem as a sms sending device for one of my applications. this modem has a usb cable for charging.

Now, there is some questions which I could not find any answer for them:

1. How can I connect to a USB device with a USB cable?
2. How can I find out the commands that the device will respond to?
3. Is it ever possible to debug a device and for example change it's operating system?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
1. How can I connect to a USB device with a USB cable?
Perhaps you need to explain better what you mean here... I would simply tell you to connect the USB cable to the device, then connect the other end of the cable to a computer. That being said... it's not uncommon for a 'USB device' to have the USB connector only for power. If this is the case, data will *not* flow, and communicating over this port will not be possible.
2. How can I find out the commands that the device will respond to?
Documentation... it is *possible* to find this out yourself, but I'm confident in that you lack the skills required. I do as well.
With enough time and effort, you could in theory use USB debugging techniques and custom made drivers to figure it out... worst case would require that you disassemble the device and try to dump the firmware to understand all of the commands. Very time consuming, and difficult.

3. Is it ever possible to debug a device and for example change it's operating system?
Yes, but you can't just download windows or linux and put it on the device... The skills required would be quite high unless you are lucky enough to find a project online that has alternative software/OS for the device in question.


So... I think you are over your head here.
The effort required would also tend to scare off anyone with the skills to help. It's very involved.
 

r4dn0t

Nov 20, 2016
3
Joined
Nov 20, 2016
Messages
3
Dear Gryd3,

but I'm confident in that you lack the skills required

This is exactly what I'm looking for. Where should I start to gain such a skills?

With enough time and effort, you could in theory use USB
debugging techniques and custom made drivers to figure it out... worst case would require that you disassemble the device and try to dump the firmware to understand all of the commands

Or this knowledge?

Would you please show me a starting point in this area?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Simplest way to find out if the device actually communicates over the USB charging port is to plug it into a PC. If it is communicating via USB protocol the PC will indicate that a new device was attached. If it is just there for power, which I think is the most likely case, the PC will not notice it.

Bob
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Dear Gryd3,
This is exactly what I'm looking for. Where should I start to gain such a skills?
Difficult to suggest something when I am unsure what your current skill-set is.
This may not be very beginner friendly, but will be able to provide you with many of the specifics to USB signalling and standards.
http://www.usb.org/developers/docs/
http://www.usb.org/developers/docs/devclass_docs/
It's going to be involved. This is not a simple project to start with.

Perhaps also reading : https://learn.adafruit.com/trinket-usb-keyboard/overview
might help... It's not going to give as many specifics but will give you a peak at the code required to make a USB Human Interface Device. This is only one side of the puzzle though. If the USB Device is *not* generic type that your computer recognises, then your computer will require a specific device driver to be able to operate it.
If you are lucky, the modem will be recognised as a known device. Otherwise it will be detected as an unknown device with a unique ID. You can always share/google this ID to find pre-made drivers for it though.

Simplest way to find out if the device actually communicates over the USB charging port is to plug it into a PC. If it is communicating via USB protocol the PC will indicate that a new device was attached. If it is just there for power, which I think is the most likely case, the PC will not notice it.
Bob
(thanks Bob)

Give this a try first r4dn0t... No point chasing information and documents if the device isn't detected as a USB device to begin with.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Besides the good information you've already received (especially Bob's) you might do better by posting a link to the device in question. Armed with that information our membership can reply with more accurate replies or suggestions more specific to your device.

On the programming end I'm sure you're aware that some manufacturers do make SDK's available either openly on the net or by request.

Chris
 

r4dn0t

Nov 20, 2016
3
Joined
Nov 20, 2016
Messages
3
Sorry for delay in replying.

Give us a starting point by telling us which modem you use (brand, model)

I have bought D-Link DWR-932_D1 in Iran but when I checked that model in D-Link website, I figured out that the thing that i've bought is not what I thought. at least their shape and figure (DWR-932 in D-Link web site with what I've been bought) is not identical.

Simplest way to find out if the device actually communicates over the USB charging port is to plug it into a PC

I will try it today. thanx for your advice.

Difficult to suggest something when I am unsure what your current skill-set is
I have no knowledge about electronics. Once upon a time I've tried to study myself about electronics. but I lost the way.

Perhaps also reading :


I had in mind to start with Arduino but I had also questions. Whats are the prerequisites of starting with Arduino?

 
Last edited by a moderator:

Rayregula

Dec 20, 2016
84
Joined
Dec 20, 2016
Messages
84
Whats are the prerequisites of starting with Arduino?
You don't need any prerequisites to use one they are very beginner friendly and the tutorials are "endless" but the more you know the better. :)
 
Top