steptail.com

Does expecting the unexpected make the unexpected the expected?

User Tools

Site Tools


guides:virtual_modem:section_4

This is an old revision of the document!


Section 4 - Setting up Virtual Modem

Required packages

For the connection script to work properly, your Raspbian installation needs a few prerequisite packages. The most important of these is the PPP daemon “pppd” and IP Tables to route packets.

  • Run the following commands to install pppd and iptables:
sudo apt-get update
sudo apt-get install ppp iptables

Download VModem and adjust settings

In the next chapter we will download and install vmodem onto your Raspberry linux box!

sudo mkdir /boot/vmodem
sudo wget http://www.steptail.com/_export/code/guides:virtual_modem:script?codeblock=0 -O /boot/vmodem/vmodem.sh
sudo wget http://www.steptail.com/_export/code/guides:virtual_modem:script?codeblock=1 -O /boot/vmodem/1.sh
sudo wget http://www.steptail.com/_export/code/guides:virtual_modem:script?codeblock=2 -O /boot/vmodem/ppp.sh

  • You have now downloaded the following three files on the Raspberry Pi:
    • /boot/vmodem/vmodem.sh
    • /boot/vmodem/1.sh
    • /boot/vmodem/ppp.sh
  • Make sure they are executable:
sudo chmod 770 /boot/vmodem/vmodem.sh
sudo chmod 770 /boot/vmodem/1.sh
sudo chmod 770 /boot/vmodem/ppp.sh

Name of the serial port

The VModem script has been preconfigured to use ttyUSB0 as the default serial port name. Typically Raspbian will call its first serial port adapter ttyUSB0 when using USB to Serial converters, and you won't need to modify this script. However, if the name is something different, such as ttyAMA0, you may need to update the script to point to the correct serial port name. The following section described how to double-check your serial port name:

To confirm your serial port name, do the following:

  • Make sure the serial-to-USB adapter is connected.
  • Run the command: ls /dev/tty*

  • If you do not see /dev/ttyUSB0 listed, you will need to update the script with the correct serial port. Visit this page to update the script with the correct serial port.
  • If you do see /dev/ttyUSB0 listed, continue on!

Network test on the Raspberry Pi

This would be a good time to test your network to eliminate any future headaches.

Over SSH run the command:

ping www.google.com
  • Press Ctrl + Z to stop ping.

Initial VModem testing

To test VModem, you should be able to simply run the script. Test it first over SSH to see it's output:

  • If you have not done so already, connect one end of your serial cable to the Raspberry Pi's USB-to-serial adapter, and the other end of the serial cable to a computer which has a terminal software installed. You can use any terminal, such as PuTTY or the built-in HyperTerminal on Windows 9x.
  • Make sure you set the appropriate serial speed settings on the terminal program before you connect (by default VModem is set to operate at 57600 bps).
  • Connect with the terminal program to the Raspberry Pi.
  • Open up PuTTY (or your other SSH client of choice) and connect over SSH to the Raspberry Pi. Issue the following commands.
cd /boot/vmodem
sudo ./vmodem.sh
  • If you see the READY text on the screen, the script is ready to accept connections.
  • Now, go to your SERIAL terminal which should be hooked up to the Raspberry Pi's USB-to-serial adapter, and issue a few basic Hayes commands. Type “AT” and then press ENTER. You should receive an “OK” response.
    • If you do not receive an OK response, you may need to sync up the connection by pressing ENTER a couple of times. Then try “AT” again followed by ENTER.
    • If you still do not receive a response, something may be wrong with the serial settings, or with the connection to the Raspberry Pi.
    • Check to see that the vmodem.sh script is running and is receiving your keystrokes. If it working, it should echo your input from the serial terminal to the script's output.
  • On a serial terminal, this is the output you should be getting:

  • Over on the Raspberry Pi, you should be seeing the corresponding output:

Note about Wi-fi

If you wish to share a wireless connection on serial instead of a wired connection, you will need to edit the line “etherp=eth0” in vmodem.sh to “etherp=wlan0”.

Getting online

Now you can proceed to check out the system specific guides on how to interface different vintage computers and devices with VModem. Once you are done, return back to this guide!

Make sure vmodem.sh is running on the Raspberry Pi first before attempting connection!

Making Virtual Modem run at startup

After you have verified that the VModem works properly on the console, and you have tested that you are able to connect to your network, you can make VModem run automatically as a background process after the Raspberry Pi is powered on. It will run as a background process so you won't see it's output, so it's highly recommended to thoroughly test the script first.

  • Edit the /etc/rc.local file. Go to end of the file, and find the last line. It should be exit 0. Now add the following lines ABOVE it.
# Start serial port and simulate a modem
cd /boot/vmodem/
/boot/vmodem/vmodem.sh &

Beware the ampersand “&” at the end of the line. Without it, the boot process may not complete correctly (or at all).

  • Restart Raspberry and test the changes. After rebooting, VModem should automatically start up with system processes and start expecting connections on serial.

Further steps

You can now proceed to connect your retro machine to the Internet using Virtual modem.

Troubleshooting

After dialing in, system is disconnected immediately
Make sure you are using the latest version of the Virtual Modem script. An early version had an issue where the serial connection would be cut before the network connection was established. Also, be sure to make sure your serial baud settings are correct, and they match the virtual modem script. Finally, try turning off Flow Control from the Modem Settings under Advanced Settings.

After dialing in, system reports connected, but no network is available
Make sure you have updated the network device in vmodem.sh to reflect the correct network interface. By default it is eth0. If you are using Raspberry on WIFI, you may need to change this to wlan0.

Other issues:

  • Some computers are not capable of operating at fast serial speeds. If you're unable to connect at 57600 or faster, try slower speeds, such as 9600 baud at first. Adjust both the vmodem.sh script and the computer to connect at only 9600 baud. If that works, work your way up to see where the limit for your specific computer is.
  • If you run into any other issues, take a note of them and look for commonalities in any steps you've taken before this step. Open up the script vmodem.sh for editing to make sure the baud and serial port are properly set. If you're unable to figure it out, feel free to contact us at Discord. We have a channel specific for Virtual Modem support (see bottom of page).

Skip to previous sections

Chat With Us on Discord!


Get in touch with us on Discord, share your thoughts and report bugs.

guides/virtual_modem/section_4.1609113419.txt.gz · Last modified: 2020-12-27 23:56 by omolini