Approach 1: One-time Driver Configuration (Best for Testing)
On Linux, after boot and after inserting the Cat-M1 Nova (u-blox SARA-R404M module), the following steps are working for me (including after multiple reboots):
$ sudo apt-get install cu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
cu
...
Setting up cu (1.07-23) ...
$ lsmod | grep option
$ ls -l /dev/ttyUSB*
ls: cannot access '/dev/ttyUSB*': No such file or directory
$ sudo modprobe option
$ lsmod | grep option
option 53248 3
usb_wwan 20480 1 option
usbserial 53248 8 option,usb_wwan
$ sudo sh -c 'echo -n 05c6 90b2 > /sys/bus/usb-serial/drivers/option1/new_id'
$ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Apr 18 10:48 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 2 Apr 18 10:48 /dev/ttyUSB2
crw-rw---- 1 root dialout 188, 3 Apr 18 10:48 /dev/ttyUSB3
$ sudo cu -l /dev/ttyUSB2 -s 9600
Connected.
AT
OK
ATI
Manufacturer: u-blox
Model: SARA-R404M
Revision: SARA-R4.K0.0.00.00.06.07
IMEI: 35528XXXXXXXXXX
OK
~.
Disconnected.
(Note the ~.
is the keystroke that is used to exit the cu
program.)
If after running the above commands I remove and reinsert the Cat-M1 Nova, within a few seconds it enumerates and I can rerun cu -l /dev/ttyUSB2 -s 9600
and issue AT commands again to the modem.
One could, in theory, add some of these commands into /etc/rc.local
to make their effects persistent, but there’s a better way…
Approach 2: Persistent udev
Rule
To make these persistent rather than running the above commands every time, a udev
rule can be added that will automatically add this device to the device IDs that are served by the option
kernel module (driver).
Create a new file in /etc/udev/rules.d/70-hologram_nova_r404m.rules
and add the following:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="90b2", RUN+="/bin/bash -c 'modprobe option && echo 05c6 90b2 > /sys/bus/usb-serial/drivers/option1/new_id'"
Then, save the file. This tells udev
to, essentially, do what we were doing in Approach 1 every time the device is detected (upon boot, upon insertion, or upon reinsertion).
Next, if we already tested Approach 1, we’ll want to clean up what we had done from before by removing the option
module, and then reload the udev
rules. Thus, run the following two commands:
$ sudo rmmod option
$ sudo udevadm control --reload-rules
At this point, I was able to see the device enumerated and then use cu
to start a serial terminal and issue AT commands to the modem:
$ sudo cu -l /dev/ttyUSB2 -s 9600
Connected.
AT
OK
ATI
Manufacturer: u-blox
Model: SARA-R404M
Revision: SARA-R4.K0.0.00.00.06.07
IMEI: 35528XXXXXXXXXX
OK
~.
Disconnected.
After removing and reinserting the Cat-M1 Nova, I was able to repeat the above commands successfully, and observed that the automation persisted after reboot and power-cycling the system.
Would either of you be able to attempt the udev
rule and report back your observations? TIA.
Best,
PFW