Spacebar not recognising(?) usb modems

Hey, I am running into a problem when using spacebar: the program does not display any text messages that are coming to the sim card.

I admit, my setup is a bit unique, ut I see no reason why it should not work. I am using plasma mobile on my PC (alongside with plasma wayland). My usb gsm modem interfaces on ttyUSB0, and I can get sms messages using wvdialconf and gammu (after using gammu-config).

In contrast spacebar does not display any sms messages, and I can’t figure out a way if spacebar is even detecting the serial device of the modem. It would be nice to have some feedback in the settings page about being connected to the cellular network or something like that. I guess the spacebar backend does not try to configure serial modem devices maybe?

I am using Fedora, Plasma 5.27.11, Spacebar 23.01

Hi! Spacebar is talking to modem via ModemManager.
Are you able to get info about your device via mmcli? :thinking:

No, in fact mmcli reports: “No modems were found”
I can still use the modem fine with the method mentioned earlier… I guess it is a problem with mmcli rather than spacebar - although spcebar could still add more backends?
I imagine the new plasma 6 modems tab in system settings also uses the same backend. That does not work either.

Is that possible some other service is locking the device or something? :thinking: Not sure, maybe gammu-smsd or similar daemon? (Never used it)

Maybe some utils could highlight processes with serial port usage? (from superuser):

fuser /dev/ttyUSB0


lsof /dev/ttyUSB0

I don’t think that is the case - I have to manually run wvdialconf and gammu every time, it does not start automatically. Before running these the device should not be locked.
When I run
fuser /dev/ttyUSB0
the result is empty, the return value is 1. lsof gives a warning:

lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
      Output information may be incomplete.

If I run wvdialconf nothing changes in the fuser and lsof output. If I run mmcli now it still cannot detect the modem. If I run gammu getallsms it can download all text messages. Afterwards running fuser and lsof again, result are the same.

At this point I’d say mmcli simply does not support my modem for some reason. I think the modem is simply a serial device and uses some ancient AT protocol to communicate, so mmcli not supporting everything is a bit strange, who knows?

When wvdialconf initiates the modem (has to be run after every usb plug-in) the following is displayed:

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S1   S2   S3   S4   S5   S6   S7   S8   
Modem Port Scan<*1>: S9   S10  S11  S12  S13  S14  S15  S16  
Modem Port Scan<*1>: S17  S18  S19  S20  S21  S22  S23  S24  
Modem Port Scan<*1>: S25  S26  S27  S28  S29  S30  S31  
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- ATQ0 V1 E1 S0=0 &C1 &D2
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 +FCLASS=0 -- ATQ0 V1 E1 S0=0 &C1 +FCLASS=0
ttyUSB0<*1>: Modem Identifier: ATI -- SIM800 R14.18
ttyUSB0<*1>: Speed 4800: AT -- ��
ttyUSB0<*1>: Speed 4800: AT -- OK
ttyUSB0<*1>: Speed 9600: AT -- �
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Speed 19200: AT -- Speed 19200: AT -- OK
ttyUSB0<*1>: Speed 38400: AT -- �
ttyUSB0<*1>: Speed 38400: AT -- OK
ttyUSB0<*1>: Speed 57600: AT -- Speed 57600: AT -- OK
ttyUSB0<*1>: Speed 115200: AT -- Speed 115200: AT -- OK
ttyUSB0<*1>: Speed 230400: AT -- Speed 230400: AT -- Speed 230400: AT -- Max speed is 115200; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0<Info>: Speed 115200; init "ATQ0 V1 E1 S0=0 &C1"

the content of /etc/wvdial.conf (verbatim, it really does not have any passwords filled) is:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1
Modem Type = Analog Modem
; Phone = <Target Phone Number>
ISDN = 0
; Password = <Your Password>
; Username = <Your Login Name>
Modem = /dev/ttyUSB0
Baud = 115200

While it would be nice to use spacebar to send and receive text messages, I think this is an mmcli problem, so maybe we should not spend any more time on this. But thanks for all the help!

No problem! :slight_smile:

So, the device is SIM800 module. I’ve googled “sim800 modem manager” and there’re some related discussions like this:

Did you tried scan-modems command? :thinking:

mmcli --scan-modems
mmcli --monitor-modems

If this helps, it probably could be automated with udev rules (to whitelist appropriate serial port, ID_MM_PLATFORM_DRIVER_PROBE or ID_MM_DEVICE_PROCESS are probably related keywords to search: Modem filter: ModemManager Reference Manual).

Indeed, it’s a SIM800 with usb serial interface.
mmcli --scan-modems result:
Successfully requested to scan devices
mmcli --monitor-modems does not finish, it justs keeps running forever - I guess this might be the intended behaviour though?
mmcli --list-modems result:
No modems were found

sudo dmesg:

usb 1-8: new full-speed USB device number 11 using xhci_hcd
usb 1-8: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.63
usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-8: Product: USB2.0-Serial
usbcore: registered new interface driver ch341
usbserial: USB Serial support registered for ch341-uart
ch341 1-8:1.0: ch341-uart converter detected
usb 1-8: ch341-uart converter now attached to ttyUSB0

I guess changing udev rules could perhaps help, but to be honest I already have a convoluted and working solution. It would have been nice to use graphical ui with plug-and-play results, but when I have to read up about udev rules that’s not gonna happen. I imagine mmcli supports most modems, that’s why spacebar uses the library, maybe someone who cares enough can add upstream support for usb-tty-sim devices (or whatever it is that is not supported now).

I consider this project finished.
Thanks for the help.