Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Change APN on USB 3G Modem

Fri Jul 08, 2016 8:41 pm

I've been using my Pi for a while using a Huawei USB modem with no problems. I just plugged it in, started up the Pi and it worked. However now I need to change the APN name for the sim card I'm using.

Were can I do this?

I'm using raspbian.

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: Change APN on USB 3G Modem

Fri Jul 08, 2016 10:06 pm

I don't know of any default method in raspbian of a 3G/cellular modem 'just working'... I could be wrong.

In any case.. there must be settings somewhere, in case of the popular sakis3g script.. the line is APN="blablayourAPN" in the /etc/sakis3g.conf file. The script uses these to pick the APN via an AT command to the modem.

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

User avatar
liudr
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 2:42 am

Taqyon wrote:I've been using my Pi for a while using a Huawei USB modem with no problems. I just plugged it in, started up the Pi and it worked. However now I need to change the APN name for the sim card I'm using.

Were can I do this?

I'm using raspbian.
What program are you using to dial, wvdial or else? Setting files are located in different places for different programs.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

java
Posts: 226
Joined: Mon Jul 21, 2014 9:41 am

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 6:10 am

If using wvdial in "/etc/wvdial.conf"

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 8:16 am

Some of the newer 3G sticks provide a network interface and handle the 3G connection themselves. If you've got one of these types of device (I think it will appear as a device like eth1) there'll be a web page provided by the dongle to configure some settings (likely http://192.168.1.1/)

Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 9:42 am

Thanks for the reply everyone.

I'm 99.9% certain I just plugged my device in and it worked. If I do a lsusb:

Code: Select all

pi@raspberrypi:~ $ lsusb
Bus 001 Device 007: ID 19d2:1048 ZTE WCDMA Technologies MSM
Bus 001 Device 005: ID 20f4:648b TRENDnet TEW-648UBM 802.11n 150Mbps Micro Wireless N Adapter [Realtek RTL8188CUS]
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I only later started to fiddle with sakis3g and wvdial. Currently:

Code: Select all

pi@raspberrypi:~ $ cat /etc/wvdial.conf
[Dialer Defaults]
Phone =
Username =
Password =
New PPPD = yes
I'm having trouble getting the sakis3g script to work - I eventually had to uncompress and untar it from a PC because the pi said it's not recognized. When I run "sudo ./sakis3g --interactive" and I go down the menu, it just eventually reports "failed to connect" and no config file is created.

+mfa298 My ifconfig shows an IP address of 192.168.9.136, but NetSurf says it can't connect to that address on port 80.

Code: Select all

pi@raspberrypi:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:19:66:ce
          inet6 addr: fe80::7c6:d56d:6eac:5262/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:200 errors:0 dropped:0 overruns:0 frame:0
          TX packets:200 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:16656 (16.2 KiB)  TX bytes:16656 (16.2 KiB)

usb0      Link encap:Ethernet  HWaddr 02:0c:e7:0b:01:02
          inet addr:192.168.9.136  Bcast:192.168.9.255  Mask:255.255.255.0
          inet6 addr: fe80::df88:1af0:85ae:3f16/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1825 errors:0 dropped:0 overruns:0 frame:0
          TX packets:163 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:246898 (241.1 KiB)  TX bytes:26405 (25.7 KiB)

wlan0     Link encap:Ethernet  HWaddr d8:eb:97:2b:df:fa
          inet addr:10.6.77.118  Bcast:10.6.77.255  Mask:255.255.255.0
          inet6 addr: fe80::1c55:1d51:7a3a:462c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:253 errors:0 dropped:0 overruns:0 frame:0
          TX packets:177 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:72222 (70.5 KiB)  TX bytes:34285 (33.4 KiB)

Many thanks for any help, I'm still a newb..
Regards

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 10:57 am

Taqyon wrote: +mfa298 My ifconfig shows an IP address of 192.168.9.136, but NetSurf says it can't connect to that address on port 80.

Code: Select all

pi@raspberrypi:~ $ ifconfig
usb0      Link encap:Ethernet  HWaddr 02:0c:e7:0b:01:02
          inet addr:192.168.9.136  Bcast:192.168.9.255  Mask:255.255.255.0
          inet6 addr: fe80::df88:1af0:85ae:3f16/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1825 errors:0 dropped:0 overruns:0 frame:0
          TX packets:163 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:246898 (241.1 KiB)  TX bytes:26405 (25.7 KiB)
192.168.9.136 is the address on the Pi not the address of the dongle (if that network is from the dongle). Chances are the dongle is on 192.168.9.1 or 192.168.9.254. You could probably check that with (netstat -nr).

Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 8:10 pm

Looks like you're on the money! However I get an error that the browser does not support javascript, so I've installed Epiphany, but I can't find it on the apps folder on the desktop..... Any help appreciated.

fruitoftheloom
Posts: 23363
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Change APN on USB 3G Modem

Sat Jul 09, 2016 8:21 pm

Taqyon wrote:Looks like you're on the money! However I get an error that the browser does not support javascript, so I've installed Epiphany, but I can't find it on the apps folder on the desktop..... Any help appreciated.
In Raspbian, Epiphany is the default included Web Browser and should support JS :(

So not sure what or why you have installed :?:

Maybe Iceweasel/Firefox Browser will suffice:

Code: Select all

sudo apt-get update
sudo apt-get install iceweasel
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Re: Change APN on USB 3G Modem

Sun Jul 10, 2016 1:41 pm

Most excellent, it works! For some reason Epiphany wasn't pre-installed, but with your help I have Firefox running and I can change everything about the connection via the web site to 192.168.9.1!

Thanks again!

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: Change APN on USB 3G Modem

Sun Jul 10, 2016 9:28 pm

Didn't know some show up as ethernet adapters. Saves digging into connect scripts and ppp, etc.

What model cell modem is this?

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Re: Change APN on USB 3G Modem

Wed Jul 20, 2016 9:25 pm

mosespi wrote:Didn't know some show up as ethernet adapters. Saves digging into connect scripts and ppp, etc.

What model cell modem is this?

Regards,
-Moses
Sorry took a while to get the client to send me a picture. See attached.
Attachments
USB Modem.jpg
USB Modem.jpg (45.24 KiB) Viewed 6280 times

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: Change APN on USB 3G Modem

Tue Sep 13, 2016 6:52 am

Hello.

I kinda have this same kind of problem. But, my usb modem (Telewell TW-LTE/4G/3G+ USB-Dongle) has no NAT active. Also i have purchased a puplic ip address from my ISP. Now i need to change the APN from Internet to Internet4.

This dongle also "Just connects" when i plug it in. In Windows theres a client software where i can change the apn (actually no, but i can create a new one and use that).

Now i need to know how to change this APN inside the stick in Raspbian. Or is there somekind of default dialer raspbian uses in the background without telling me? Theres no wvdial in the system nor sakis etc.. :/

Thanks a ton to the one who can help me!

Taqyon
Posts: 7
Joined: Sat Jan 23, 2016 9:23 am

Re: Change APN on USB 3G Modem

Tue Sep 13, 2016 8:23 pm

See if you can open the interface to it using a web browser?

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: Change APN on USB 3G Modem

Wed Sep 14, 2016 4:32 am

Nope no interface. And as i said theres no nat so the ip is puplic for my 4g dongle and my pi

Ongelma
Posts: 113
Joined: Wed Dec 03, 2014 6:46 am

Re: Change APN on USB 3G Modem

Wed Sep 21, 2016 12:10 pm

Still nothing from no one?. :(

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Change APN on USB 3G Modem

Wed Sep 21, 2016 2:58 pm

Ongelma wrote:Still nothing from no one?. :(
You probably need to supply more information. It may also be better to start your own thread rather than replying to one that's months old.

Return to “Beginners”