Ryochan's Linux PC-DC Guide Part 3
Now, we can finally get to the good part. Getting the Dreamcast online will be covered in this part.
Setup
First off, you will want to connect the Dreamcast modem to your PC modem. Connect one end of a phone line to the port on the Dreamcast modem and the other end to the LINE phone port on your PC modem. The physical connection has been made. YAY! Progress! Launch Planetweb on the Dreamcast if not loaded already, get your PC ready and fire up your modem.
Starting Mgetty
There are many methods to running the mgetty process. On a desktop, you will likely just want to launch mgetty directly from a terminal. Other methods are using inittab or upstart. On Ubuntu, the old inittab method no longer works due to the incorporation of upstart.
I just launch mgetty from a terminal and that is what I will cover. First off, you must have root access in order for mgetty to work. The only arguments that I give to the program are the device path and a different initialization command. Here is what I use.
sudo mgetty -D /dev/ttyUSB0 -m '"" ATM0'
Here is a quick breakdown of the arguments of the command. The "-D" flag sets the modem to data mode. The device path is specified after that; it is /dev/ttyUSB0 in my case. The "-m" flag is optional and what you can pass will vary depending on what AT commands your modem accepts; read the manual for your PC modem to see which AT commands can be used. With my modem, the speaker is horribly loud so I have to disable it or go deaf. The "M0" portion of the line disables my modem's speaker. The "AT" portion of the line is necessary to make sure the modem goes to AT mode. There is an expect portion at the beginning with the double quotes but I use empty double quotes as I don't have a use for it.
For those who want an upstart example, here is an example script that you can install in the /etc/event.d/ directory and be able to start the script with the start command.
#start on runlevel 3
exec mgetty -D /dev/ttyUSB0 -m '"" ATM0'
respawn
That is enough of that.
Monitor Log Files
I would suggest that you monitor the mgetty process by using "tail -f" on some log files. There are three log files in particular that are helpful. These are the locations of the files under Ubuntu.
- /var/log/mgetty/mg_(INTERFACE).log
- /var/log/messages
- /var/log/syslog
Example:
tail -f /var/log/mgetty/mg_ttyUSB0.log
Dial-in Time
Please read all of this section first before trying it. Mgetty is launched. The Dreamcast is ready. Planetweb is loaded. Now, it is time to start the connection. First off, get a spare terminal ready; I generally have gnome-terminal launched with 4 tabs open. Start the dial up process on Planetweb. Wait about 3 seconds once the output on the Dreamcast stops and then you will issue the following command on your PC to make mgetty answer the line; you must have root access to issue the following command.
sudo killall -USR1 mgetty
The process is very lenient so you don't have to worry about getting your timing exactly right. You should now notice changes to the mgetty log. If all goes well, you will notice changes to the messages log file and the Dreamcast will connect to the PC.
Log Files Examples
This section is just to show what the output of the log files will look like when your Dreamcast is successful in connecting to your Linux box.
/var/log/mgetty/mg_(INTERFACE).log
07/12 15:36:32 SB0 mgetty: interim release 1.1.36-Jun15
07/12 15:36:32 SB0 WARNING: parent process not init(pid=1), but pid=8494 (bash)
07/12 15:36:32 SB0 check for lockfiles
07/12 15:36:32 SB0 locking the line
07/12 15:36:33 SB0 WARNING: DCD line still active, check modem settings (AT&Dx)
07/12 15:36:33 SB0 lowering DTR to reset Modem
07/12 15:36:33 SB0 send: ATM0[0d]
07/12 15:36:34 SB0 waiting...
07/12 15:36:53 SB0 wfr: waiting for ``RING''
07/12 15:36:53 SB0 cannot set controlling tty (ioctl): Operation not permitted
07/12 15:36:53 SB0 >>> this might be caused because you have run mgetty/vgetty
07/12 15:36:53 SB0 >>> from the command line. Don't do that, use /etc/inittab!
07/12 15:36:53 SB0 send: ATA[0d]
07/12 15:36:53 SB0 waiting for ``CONNECT'' ** found **
07/12 15:37:07 SB0 send:
07/12 15:37:07 SB0 waiting for ``_'' ** found **
07/12 15:37:10 ##### data dev=ttyUSB0, pid=8599, caller='none', conn='33600 V42bis', name='', cmd='/usr/sbin/pppd', user='/AutoPPP/'
/var/log/messages
Jul 12 15:53:51 navi pppd[8976]: pppd 2.4.5 started by , uid 0
Jul 12 15:53:51 navi pppd[8976]: Using interface ppp0
Jul 12 15:53:51 navi pppd[8976]: Connect: ppp0 <--> /dev/ttyUSB0
Jul 12 15:53:51 navi pppd[8976]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Jul 12 15:53:54 navi pppd[8976]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Jul 12 15:53:55 navi pppd[8976]: user dream logged in on tty ttyUSB0 intf ppp0
Jul 12 15:53:55 navi pppd[8976]: PAP peer authentication succeeded for dream
Jul 12 15:53:55 navi pppd[8976]: found interface wlan0 for proxy arp
Jul 12 15:53:55 navi pppd[8976]: local IP address 192.168.1.150
Jul 12 15:53:55 navi pppd[8976]: remote IP address 192.168.1.151
The /var/log/syslog file usually just has a more verbose output of what is contained in the messages log file; at least, it does in regards to the pppd messages. Monitoring the syslog file is a good idea for troubleshooting.
End of Part 3
That is it. If nothing went wrong, you should be able to browse the web with your Dreamcast. Part 4 will cover some issues with the PC-DC server and various games.