PocketC.H.I.P. is more fun with friends, so call them up and make plans for a 90s-style Doom LAN party!
Following this guide you’ll learn how to setup a Doom server that runs directly on PocketC.H.I.P.. Plus, you’ll learn how to configure PocketC.H.I.P. to provide IP addresses to all your friends’ devices –PocketC.H.I.P., C.H.I.P., or any Doom playing devices (so basically anything).
The best part is no rackmount servers or ethernet wires required. Happy fragging!
Since PocketC.H.I.P. is mobile, you’ll want to be able to have your LAN party anywhere, even if that means far away from your home network. To be this portable, you’ll need to configure one of the PocketC.H.I.P.s involved in the LAN party to provide a basic network infrastructure for the event.
Update the apt package lists and install DNSmasq.
sudo apt update && sudo apt install dnsmasq
Note: DNSmasq is a software package that enables you to set up a small dynamic host protocol (DHCP) network using C.H.I.P..
Use the text editor Nano to write a configuration file for DNSmasq.
sudo nano /etc/dnsmasq.d/access_point.conf
Enter the text below into access_point.conf file.
Save and quit.
Note: If you feel lost with Nano, check out this great tutorial.
Since you’ll want other devices to connect to your PocketC.H.I.P.’s Doom server, it’s best to configure a static IP address for the device. This way you can tell all your friends the server’s IP address and quickly join the the network game.
You’ll use the PocketC.H.I.P. wlan1 network adapter to handle all of the Doom server networking.
sudo nano /etc/network/interfaces
Populate with the file with following lines of configuration.
iface wlan1 inet static
Once entered, save and quit Nano.
Note: Static addresses get their name because they don’t change when you reboot. This is opposed to dynamic IP address, which can potentially change on reboot and are typically served by DHCP servers.
Use the ifup command to start the wlan1 static IP address. The command reads the configuration file /etc/network/interfaces, which you set up in the previous step.
sudo ifup wlan1
Test that everything worked by typing the following command.
ip addr show wlan1
You should get output showing the IP address of wlan1 is 172.20.0.1. If you don’t, revisit the last step and make sure you input the configuration file correctly.
To provide IP addresses to all of the client devices of your LAN party, you’ll need to setup a DHCP server. DHCP servers dynamically assigns an IP address to any client device that asks for one. In fact, the ‘D’ in DHCP stands for dynamic.
sudo /etc/init.d/dnsmasq restart
Note: When setting up a network where you don’t know the number of devices that will connect to your server, DHCP is a nice way to dynamically handle the problem. The configuration file you wrote in Step 2, permits the DHCP server from giving out IP addresses from 172.20.0.100–172.20.0.250. So, unless your friends bring over 151 WiFi devices to the party, you should have more than enough IP addresses for the DHCP server to assign.
DHCP servers can also configure far more client details than you’re using in this project: things like the route for traffic to get to the internet and which domain name servers to use. That stuff is way beyond the scope of configuration you’ll need for a Doom LAN party server. Here you’ll just need several devices to communicate with each other, not get on the internet.
In order for any devices to connect to the PocketC.H.I.P. DHCP server you just configured, you’ll need to broadcast an SSID –just like the one from your home WiFi network.
Here’s how to create a SSID called NTC_LAN_PARTY, fitting for what this whole project is about. Edit the hostapd.conf file by typing:
sudo nano /etc/hostapd.conf
Populate the file with the following text.
Once you’ve saved the file, start the hostapd application, which reads the config file you just made.
sudo hostapd /etc/hostapd.conf
Note: Check out this bbs post for more info about how to add password protection to your wireless network.
Since you’ll want your access point to work even after a system reboot, edit one more config file and your server will be almost set.
sudo nano /lib/systemd/system/hostapd-systemd.service
Fill the file with the following text.
And finally run these commands to get systemd squared away.
sudo update-rc.d hostapd disable
sudo systemctl daemon-reload
sudo systemctl enable hostapd-systemd
sudo systemctl start hostapd-systemd
systemctl status hostapd-systemd
Note: Systemd is what controls when daemons start and stop in Debian Linux. You can learn more about it on their site.
If you don’t already have Doom on your PocketC.H.I.P., open the Terminal and install Doom plus the shareware map files.
sudo apt install prboom doom-wad-shareware
Note: Doom maps use the file extension .WAD and you can find all sorts of them online, many of which are free to use. If you bought a copy of Doom, you can also use the .WAD files that came with the game. But don’t be a pirate, make sure you’re using freeware WAD files or you own the game!
Once you’ve gotten all the PocketC.H.I.P. Doom server setup, it’s time to have some LAN party fun. On the PocketC.H.I.P. that’s setup as the server, open the Terminal and execute the following command.
Then open a new tab in the Terminal using the icon in the top left corner with a plus. This will give you a new terminal session from which to launch the Doom client application. Here’s how you should start the Doom client.
prboom -net 172.20.0.1
On all the other PocketC.H.I.P.s (and non-PocketC.H.I.P. Doom-playing-devices you’re inviting to your party) join the network NTC_LAN_PARTY. Once you have an IP from this network, open the Terminal application and type the following.
prboom -net 172.20.0.1
Note: Careful readers will notice that the IP address used in these command is the one that is statically assigned to the PocketC.H.I.P. server. It makes a lot of sense, you’re telling prboom to look for a server at the IP address where you set it up.
Network Doom will not start until there are at least two clients connected to the server. The client connection from the PocketC.H.I.P. counts as one, so you’ll only need to find one other person in order to have a LAN party.
Note: If anyone quits the game, the Doom server may terminate. On the PocketC.H.I.P. that’s handling all of the server responsibilities, look to see if prboom-game-server has stopped running. You’ll be able to tell this because there will be a flashing rectangular input cursor if the server has quit. Just run the command again and have all your friends join to get it working again.
Now that your server is up and running and your friends are on the way, make sure you have plenty of snacks and beverages for hours of fun.