1757 | | AT+CFUN=4 # command to detach the module from the network |
1758 | | AT+UCGDFLT=1,"IP","yourapn" # Initial PDP (packet data protocol) context configuration |
1759 | | AT+CFUN=1 # return to the module full functionality |
1760 | | }}} |
1761 | | * AT+CGDCONT - Defines the connection parameters for a PDP context |
1762 | | * AT+UCGDFLT - Configures the initial PDP context, i.e. sets the configuration of the PDN (packet data network) activated at attach time in LTE network. The configuration can be optionally saved in NVM (non volatile memory). |
1763 | | * Tested configuration in /etc/config/network: |
| 1759 | * lsusb |grep U-Blox |
| 1760 | }}} |
| 1761 | * Verify serial interface is present: |
1765 | | config interface 'wan' |
1766 | | option ifname 'usb1' |
1767 | | option proto 'dhcp' |
1768 | | }}} |
| 1763 | * dmesg |grep ttyACM0 |
| 1764 | }}} |
| 1765 | * Verify both virtual adapters usb0 and usb1 are present: |
| 1766 | {{{ |
| 1767 | ls /sys/class/net |
| 1768 | }}} |
| 1769 | * Use UCI commands to configure interface: |
| 1770 | {{{ |
| 1771 | uci set network.wan=interface |
| 1772 | uci set network.wan.proto=dhcp |
| 1773 | uci set network.wan.ifname=usb1 |
| 1774 | uci commit network |
| 1775 | }}} |
| 1776 | Using STTY/cat/echo enter these AT commands, more details [wiki:/wireless/modem#ATcommands here]: |
| 1777 | * Configure STTY echo: |
| 1778 | {{{#!bash |
| 1779 | stty -F /dev/ttyACM0 ignbrk -brkint -icrnl -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke |
| 1780 | }}} |
| 1781 | * Configure STTY cat: |
| 1782 | {{{#!bash |
| 1783 | cat /dev/ttyACM0 & |
| 1784 | }}} |
| 1785 | * Verify you can communicate with modem using AT commands: |
| 1786 | {{{#!bash |
| 1787 | echo -n -e "ATI\r" > /dev/ttyACM0 |
| 1788 | }}} |
| 1789 | * Verify modem IP configuration |
| 1790 | {{{#!bash |
| 1791 | echo -n -e "at+uipconf?\r" > /dev/ttyACM0 |
| 1792 | # Example output: +UIPCONF: "192.168.1.1","255.255.255.0","192.168.1.100","192.168.1.100","fe80::fce7:5fff:fe5b:34e/64" |
| 1793 | |
| 1794 | }}} |
| 1795 | * Detach the modem from the network: |
| 1796 | {{{#!bash |
| 1797 | echo -n -e "AT+CFUN=4\r" > /dev/ttyACM0 |
| 1798 | }}} |
| 1799 | * Set APN (default IOT device APN used in this example): |
| 1800 | {{{#!bash |
| 1801 | echo -n -e "AT+UCGDFLT=1,"IP","m2m.com.attz"\r" > /dev/ttyACM0 |
| 1802 | echo -n -e "AT+UCGDFLT?\r" > /dev/ttyACM0 #to verify |
| 1803 | }}} |
| 1804 | * Re-connect to network: |
| 1805 | {{{#!bash |
| 1806 | echo -n -e "AT+CFUN=1\r" > /dev/ttyACM0 |
| 1807 | }}} |
| 1808 | * Verify network parameters, a dynamically assigned IP address should be displayed: |
| 1809 | {{{#!bash |
| 1810 | echo -n -e "at+cgdcont?\r" > /dev/ttyACM0 |
| 1811 | }}} |
| 1812 | |
| 1813 | This completes the configuration process, you may need to reset you device, otherwise perform ping test. Name resolution may need to be set. |