LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-14-2025, 11:27 AM   #1
nabelekt-vl
LQ Newbie
 
Registered: Feb 2025
Posts: 4

Rep: Reputation: 0
Help with UART multiplexing


This is related to my question at https://www.linuxquestions.org/quest...rt-4175747941/, but is different.

I have a SARA-R52M10 cellular+GNSS modem connected to Raspberry Pi CM4 UART3. The RPi is running Ubuntu 24.04. I have a ppp interface working fine with the standard UART connection. But, because the ppp interface hogs the connection, and I need to be able to send commands and get information back while maintaining an Internet connection, I am trying to multiplex the UART. The modem supposedly supports this.

This is what I've gotten to for setup:

Code:
# Start fresh
pkill ldattach; sleep 0.5
modprobe -r n_gsm; sleep 0.5

# Load the kernel module
modprobe n_gsm; sleep 0.5

# Configure interface settings for serial device
stty -F /dev/ttyAMA3 115200 raw -echo -crtscts -ixon -ixoff; sleep 0.5

# Use example command from the documentation to enable CMUX on the modem
echo -ne 'AT+CMUX=0,0,,1500,50,3,90\r' > /dev/ttyAMA3; sleep 0.5

# Explicit baud rate
ldattach -s 115200 21 /dev/ttyAMA3 & sleep 1

# Check if ldattach remains running
pgrep ldattach

# Test comms
screen /dev/gsmtty1 115200
After the `ldattach` command, I see 63 `/dev/gsmtty*` devices, but as soon as I try to start a `screen` session with any of them (which works fine beforehand with `/dev/ttyAMA3`), I just get `[screen is terminating]`.
If I try a `cat` command on the /dev/ file, I get `cat: /dev/gsmtty2: Level 2 halted`.

Am I setting up CMUX correctly?
Do you have any ideas on this?
Are you able to reproduce?

Thank you!
 
Old 03-15-2025, 02:21 PM   #2
nabelekt-vl
LQ Newbie
 
Registered: Feb 2025
Posts: 4

Original Poster
Rep: Reputation: 0
I was able to get this working using https://github.com/ya-jeks/gsmmux/. I did:
Code:
apt update
apt install -y build-essential automake autoconf libtool
wget https://github.com/ya-jeks/gsmmux/ar...ads/master.zip
unzip master.zip
cd gsmmux-master
make
make install
/usr/sbin/gsmMuxd -p /dev/ttyAMA3 -b 115200 -s /dev/modem-mux -w /dev/ptmx /dev/ptmx
This gives two separate devices at `/dev/modem-mux0` and `/dev/modem-mux1` that can be used simultaneously.
 
  


Reply

Tags
cellular, modem, raspberrry pi, uart, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does uart console get its value of uart port membase? unifoxz Linux - Kernel 1 12-20-2011 02:28 PM
what is a multiplexing server good for? Thinking Programming 4 08-10-2005 02:39 PM
Bandwidth multiplexing russell Linux - Networking 3 04-14-2005 07:11 PM
Multiplexing ADSLs ? michaelsanford Linux - Networking 6 04-14-2005 05:51 PM
client/server multiplexing AquamaN Programming 1 03-25-2004 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:02 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions