Simple Portable Access Point With Mobile Connectivity

by janenaslukas in Circuits > Raspberry Pi

2528 Views, 39 Favorites, 0 Comments

Simple Portable Access Point With Mobile Connectivity

device_set.jpg

In this tutorial I will show you have to build a simple and portable Access Point with LTE (mobile) connectivity using Raspberry Pi 3 model B.

Access Point is a device which has wireless connectivity. Using wireless connectivity Access Point can connect your devices to a network. Access Points usually are used in homes, offices and other spaces where to use wired connection isn’t possible or isn’t practical. Long-term evolution (LTE) is a standard for wireless broadband communication based on the GSM/EDGE and UMTS/HSPA technologies. The LTE modem I'm using is a USB device that can add 3G or 4G (LTE) cellular connectivity to a Raspberry Pi computer.

Prerequisites

For this project we will need:

  • A Raspberry Pi with a power cable
  • A computer, preferably running Linux
  • A microSD card with at least 8GB (I will be using 16GB size card)
  • An Ethernet cable
  • HDMI cable
  • A monitor to connect the RPI
  • An LTE modem (I am using a Teltonika TRM240)
  • A SIM card for mobile connectivity
  • Raspberry PI OS lite version
  • Powerbank

​Installing the OS on the SD Card

rpi_imager.png
rpi_imager_select_os.png
rpi_imager_write_to_sd.png

In this tutorial to install RPI OS on to the SD card I will be using “RPI imager” which can be downloaded here.

Press the the button below the label “Operating System”. In the opened window navigate to “Raspberry Pi OS (other)”. Then there select “Raspberry Pi OS Lite (32-bit)” version.

Also don’t forget to select the SD card where to install the OS. You can do that by pressing the button under the label “SD card”. When everything is selected, press the “Write” button and wait for the program to finish installing the OS.

Getting Ready RPI for Work

raspi_config_enable_ssh.png
get_eth0_ip.png

When the OS is finished installing, insert the SD card in to the RPI. Then connect the RPI to your router for internet connectivity, we will need to install some software. Using your HDMI cable connect the RPI to the monitor and power on it.

Wait for the RPI to boot up. In the login screen enter your credentials. The default credentials for RPI is:

  • Username – pi
  • Password – raspberry

For remote configuration I will enable SSH service. If you want, you can configure the RPI using the monitor.

When logged in execute this command:

# sudo raspi-config

In the opened window navigate to “Interface Options” and enable “SSH”. From now you can connect through SSH.

Now execute this command to get your IP address:

# ifconfig

Look for the label eth0. This label represents your wired ethernet connection.

Install Necessary Software

From now on we will be using network-manager for network interface configuration. To install the network-manager execute this command:

# sudo apt install network-manager

Also we need to remove the conflicting software. Execute this command to remove the conflicting software:

# sudo apt purge openresolv dhcpcd5

Now reboot your device for the changes to take effect.

Set Up the Mobile Interface

check_wwan0_interface.png
check_internet_con_ping.png

After all software is installed, you can set up the mobile interface. Before connecting the modem to the Raspberry Pi read, the modem instructions to set it up. Then connect your mobile modem to the Raspberry Pi and wait a little until the modem boots up.

Now we need to create a interface for the modem. We can do that by using nmcli command. Execute this command, but before that change the <apn> with apn that your mobile operator provides for connection:

# sudo nmcli c add type gsm ifname cdc-wdm0 con-name mobile apn <apn>

Use ifconfig command check if the mobile interface appears. You should see a new interface by the name wwan0.

If the interface would not appear, execute this command:

# sudo nmcli c up mobile

Execute this command to check if you have internet connection over the new interface:

# ping -I wwan0 -c 4 google.com


Set Up the Access Point

nmcli_interface_list.png
check_wlan0_interface.png

The network connection is ready. It’s time to set up the Access Point for other devices where to connect.

First of all we need to create an interface for the AP. Execute this command:

# sudo nmcli connection add type wifi ifname wlan0 con-name wifi autoconnect yes ssid "RPI AP"

In the network-manager you should see a new connection. To look it up execute this command:

# nmcli connection

Now configure our new interface to act as an Access Point. Execute this command:

# sudo nmcli connection modify wifi 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared

Now add some security to it. Execute this command, but don’t forget to change <pw> to your desired password:

# sudo nmcli connection modify wifi wifi-sec.key-mgmt wpa-psk wifi-sec.psk <pw>

For changes to take effect, you need to reload the interface. Execute these commands:

# sudo nmcli connectio down wifi
# sudo nmcli connectio up wifi

To modify your Access Point connection you can use nmcli. The syntax for it would be - nmcli connection modify <con_name> <parameter> <value>
To check if our Access Point has an IP address you can use ifconfig once again and look for the interface by the name wlan0.


Try It Out

connect_to_ap.png

Take your device with wifi connectivity ant try to connect to our newly created Access Point. If you haven’t change the name of the Access Point, you should look for “RPI AP”.

Make It Portable

To make it portable just take a powerbank and connect the RPI to it.

Now you can take your Access Point with you everywhere you go.

Security Tips

We haven’t turn off the SSH service and our RPI password is very weak. You can turn off the SSH service, but then you would not have any remote access to your RPI. To configure the RPI then you should have a monitor and a keyboard.

Other thing that you can do is to change the default password of the pi user to a stronger one and you only should know it.

Third tip is that you could allow to access SSH by filtering MAC address though the firewall.