zabsalahid / serialport-gsm

SerialPort-GSM is a simplified plugin for communicating with gsm modems. (Primarily for sms) (Focused in PDU mode)
MIT License
92 stars 48 forks source link

No results found on list command #122

Closed sts-ryan-holton closed 1 year ago

sts-ryan-holton commented 1 year ago

Hi, I have two different USB modems from the company T-Mobile, they're quite old and haven't been used for years, but they still function, they're both Huawei brands, I'm plugging them into my USB ports on my PC, which is a Windows 10 machine, and am running my node script, and I only ever see the following output despite my USB modems being plugged in:

[
  {
    path: 'COM1',
    manufacturer: '(Standard port types)',
    serialNumber: undefined,
    pnpId: 'ACPI\\PNP0501\\0',
    locationId: undefined,
    friendlyName: 'Communications Port (COM1)',
    vendorId: undefined,
    productId: undefined
  }
]

My code:

let serialportgsm = require('serialport-gsm')

serialportgsm.list((err, result) => {
    console.log(result)
})

Not quite sure how to proceed in getting mu USB modem to show up?

Apollon77 commented 1 year ago

You use it wrong ... The library is using "result,err" as callback parameter order ... Yet it is completely uncommon, but was decided to not break the library when we were adding the error parameter.

Try it.

sts-ryan-holton commented 1 year ago

Switched to:

serialportgsm.list((err, result) => {
    console.log(err)
    console.log(result)
})

err gives me null.

Apollon77 commented 1 year ago

Ok, then me again ... uups ... seems that the list method really have the same order you had initially ... sorry if I confused, so all good with your call ... The library is passing zthrough the response of the serialport library ...

Can you check please the hardware manager or such that the stricks are detected?

There are also some sticks that are detected as a "File drive/SD Card" when plugging in into a PC ... you maybe need to do something to switch them to NOT report themself as a file drive. Because when they are a file drive then they are not detected as serial ports!

DO you know the exact name of the sticks?

sts-ryan-holton commented 1 year ago

Thanks, yeah, they're detected as a DVD/CD Drive on my machine.

These are the makes:

Apollon77 commented 1 year ago

Please try like https://sysadmintips.com/hardware/disable-cd-rom-and-sd-storage-in-huawei-e173-usb-modem/

sts-ryan-holton commented 1 year ago

That's a useful guide, my problem now is trying to connect to the USB stick. It doesn't show up under the Ports section in the device manager, but rather under Disk drives, so not sure.

Apollon77 commented 1 year ago

does that help? http://3g4gmodem.blogspot.com/2012/02/disable-huawei-cd-rom-and-sd-card-for.html ... try googe :-)) "HUAWEI E1750 disable cdrom"

sts-ryan-holton commented 1 year ago

Yes I've seen that article, my problem is my USB dongle doesn't show up under "Ports", see screenshot. Maybe this means I can't connect to it and thus can't disable CD?

Capture

sts-ryan-holton commented 1 year ago

Looks like I was able to achieve the desired result by plugging these into a Raspberry Pi 4 instead of Windows, and then installing minicom and running:

minicom -D /dev/ttyUSB0