Milesight 4G Router configuration: Difference between revisions

From Sensors in Schools
Jump to navigation Jump to search
Line 74: Line 74:
</syntaxhighlight>
</syntaxhighlight>


Download TeamViewer:
* '''Download TeamViewer:'''
On your Raspberry Pi, use wget to download TeamViewer. Replace <paste_link_here> with the link you copied in the previous step:
* On your Raspberry Pi, use wget to download TeamViewer. As of the time of this writing the Raspberry Pi link was '''https://download.teamviewer.com/download/linux/teamviewer_arm64.deb'''
bash
 
Copy code
<syntaxhighlight lang="bash">
wget <paste_link_here>
wget https://download.teamviewer.com/download/linux/teamviewer_arm64.deb
For example:
</syntaxhighlight>
bash
 
Copy code
* '''Install TeamViewer:'''
wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb
* Install TeamViewer using dpkg. Replace <downloaded-package.deb> with the actual filename you downloaded:
Install TeamViewer:
 
Install TeamViewer using dpkg. Replace <downloaded-package.deb> with the actual filename you downloaded:
<syntaxhighlight lang="bash">
bash
Copy code
sudo dpkg -i <downloaded-package.deb>
sudo dpkg -i <downloaded-package.deb>
sudo apt-get install -f
sudo apt-get install -f
For example:
</syntaxhighlight>
bash
 
Copy code
 
sudo dpkg -i teamviewer-host_armhf.deb
sudo dpkg -i teamviewer-host_armhf.deb
sudo apt-get install -f
sudo apt-get install -f

Revision as of 17:42, 10 October 2023

Introduction

  • The Milesight 4G router is being used to connect the Raspberry Pi (BirdNET-Pi) computer to the 4G network and hence the internet.
  • The Milesight 4G router behaves in a similar way to a home internet router.
  • The Milesight 4G router can also be used to access the Raspberry pi computer from the internet using SSH (Secure Shell).
  • These instructions will explain how to configure the Milesight router.

Milesight Menu Navigation

  • Status
    • Overview
    • Cellular
    • Network

Resolving Network Address Range Conflict

  • When the Milesight Router was initially connected to the Raspberry Pi (BirdNET-Pi) the Raspberry Pi was also connected using WiFi to my home router.
  • Unfortuately both networks shared the same address range which was 192.168.1.* and the same
  • To resolve this conflict the Home address was left as 192.168.1.* (255.255.255.0)
  • The Milestream address range was reconfigured to 192.168.2.* (255.255.255.0)

IP Address Conflict

When a computer is connected to two networks, and both of these networks share the same address range, such as both using the IP address range 192.168.1.*, it can lead to what is known as an "IP address conflict." An IP address conflict occurs when two devices on the same network segment (in this case, the computer connected to both networks) have been assigned the same IP address. This situation can result in various networking issues:

  • Communication Problems: The computer may experience communication problems because it doesn't know which network to send data to when trying to reach a device with the same IP address on both networks. This can lead to intermittent connectivity issues or complete loss of network connectivity.
  • Duplicate IP Detection: Modern network protocols have mechanisms to detect IP address conflicts. When a device detects that another device on the same network has the same IP address, it may trigger an error message or attempt to resolve the conflict by changing its IP address.
  • Unpredictable Behavior: The behavior of the computer in such a situation can be unpredictable. It might use one network for certain traffic and the other network for other traffic, leading to inconsistent results.

To resolve IP address conflicts when a computer is connected to multiple networks, you should:

Configure Unique IP Addresses: Ensure that each network assigns unique IP addresses to devices. This usually involves adjusting the DHCP (Dynamic Host Configuration Protocol) settings on one or both of the networks to use different address ranges.

  • Static IP Assignment: If you have control over the IP assignments, consider statically assigning IP addresses to devices on one or both networks to avoid conflicts.
  • Network Segmentation: In cases where you have multiple networks with overlapping address ranges, consider segmenting your networks using routers or VLANs (Virtual Local Area Networks). This way, you can control the routing between networks and avoid IP conflicts.
  • Subnetting: Implement subnetting to divide your networks into smaller subnetworks with distinct address ranges. This can help prevent address conflicts and manage IP address allocation more efficiently.

By ensuring that each device on your networks has a unique IP address within its respective network segment, you can prevent IP address conflicts and maintain stable and predictable network communication.


Subnet Mask

The term you're referring to, "net mask," is more commonly known as the "subnet mask" in networking. The subnet mask is a 32-bit number that is used to divide an IP address into network and host portions. It's a fundamental component of the IP addressing scheme and is used to determine which part of an IP address belongs to the network and which part belongs to the individual host within that network.

In the format you provided, 255.255.255.0, this subnet mask is expressed in dotted-decimal notation, where each of the four octets represents 8 bits. In this example:

  • The leftmost three octets (255.255.255) are set to all ones (binary 1s), indicating the network portion of the IP address.
  • The rightmost octet (0) is set to all zeros (binary 0s), indicating the host portion of the IP address.
  • This subnet mask corresponds to a Class C network and allows for up to 254 host addresses within that network. The first and last addresses (with all zeros and all ones in the host portion) are typically reserved for network address (identifying the network itself) and broadcast address (broadcasting messages to all hosts on the network), respectively, leaving 252 usable host addresses.

Here's a breakdown:

  • Network Portion: 255.255.255.0
  • Host Portion: 0.0.0.255 (the host portion, which allows 8 bits for hosts)

The subnet mask plays a crucial role in determining network boundaries, routing, and IP address allocation within a network. Different subnet masks can be used to create networks of varying sizes, from small local networks to large global networks, by dividing the available address space accordingly.

Connect to Remote Raspberry Pi computer that has no GUI Interface

To install TeamViewer on a Raspberry Pi without a GUI interface (headless installation), you can use the TeamViewer Host version. Here are the steps to install TeamViewer on a headless Raspberry Pi:

  • Access Your Raspberry Pi: You'll need to have SSH access to your Raspberry Pi. Connect to it using SSH from another computer. Alternatively, you can also configure the Raspberry Pi directly (prior to deployment into the field. This is easier and more secure because you don't need to enable SSH.
  • Download TeamViewer Host:
    • a. Visit the TeamViewer download page for Raspberry Pi using a web browser: TeamViewer Raspberry Pi Download.
    • b. Look for the TeamViewer Host for Raspberry Pi section.

    • c. Right-click on the appropriate download link (choose 64-bit version for BirdNET-Pi) based on your Raspberry Pi model (e.g., Raspberry Pi 3 or Raspberry Pi 4) and choose "Copy link address" from the context menu.

https://download.teamviewer.com/download/linux/teamviewer_arm64.deb
wget https://download.teamviewer.com/download/linux/teamviewer_arm64.deb
  • Install TeamViewer:
  • Install TeamViewer using dpkg. Replace <downloaded-package.deb> with the actual filename you downloaded:
sudo dpkg -i <downloaded-package.deb>
sudo apt-get install -f


sudo dpkg -i teamviewer-host_armhf.deb sudo apt-get install -f This will install TeamViewer without any GUI components. Set Up TeamViewer: Now, you can set up TeamViewer to work with your TeamViewer account by running the following command: bash Copy code sudo teamviewer setup Follow the on-screen instructions to set up TeamViewer, including signing in with your TeamViewer account or creating one if you don't have an account yet. Start TeamViewer: After setting up TeamViewer, you can start it by running: bash Copy code sudo teamviewer daemon start Access the Raspberry Pi: You can now access and control your headless Raspberry Pi using TeamViewer from another computer. Remember that you will need to have an active internet connection on both your Raspberry Pi and the computer you use to access it via TeamViewer.


SIM Card options

  • Telstra SIM cards block access via SSH
  • Optus SIM cards can allow for a static IP address that will then permit access via SSH