Custom AT command support in ModemManager
Dan Williams
dcbw at redhat.com
Wed Aug 16 16:15:39 UTC 2017
On Wed, 2017-08-16 at 12:24 +0200, Aleksander Morgado wrote:
> Hey,
>
> On Wed, Aug 16, 2017 at 1:36 AM, Jose, Shijo <Shijo.Jose at hughes.com>
> wrote:
> > Moving thread (MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST support) form
> > libmbim-devel list.
> >
>
> Thanks
>
> > > > Is there way to send AT commands to the modem via MM?
> > > > I tired -
> > > > mmcli -m 0 --command="E0"
> > > > error: command failed:
> > > > 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Connected
> > > > : No AT port available to run command'
> > > This happens when there is a single TTY and it is already
> > > connected, there is no other available channel to send commands.
> > > ModemManager doesn't setup CMUX automatically yet.
> >
> > Can this be manually enabled in M for MBIM devices?
> >
>
> I just realized you're working with a MBIM modem. So the "No AT port
> available to run command" may actually mean there is no AT port
> detected in the modem. Are you able to see a TTY listed in the
> "System/ports" entry when you do "mmcli -m 0"?
Also, we'd generally discourage enabling custom AT commands in most
situations. Instead, we'd like to learn more about your use-case and
see if we can come up with a more generic way to do what you want to
do. It may well be the case that what you want to do has an analogue
in the other protocols like MBIM and QMI, and thus we could expose that
functionality generically via D-Bus rather than doing one-off things
for specific modems.
Dan
> > > > Also, can I have MM detect an already connected (plugged-in)
> > > > USB modem, instead of waiting for a hotplug event?
> > > If you're using my ModemManager openwrt integration setup, you
> > > should have a file in /var/run/modemmanager/events.cache which
> > > holds the MM-applicable events that >happened since the system
> > > was booted. If you run ModemManager yourself you should be able
> > > to start the daemon with the extra --initial-kernel-events=[PATH]
> > > argument >pointing to that file. Or, otherwise, see
> > > mm_report_events_from_cache() in
> > > /etc/modemmanager/modemmanager.common
> >
> > I don't see my device (cdc-wdm0) in this list when it is already
> > plugged in when the host powers up. How is this list(events.cache)
> > populated?
> >
>
> See:
> https://bitbucket.org/aleksander0m/modemmanager-openwrt/src/8c553f2a1
> c090abf4da0f4e762ab6cec22d00557/modemmanager/files/25-modemmanager-
> net?at=master&fileviewer=file-view-default
>
> Basically, we get "net" and "tty" hotplug events reported in OpenWRT;
> for the net events we also check if there is a cdc-wdm device
> associated to the network interface, and if there is one we
> "mm_report_event" both the net and the cdc-wdm device. That
> mm_report_event method is the one that appends entries to the
> events.cache file (or removes them if we get a remove hotplug event).
>
More information about the ModemManager-devel
mailing list