GsmMuxd - GSM07.10 software multiplexer for GSM modems

In may 2020, for my usage on Linux I've modified the latest (february 2019) u-blox version of the "gsm0710muxd" daemon.

(covered by the GNU General Public License)

The gsmmux daemon allows with only "one" physical serial port to have "many" virtual ports (created with pseudo-tty's).

Classic usage: ppp on one channel (for IP connection), and free AT commands use (for SMS, get signal level, infos) in parallel on another channel for example... very interesting !

Here the option arguments list available in my modified version :

./gsm0710muxd -h

        ./gsm0710muxd u-blox Version: [$Ver: 01.08 - MLD/8 $] Revision: [$Rev: 1 $]

        Usage: ./gsm0710muxd [options]

Options list:

        -c: <1 or 0>: Send AT+CPWROFF during MUX close. 0 (Disabled) - 1 (Enabled) [no]

        -F: <1 or 0>: Hardware Flow Control Setting. 0 (Disabled) - 1 (Enabled) [no]

        -d: Fork, get a daemon [no]

        -v: <0 to 7>: Set verbose logging level. 0 (Silent) - 7 (Debug) [6]

        -s <serial port name>: Serial port device to connect to [/dev/ttyUSB0]

        -t <timeout>: Reset modem after this number of seconds of silence [0]

        -P <pin-code>: PIN code to unlock SIM [-1]

        -p <number>: Use ping and reset modem after this number of unanswered pings [0]

        -e <baudrate>: default baudrate used [115200]

        -b <baudrate>: config baudrate with AT+IPR [115200]

        -m <modem>: Mode (basic, advanced) [basic]

        -f <framesize>: Frame size [1509]

        -n <number of ports>: Number of virtual ports to create, must be in range 1-31 [2]

        -l <symlink prefix to use for each virtual port created>: [none]

        -D <portnumber=devicename>: Device name to use for a virtual port number 1-31 (default for pts)

        -o <select>: 1 for output log to file, 2 for syslog [none]

        -h: Show this help message with default settings.

The daemon uses by default "/dev/ptmx" master device to open many tty virtual channels (on slave '/dev/pts/X').

See log of the daemon with for example :

gsm0710muxd[313]: 914:open_pty_interface(): Connecting '/dev/pts/0' to virtual channel 1 for watchdog_init on /dev/ttyS1

gsm0710muxd[313]: 914:open_pty_interface(): Connecting '/dev/pts/1' to virtual channel 2 for watchdog_init on /dev/ttyS1

After mux running, use "/dev/pts/X" for each channel X to use (2 channels created per default).

If you set the symlink prefix parameter for example to "/tmp/gsmmuxch", a symbolic link will be created, see log :

gsm0710muxd[685]: 895:open_pty_interface(): Created channel symbolic link '/tmp/gsmmuxch1' -> '/dev/pts/0'.

gsm0710muxd[685]: 946:open_pty_interface(): Connecting '/dev/pts/0' to virtual channel 1 for watchdog_init on /dev/ttyS1

Use then "/tmp/gsmmuxchX" instead for each channel X...

Tested successfully on Linux with the GenPro300e (in serial) from ercogener (based on a u-blox LISA-U200),

and the GenPro400e (also in serial, based on a u-blox TOBY-L210)

https://www.ercogener.com/produits/produits/526-genpro-300e.html

https://www.ercogener.com/produits/produits/579-genpro-400e.html

Something else about pppd daemon for people interested:

if you want a ppp authentification with CHAP instead of PAP, do not create file "/etc/ppp/pap-secrets", but only file "/etc/ppp/chap-secrets". Seems obvious, after thinking about it ! Also some modifications on AT commands initialization can be required before connection for the modem (with u-blox, see available prefix "CHAP:" in APN name, command "AT+UAUTHREQ=", ...)