Table of Contents

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. Also xxd is used to decode raw bytes from the input stream. xxd should be preinstalled on Raspbian, but I'm including it in the installation list here just in case.

sudo apt-get update
sudo apt-get install ppp iptables xxd

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

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:

Name of the ethernet interface

For the sake of this tutorial we have used wired Ethernet. If you want to use Virtual Modem over a wireless connection, you will need to make sure it is properly set up, then update the script where it says etherp=eth0 to say etherp=wlan0 instead. To change the ethernet port in the vmodem.sh script, do the following:

  1. Run sudo nano /boot/vmodem/vmodem.sh
  2. Find the line etherp=eth0 and change it to read etherp=wlan0.
  3. Save file by pressing CTRL + o, then ENTER to save under the same name.
  4. Exit editor with CTRL + x.

Network test on the Raspberry Pi

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

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:

cd /boot/vmodem
sudo ./vmodem.sh


Go ahead and continue to the next part of this guide, where we will go through using Virtual Modem!

Skip to other sections


Get In Touch With Us!

Get support, share your thoughts and report bugs on Discord.