steptail.com

If I try to fail, but succeed, which one did I do?

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 packages.
  • Run the following commands to install pppd and iptables:
sudo -s
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!

  • If you would like to view the source code and more coding examples, click here
  • To download and install vmodem, execute the following commands:
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

Name of the serial port

The VModem script has been preconfigured to use ttyUSB0 as the default serial port name. Usually Raspbian will use this as its first serial port adapter name and the script will already be pointing to the correct name. But if Raspbian uses a different name, you may need to update the script to point to the correct serial port name.

To confirm your serial port name, do the following:

  • First double-check that the serial-to-USB adapter is properly connected. A serial cable does not need to be connected to the adapter.
  • To see if your serial port has been detected on Raspberry Pi, run the following 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

If you have not already, right now would be a good time to check that the network is still working correctly on the Raspberry Pi.

ping www.google.com

First Test of VModem

  • To fire up VModem, you should be able to simply run the script.
cd /boot/vmodem
sudo ./vmodem.sh
  • If you see the READY text on the screen, the script is ready to accept connections. You can use a client computer, for example Trumpet Winsock on Windows 3.1 or Windows 95 dial-up to connect to it.
  • To exit VModem and return you back to shell, you can press CTRL + z
  • If you get any error messages, 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 me (see bottom of page).

Getting online

Check out specific guides on how to interface different computers and devices with VModem:

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 are able to connect to the Internet, you can make VModem run automatically as a background process after the Raspberry Pi is powered on.

  • Run the following command:
sudo sh -c 'printf "`head -n -1 /etc/rc.local`\n\ncd /boot/vmodem\n./vmodem.sh &\n\nexit 0\n" >/etc/rc.local'
  • To restart the Raspberry and test the changes, issue the following command:
sudo shutdown -r now
  • After the Raspberry Pi boots, VModem should automatically start up with the system and start expecting connections on serial.

Skip to other sections

guides/virtual_modem/section_4.1550456275.txt.gz · Last modified: 2019-02-18 02:17 by omolini