Skip to content

Network

Douglas Gillespie edited this page Aug 2, 2026 · 10 revisions

Network setup

Network connection to PC

You will need Administrator privileges to set up the network on your computer

The router is the heart of the system that allows all devices to talk to one another. For testing, I’ve been using a TP-Link Pocket 320, which cost about £10 for a used one. However, I expect that we’ll want something with larger antennae for use on ship, so will issue further advice on this later – though in principle, these things are all the same, so just about anything will do – we may require >1 wired Ethernet port if we’re using the ATOMOS video recorders.

A router will automatically assign ip addresses to each device. These are numbers in the form 192.168.0.100. Devices on the same network will share the first three sets of numbers (192.168.0), and must have a different last three digits, which will be between 1 and 255.

It's best to use a wired Ethernet cable to connect your laptop to the router. Most laptops no longer come with a built in Ethernet port, but it's easy to purchase a USB to Ethernet adapter.

Generally, a router will try to assign the same address to a device each time it connects, but this is not guaranteed. It doesn’t matter much if the ip addresses of the android devices change, but each Android device MUST know the ip address of the laptop in order for it to connect to the MQTT broker. If this address changes, every device will have to be reconfigured – more to follow on this !

An Android phone tries really hard to connect to the internet and will do just about anything it can to keep you online. During SCANS, you will not have Internet, and when testing in your office you’ll need to make sure that your devices don’t drop the link to the SCANS router and reconnect to your home wifi or give up on the wifi connection and switch to mobile data. When setting up, it is therefore essential that you turn off mobile data, and uncheck any options that will auto-connect you to any network apart from the SCANS router.

For testing, this may all work over your home wifi, but I’ve not been able to do it over the University network, no doubt due to higher security. Once connected, on the Windows laptop open a command prompt (Press the Windows key ( ), and type ‘cmd’) to open a command window. Type ipconfig into the window and see what comes up. You should be able to identify the connection to the SCANS router - make a note of the ip address since you'll need to enter this into all of the SCANS apps on the Android devices. On my computer, this is currently 192.168.0.250, though it does vary depending on which network adapter I use!

Mosquitto MQTT

Download and install Mosquitto MQTT Broker and MQTT Explorer.

As you install MQTT broker, it should give the option to run it as a Windows service. Select this option and the broker will start each time you start Windows. However (the fun bit) the broker needs a configuration file that tells it it’s OK to take connections from other devices. The default configuration file (mosquitto.conf) in C:\Program Files\Mosquitto is not set up correctly, so copy the mosquito.conf file from https://github.com/SCANS-Survey/SCANS/tree/main/Laptop/MQTT in place of the existing one.

Getting through Windows security

When Mosquitto runs as a service (i.e. it starts automatically with Windows) it doesn't correctly ask permissions to open the network to external devices. You have to do this manually.

First, make sure that Mosquitto isn't running. You can do this from the Task Manager.

Then open a command window and change folders to the Mosquitto installation folder

cd "c:\program files", 

then launch Mosquitto manually by typing

c:\Program Files\Mosquitto>mosquitto.exe -c mosquitto.conf

You should immediatly get a pop up windows asking for permissions:

Click 'Allow'.

You only need to do this the once, Mosquitto can then launch as a service with the correct permissions each time Windows starts.

If you want to check, open the Windows Firewall and click on 'Inbound Rules' and you should see mosquitto listed.

MQTT Explorer

You don't need this, but it's useful for troubleshooting.

Install and run MQTT Explorer. As it starts, you’ll get some connection options. Set the name to ‘localhost’, the Host to ‘localhost’ and the Port to 1883. At the moment, we’re not planning to use user names and passwords but please check for updated versions of this manual.

Clone this wiki locally