Doom – Blog. by Next Thing https://ntcblogbackup.wpengine.com News & Notes. Process & Projects. No BS. Srsly. Thu, 09 Nov 2017 03:16:07 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 Here’s How to Host a 90s-Style DOOM LAN Party Using PocketC.H.I.P. https://ntcblogbackup.wpengine.com/heres-how-to-host-a-90s-style-doom-lan-party-using-pocketc-h-i-p/ https://ntcblogbackup.wpengine.com/heres-how-to-host-a-90s-style-doom-lan-party-using-pocketc-h-i-p/#comments Tue, 19 Jul 2016 18:19:41 +0000 http://blog.nextthing.co/?p=771 Doom LAN party battle of the Stands: Team Pencil versus Team Pen

Doom LAN party with PocketC.H.I.P.: Team Pencil Stand versus Team Pen Stand

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!

1. Setup PocketC.H.I.P. as a WiFi Access Point

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..


2. Configure DNSmasq

DNSmasq_config_RocketCHIP

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.

interface=wlan1
except-interface=wlan0
dhcp-range=172.20.0.100,172.20.0.250,1h

Save and quit.

Note: If you feel lost with Nano, check out this great tutorial.


3. Setup a Static IP Address

networkinterface_RocketCHIP

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.

source-directory /etc/network/interfaces.d
auto wlan1
iface wlan1 inet static
address 172.20.0.1
netmask 255.255.255.0

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.


4. Start the wlan1 Interface

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.


5. Restart the DHCP server

dnsmasq_restart_RocketCHIP
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.


6. Configure the Access Point on C.H.I.P.

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.

interface=wlan1
ssid=NTC_LAN_PARTY
channel=1
ctrl_interface=/var/run/hostapd

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.


7. Write a Systemd HostAPD Configuration

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.

[Unit]
Description=hostapd service
Wants=network-manager.service
After=network-manager.service
Wants=module-init-tools.service
After=module-init-tools.service
ConditionPathExists=/etc/hostapd.conf

[Service]
ExecStart=/usr/sbin/hostapd /etc/hostapd.conf

[Install]
WantedBy=multi-user.target

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.


8. Install Doom

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!


9. PocketC.H.I.P. LAN Party

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.
prboom-game-server

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.


Get Fragging!

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.

When you do take a break between rounds, snap a picture of your LAN party and share it on Facebook, Twitter, and in our forums. And while you’re there, don’t forget to mention your favorite WAD file!

]]>
https://ntcblogbackup.wpengine.com/heres-how-to-host-a-90s-style-doom-lan-party-using-pocketc-h-i-p/feed/ 17
Customize the Hell Out of Your PocketC.H.I.P. — Install Doom & Give It an Icon on the Home Screen https://ntcblogbackup.wpengine.com/customize-the-hell-out-of-your-pocketc-h-i-p-install-doom-give-it-an-icon-on-the-home-screen/ https://ntcblogbackup.wpengine.com/customize-the-hell-out-of-your-pocketc-h-i-p-install-doom-give-it-an-icon-on-the-home-screen/#comments Tue, 12 Jul 2016 17:20:38 +0000 http://blog.nextthing.co/?p=753

PocketC.H.I.P. was designed to be customizable to your own personal taste, so it’s great to see Pocketeers like Marshmallow share their additions on the NTC forums.

Thanks to his work, you can modify the PocketC.H.I.P. home screen in a number of ways: add icons for your favorite programs, change the background color or add a wallpaper, and even add additional pages of applications. The software also offers nice additions to the user interface, such as the ability to delete icons from the home screen and a display of the remaining battery in an easy-to-read percentage.

Here’s how to install Marshmallow’s software and add an application and custom icon. Fire up your PocketC.H.I.P. and let’s head straight to hell with this community favorite: Doom!

1. Update Your System Package Lists

Make sure your PocketC.H.I.P. is connected to the internet, then open the Terminal application and update the package information. Type the following command and pressing enter.
sudo apt update

1.5 (Optional) Install SSH

It’s possible to do this project completely on PocketC.H.I.P., but some of the URLs are a bit tedious to type in. Instead, I installed SSH on PocketC.H.I.P., so that I can easily cut and paste the longer commands from my computer into an SSH terminal.

Install SSH.
sudo apt install ssh

Note: SSH is not pre-installed on PocketC.H.I.P., because we didn’t want thousands of devices to have SSH servers running with a widely known default password. It’s always a good idea to change your password once you get a device. This is especially true when your device runs a service that allows anyone who knows your IP address and password access.


2. Change your Passwords

Change the password for both the root and chip users on your PocketC.H.I.P.. For full details, consult this section in the docs.


3. Download and Use Marshmallow’s Installer

Open an SSH connection from your computer (or laptop) to PocketC.H.I.P., or you can type all of this in directly to PocketC.H.I.P., it’s up to you.

Note: If you need help, check the docs for details on using SSH.

Type cd to make sure you’re in the home directory.
cd

Note: cd without a directory path after the command will always take you to your home directory. Another way to do this is to type cd ~ or cd /home/chip.

Once you’re connected and have a command-prompt, use wget to download the text of Marshmallow’s installation script.
wget -O install-pockethome http://bit.ly/29zN90q

Back at the command-line, use chmod to change the permissions of install-pockethome. This will let you execute the file as a program.
chmod +x ./install-pockethome

Now run the installation script.
./install-pockethome

Reboot PocketC.H.I.P. and Marshmallow’s home screen will start right up. You’ll know you’re running his software when you see the battery icon has a percentage by it.
sudo reboot

Note: If you’re curious to look at Marshmallow’s source code, take a look at his GitHub repository.


4. Install Doom

From the command-line, install Doom and the shareware map files (called WAD files) for the game.
sudo apt install prboom doom-wad-shareware

Note: For those curious, Doom is open source software and you can read every line of this class game on id Software’s GitHub repository.


5. Download a Doom Icon

doom

The Icon Archive has a nice Doom icon that’s perfect for the home screen. Use wget to download and rename the file as Doom.png.

Type cd to make sure you’re in the home directory.
cd

Download the image.
wget -O Doom.png http://icons.iconarchive.com/icons/3xhumed/mega-games-pack-26/256/Doom-1-icon.png

Note: Enter the command above without a line break in the URL.

Once the icon is downloaded, you won’t need to use the SSH connection. Grab your PocketC.H.I.P. and tap and touch you way through the rest of the project.


6. Adding a Doom Icon to the Home Screen

Tap the settings sprocket in the bottom right corner of the screen and then tap the Personalize button.

Adding the Doom icon to PocketC.H.I.P. home

Adding the Doom icon to PocketC.H.I.P. home

Tap the Add button and fill in the name of the icon, the path to the icon, and the command that should run when the icon is tapped.

  • Name: Doom
  • Icon Path:/home/chip/Doom.png
  • Command:prboom

Tap Apply and then reboot your PocketC.H.I.P. for the settings to take effect. When your PocketC.H.I.P. reboots, you should have an arrow at the bottom of the screen. Tap it and you’ll see the Doom icon.

hotpink

Doom is just a start! Once you’ve added Marshmallow’s software to yourPocketC.H.I.P., make sure to share screen shots on Twitter, Facebook, and in the forums.

Hunting down monster on PocketC.H.I.P.

Hunting down demons on PocketC.H.I.P.

A great way to snap a picture on PocketC.H.I.P. is by using the built-in screenshot tool. Open the Terminal and run the following command.
xfce4-screenshooter

]]>
https://ntcblogbackup.wpengine.com/customize-the-hell-out-of-your-pocketc-h-i-p-install-doom-give-it-an-icon-on-the-home-screen/feed/ 43