Although successful, the process was not that straight forward, so I decided to make a blog about it, in case anyone else goes through the same hardships.
- Download the necessary RPMs
- Configure USB
- Startup modules
- Service daemon
- AT commands
Since my device doesn't not have Internet connection yet, I had to download the necessary RPM packages locally, transfer it on the target machine and install it there.
The following RPMs are required:
- wvdial (for dial-up)
- atinout (for AT commands)
yum install --downloadonly --downloaddir=/path/to/Downloads/folder/ usb_modeswitch wvdial tcl usbutils libusb1-devel atinout
NOTE: some dependencies may be also downloaded.
Assuming the installation went well, now it's time to set up the UX302NC USB dongle.
/etc/usb_modeswitch.conf the following contents:
DisableSwitching=0 DisableMBIMGlobal=0 EnableLogging=1 # special settings for NCXX device DefaultVendor= 0x11f6 DefaultProduct= 0x1035 TargetVendor= 0x11f6 TargetProduct= 0x1034 MessageEndpoint= not set MessageContent="55534243123456780000000080000606f50402527000000000000000000000" NeedResponse=0 ResponseEndpoint= not set Interface=0x00
Whenever our dervice (re)starts, we need to load the option kernel module automatically. For that we do:
echo option > /etc/modules-load.d/option.conf
The following two scripts need to be placed in
/usr/local/bin with 755 permissions:
- lte_device - this script is checking if the physical device is inserted or not, checks for signal and if the dongle is attached to the network
- lte_service - this script is being used in the service daemon
Next step is to create the daemon service configuration file,
/usr/lib/systemd/system/lte.service with the following contents:
[Unit] Description=LTE connectivity [Service] Type=simple ExecStart=/usr/local/bin/lte_service ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=always RestartSec=55s [Install] WantedBy=multi-user.target
For the daemon changes to take effect and to automatically start on reboot, run the following three commands:
systemctl daemon-reload systemctl start lte systemctl enable lte
Some AT commands are needed for this USB dongle.
By default, when inserted, the USB is a storage device, but we are not interested in that, so we will modify it to boot directly into modem mode.
This is where we use the AT commands and the atinout package that we downloaded.
echo 'AT!AUTOINS=0' | atinout - /dev/ttyUSB2 -
Now every time you plug the USB, it will go directly into modem mode.
Depending on your service provider, you are required to authenticate with either PAP and/or CHAP. Here is how to set the USB to use one or the other methods.
The format of the command is as follows:
<cid>it is the number of the profile you want to set
- 0 no authentication
- 1 PAP authentication
- 2 CHAP authentication
<password>can be anything, we will set this up during the Dial-up phase
So, here are some examples
For PAP you can do something like:
echo 'AT$QCPDPP=1,1,1,1' | atinout - /dev/ttyUSB2 -
For CHAP you can do something like:
echo 'AT$QCPDPP=1,2,1,1' | atinout - /dev/ttyUSB2 -
And the last step is to setup the dial-up which should bring up the
ppp0 interface. We will use here
/etc/wvdial.conf should look something like this:
[Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = USB ISDN = 0 Modem = /dev/ttyUSB1 Baud = 460800 [Dialer net] Phone = *99# Username = "" Password = "" Stupid Mode = 1 Init3 = AT+CGDCONT? Remote Name = "*"
Password with the credentials received from your ISP.
In case you know the APN name where you have to connect, you could replace
Init3 with something like:
Init3 = AT+CGDCONT=1,"IP","APN.name.goes.here"
To bring up your new connection, all you have to do is run:
and check if your
ppp0 interface receives an IP address.
For troubleshooting check the next chapter.
This is mostly for debugging purposes, in case the connection doesn't go through smoothly.
Modify the following two files to look like:
name lte-for-iot /dev/ttyUSB1 lock login usepeerdns debug dump logfd 6
name lte-for-iot nobsdcomp nodeflate noipdefault modem /dev/ttyUSB1 crtscts debug dump nodetach logfd 6
Now you can do a
tail -f /var/log/messages to check the debug messages.
I would like to thank to the technical support of NCXX which were very helpful in making this happen.