Uncategorized

MiFi modem notes

Asked 
Viewed 43 times
1

I have purchased this 4G HAT and I’m using it with this module in a raspberry 4. I use the USB connection.

I installed a ppp connection and everything is working correctly. My problem is: how do I send AT commands? I want to test several things, such as send sms or put the module in sleep mode.

I tried solutions like the ones shown here. However I don’t know which device I should choose (in the example ttyACM0) and I tried a few but it gives the error:

serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyUSB3: [Errno 16] Device or resource busy: '/dev/ttyUSB3'

EDIT. The output for lusb:

pi@raspberrypi:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem
Bus 001 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 003: ID 2a7a:9a18  
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and dmesg (the section of correspondent to the GSM card)

[    3.212448] usbcore: registered new interface driver usbserial_generic
[    3.212527] usbserial: USB Serial support registered for generic
[    3.234675] usbcore: registered new interface driver cdc_wdm
[    3.239163] usbcore: registered new interface driver option
[    3.239260] usbserial: USB Serial support registered for GSM modem (1-port)
[    3.239749] option 1-1.4:1.0: GSM modem (1-port) converter detected
[    3.248897] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
[    3.250162] option 1-1.4:1.1: GSM modem (1-port) converter detected
[    3.252576] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
[    3.253795] option 1-1.4:1.2: GSM modem (1-port) converter detected
[    3.255273] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB2
[    3.257057] option 1-1.4:1.3: GSM modem (1-port) converter detected
[    3.257961] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB3
[    3.299767] qmi_wwan 1-1.4:1.4: cdc-wdm0: USB WDM device
[    3.300850] qmi_wwan 1-1.4:1.4 wwan0: register 'qmi_wwan' at usb-0000:01:00.0-1.4, WWAN/QMI device, 5a:d7:9a:8e:3c:e9
[    3.309017] usbcore: registered new interface driver qmi_wwan
  • You question title is a bit to vague. You 4G module can do a lot things, but I would suggest to narrow down to text SMS (what you specified), forget voice etc, and also focus on fastest LTE, forget slow guys like GMS etc. So if you agree, I can edit the title for you, to make it more specific, to something like this: “How can Rpi4B python use USB/UART/Serial AT commands to control a 4G/LTE module to text SMS?” You comments and counter suggestions welcome. Ah, lunch time, I need to go. See you later. Cheers. – tlfong01 2 days ago
  • 1
    When you plug your 4G Hat into the Pi using USB what shows up when you type ‘lsusb’ and ‘dmesg’? It should show you which port has been assigned. – CoderMike yesterday
  • 1
    @CoderMike, added the output for the commands. Meanwhile, I found that if running with sudo, I don’t have that error. However, the script doesn’t send any message. Just hangs and do nothing. – Miguel yesterday
  • 1
    Thats weird, why do 4 usb ports get connected? – CoderMike yesterday
  • Ah, let me see. I would like to know how you connect Rpi to the SixFab module. Are you doing the ninja trick of barebone USB direct connect to barebone USB as shown in Appendix B of my penzu reading log? penzu.com/p/9fb61b9c. – tlfong01 yesterday
  • The guide you followed is 10 years old, using Fedora8 Python 3000 (Ref 1). You might try the more up to date Ref (2). (1) How can Fedora8 Python3000 use AT commands send/receive Android phone SMS? – #RSK, StkOvlw 2010Jan29 stackoverflow.com/questions/2161197/… (2) SMS Gateway project using ZTE MF920V 4G MiFi modem – #Bilel, RpiStckExchng 2020jan31 raspberrypi.stackexchange.com/questions/107923/…. (3) I have an ZTE MF920W+, so I can repeat you problem using Rpi4B python 3.7.3. – tlfong01 5 mins ago   Delete
.END

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: