Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Online games, how to get online, and anything involving Dreamcast online can be discussed here.

Moderator: pcwzrd13

User avatar
Petri152
undertow
Posts: 31

Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#1 » Sat Sep 26, 2015 3:47 pm

Hello, Everyone!

Earlier in the week I stumbled upon a video showing a Dreamcast PC-DC Server running on a RaspberryPi and a python script used to help bridge the connection. The uploader did not include instructions on how to use his software (however he did promise that he would as his software is a work in progress). I decided to make my own version of his software based off of his source code. His software uses a series of AT commands and PPP to connect the modem but mine uses PPP and the Mgetty method.

Here is the video I made to show off the software:




Instructions:

If you already have a PC-DC Server that works using the Mgetty method, you can skip to Step 13

This guide assumes you have either a Debian-based Operating System (Virtual Machine or Otherwise) OR a RaspberryPi running Raspian already initially set up.

I will be using Ubuntu 15.04, everything will be done in a Terminal, however, if your machine is headless SSH will work just fine.

Step 1: Open a Terminal or SSH session.

Step 2: Install mgetty and ppp.

Code: Select all

sudo apt-get install mgetty ppp


Step 3: Erase the file /etc/ppp/options and then touch it.

Code: Select all

sudo rm /etc/ppp/options && sudo touch /etc/ppp/options


Step 4: Open elevated GNU Nano and point it to the file /etc/ppp/options

Code: Select all

sudo nano /etc/ppp/options


Step 5: Paste in the following (the line "ms-dns 8.8.8.8" is asking for a DNS server IP and 8.8.8.8 is the Google DNS server, if you have something against Google or are running your own DNS just replace the "8.8.8.8" with whatever you want):

Code: Select all

debug
login
require-pap
ms-dns 8.8.8.8
proxyarp
ktune

Once done, press Ctrl + X and choose "Y" to save the file and press Enter.
Image

Step 6: Now plug in your modem if you already haven't. We need to figure out where your modem is connected in Linux. this can be accomplished by running dmesg and grepping for "tty" like so:

Code: Select all

sudo dmesg | grep tty

Your modem is usually the last line.
Write it down.
If you're using a USB modem there is a good chance that it will be "ttyACM0"
Image

Step 7: Run ifconfig and write down some numbers.

Code: Select all

sudo ifconfig

You will need to write down what you see under "inet addr:" and "Mask:" There is a good chance that your mask is 255.255.255.0
Image

Step 8: Remember the "tty***#" value from earlier? Well, now we need it. We need to create a file called /etc/ppp/options.*** but you need to replace the "***" with the value from Step 6, in my case and the case with most USB modems it would be:

Code: Select all

sudo nano /etc/ppp/options.ttyACM0

Once we're in the file you need to enter some numbers. You need the IP address of the computer you're running this on, which we got from Step 7.
You also need to think of an IP address that is not being used on your network. A safe bet is usually the first 3 sets of digits from your computer IP address and 200 after it, for example: my computer's IP address is 192.168.0.25, so I would use 192.168.0.200 for the Dreamcast.
You need the address that we got under "Mask:" in Step 7.
So once you get all of your numbers together it will be in this format:
computerIP:dreamcastIP
netmask Mask
So in my case it would be:

Code: Select all

192.168.0.25:192.168.0.200
netmask 255.255.255.0

Now save the file and close nano with Ctrl + X.
Image

Step 9: We need to open /etc/ppp/pap-secrets in nano and add a line.

Code: Select all

sudo nano /etc/ppp/pap-secrets

Once the file is open go all of the way to the bottom and add this line:

Code: Select all

dream   *   dreamcast   *


Step 10: Now we need to create a user account on the system for the dreamcast to use when accessing the Internet.
Run this command:

Code: Select all

sudo useradd -G dialout,dip,users -c "Dreamcast user" -d /home/dream -g users -s /usr/sbin/pppd dream

and then run this:

Code: Select all

sudo passwd dream

and then enter "dreamcast" (without the quotes) when prompted.
Image


Step 11: We need to replace /etc/mgetty/mgetty.config with our own so run this:

Code: Select all

sudo rm /etc/mgetty/mgetty.config && sudo touch /etc/mgetty/mgetty.config

Now open it in nano:

Code: Select all

sudo nano /etc/mgetty/mgetty.config

and paste the following in (replace ttyACM0 with what we found in Step 6):

Code: Select all

debug 4
fax-id
speed 115200
port ttyACM0
data-only y
issue-file /etc/issue.megetty

Now close nano and save the file with Ctrl + X.
Image


Step 12: We're almost there!
Fire up your Dreamcast with Planetweb 2.6 or dreamkey.
Go to Start -> Options -> Internet Connections
Configure the following:
Real Name: Can be anything
User Login: dream
Password: dreamcast
Dial Up Number: 555
Backup number: (leave blank)
DNS1: 0.0.0.0
DNS2: 0.0.0.0

Image
On the Dial Options page set up this:
Modem Init: AT&F0
Dial area code: Off
Blind Dial: On

The rest can be left blank.
Image
On the Proxy Settings page click:
User Proxy: No

Image

Step 13: Now we can try it out!
Download the python script attached to this post (or from this mirror: https://www.mediafire.com/?aiecicq47ws1y67) and put it somewhere you can remember on your PC-DC Server. I put it in my home folder.
Change directory to where it is using cd.

Code: Select all

cd /put/directory/here/

We need to make it executable:

Code: Select all

chmod +x dreampi2.py

Now the way it is set up is that the default modem is ttyACM0, if your modem is different you need to nano into dreampi2.py

Code: Select all

nano dreampi2.py

and change the line
MODEM_DEVICE = "ttyACM0"

to whatever your modem is (Step 6):
MODEM_DEVICE = "modem_goes_here"

Close nano and save with Ctrl + X.

Step 14: We're almost there I promise.
You need to install python-pip using this command:

Code: Select all

sudo apt-get install python-pip

and once that is done install run this:

Code: Select all

sudo pip install sh

This will install a module that dreampi2 needs to run.

Step 15: RUN!
Run the file using this command:

Code: Select all

sudo ./dreampi2.py

and then you should see this:
Image
If so, then it worked! You can now connect to the internet on your Dreamcast by just running this script and dialing up on the Dreamcast.
To close the script you need to press Ctrl + C as I didn't implement a way to gracefully close it. Whoops! :oops:

ALSO! There is a bug where the script may not see the modem hang up, if this happens, quit the program and restart it.

Thanks to everyone who helped me with this! Dreamcast Planetweb Setup photo credit goes to Kbuzz at http://www.dreamcast-scene.com/
And a big thanks to you guys here at the forum! You've been so helpful!

DOWNLOADS
Attached to this post!
Mirror: https://www.mediafire.com/?aiecicq47ws1y67

Thanks,
-Petri
Attachments
dreampi2.zip
DreamPi2 Version 1
(1.56 KiB) Downloaded 471 times
PSO ver.2 Dreamcast - Petri - Lv. 31 HUmar

User avatar
Petri152
undertow
Posts: 31

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#2 » Sun Sep 27, 2015 1:18 am

Reserved for future use.
PSO ver.2 Dreamcast - Petri - Lv. 31 HUmar

kazade
Developer
Posts: 264

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#3 » Sun Sep 27, 2015 8:30 am

Hi!

I'm glad you've found my code useful! I was wondering though if you could call your version something else? I'm still working on the Dreampi software and when I release it things will get confusing :)

I haven't had a chance to look at your code yet, but I was wondering what the advantage of using mgetty was?

User avatar
Petri152
undertow
Posts: 31

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#4 » Sun Sep 27, 2015 12:15 pm

No real advantage to it except that it is the most popular method to set up a PC-DC server and the script would integrate nicely with most people's setups. Also, I'll look into changing the name, it'll take a day or two though.
PSO ver.2 Dreamcast - Petri - Lv. 31 HUmar

User avatar
Nico0020
Sunday Shootout
Posts: 653

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#5 » Thu Oct 01, 2015 5:33 am

Very cool to see this project working. Is there any way to have the script autorun on bootup, basicalyl making a self contained device?

SMiTH
Black Mesa
Posts: 1492

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#6 » Thu Oct 01, 2015 12:09 pm

This is very cool indeed.
I will follow this guide and setup another vm soon.
I think this dreampi linux setup will be the most reliable dc pc server??

So far I have win98 dc pc vm, ubuntu 10.4 dc pc vm, (working on a windows nashville one)

Here is a question...

What if we simply modify the python script with:
the string for our modem ex:(ttyS0)

Then we run py2exe and build a windows executable.
Is this even something that could work?
What limitations in windows would need to fixed in order for the exe to work properly?
Are there libraries we can add to windows to allow support for this modified version?

What about building a similar script that can run in a windows environment?
There has to be similar functions and or modifications that could be made to allow this to work.
Even if it is convoluted and would require multiple scripts, modifications etc.

I'm not a fanboy of one particular OS.
I like MAC OSX 10.1-10.7, Windows (**Not 8 or 10), Ubuntu Linux, iOS, Android.
There are so many OSes to choose from.
They all have their own unique purposes.

But, lets be honest here...
The majority of computers run Windows.
The majority of software is for Windows.
(Yes, there are 3rd party apps, open source stuffs, etc..)
But, you eventually hit a wall and realize that you have to run windows for certain applications, software, games, etc.
There is a huge gap with specific software not existing in any other platform except windows.

User avatar
ABOhiccups
rebel
Posts: 16

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#7 » Tue Aug 02, 2016 10:15 am

I'm using Manjaro (based of Arch Linux).

I enter this command.

Code: Select all

sudo useradd -G dialout,dip,users -c "Dreamcast user" -d /home/dream -g users -s /usr/sbin/pppd dream


I get this.

Code: Select all

useradd: group 'dialout' does not exist
useradd: group 'dip' does not exist


EDIT: In order to get this command to work on Arch Linux / Manjaro. Enter the following commands.

Code: Select all

sudo groupadd dialout

Code: Select all

sudo groupadd dip


If it doesn't work. Watch this video.

If you're on Manjaro. Enter visudo on Terminal won't work for you. You have to open Root Terminal by enter this command.

Code: Select all

su


Then enter this command.

Code: Select all

nano /etc/sudoers

User avatar
blatz42
rebel
Posts: 17

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#8 » Tue Aug 16, 2016 6:26 pm

Edit: NVM, I've figured it out.

User avatar
ABOhiccups
rebel
Posts: 16

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#9 » Mon Sep 26, 2016 7:05 pm

I recommend Linux Lite 2.0 32-Bit in order for this to work.

User avatar
Ryochan7
Teriaaaaa
Posts: 91

Re: Linux (and RaspberryPi) PC-DC Server with Auto-connect Guide!

Post#10 » Wed Oct 12, 2016 6:15 pm

Thank you for providing the script. I have tried methods to get mgetty to auto answer the line but no technique that I tried worked. It is nice that the script is able to automatically answer the line with my setup.

There are a couple of problems that keep the script from being Python 3 compatible but I usually use Python 2.7.x anyway.

Edit: I tweaked the script and made a custom version. Some changes in commands, bug fixes for responses, and Python 3 compatibility. https://bitbucket.org/Ryochan7/dreampi2-custom

  • Similar Topics
    Replies
    Views
    Last post

Return to “Online”

Who is online

Users browsing this forum: No registered users