steptail.com

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

User Tools

Site Tools


guides:virtual_modem:section_4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
guides:virtual_modem:section_4 [2019-02-18 02:29]
omolini [First Test of VModem]
guides:virtual_modem:section_4 [2023-11-24 23:16] (current)
omolini
Line 1: Line 1:
 ====== Section 4 - Setting up Virtual Modem ====== ====== Section 4 - Setting up Virtual Modem ======
 ==== Required packages ==== ==== 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.+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:   * Run the following commands to install pppd and iptables:
 <code bash> <code bash>
-sudo -s 
 sudo apt-get update sudo apt-get update
 sudo apt-get install ppp iptables sudo apt-get install ppp iptables
Line 12: Line 11:
 In the next chapter we will download and install vmodem onto your Raspberry linux box! 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, ​[[Guides:​Virtual Modem:​Script|click here]] +  * If you would like to optionally ​[[Guides:​Virtual Modem:​Script|view the source code and a few more coding examples, ​click here]] 
-  * To download and install vmodem, execute the following commands:+  * To just download and install vmodem, execute the following commands:
 <code bash> <code bash>
 sudo mkdir /​boot/​vmodem sudo mkdir /​boot/​vmodem
Line 25: Line 24:
     * **/​boot/​vmodem/​1.sh**     * **/​boot/​vmodem/​1.sh**
     * **/​boot/​vmodem/​ppp.sh**     * **/​boot/​vmodem/​ppp.sh**
 +
 +  * Make sure they are executable:
 +<code bash>
 +sudo chmod 770 /​boot/​vmodem/​vmodem.sh
 +sudo chmod 770 /​boot/​vmodem/​1.sh
 +sudo chmod 770 /​boot/​vmodem/​ppp.sh
 +</​code>​
  
 ==== Name of the serial port ==== ==== Name of the serial port ====
-The VModem script has been preconfigured to use **ttyUSB0** ​ as the default serial port name. Usually ​Raspbian will call its first serial port adapter **ttyUSB0** when using USB to Serial converters, and you will not 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:+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: To confirm your serial port name, do the following:
Line 34: Line 40:
   * Run the command: ''​**ls** /​dev/​tty*'' ​   * Run the command: ''​**ls** /​dev/​tty*'' ​
 {{ :​guides:​pics:​raspberry_serial_port_3.png |}} {{ :​guides:​pics:​raspberry_serial_port_3.png |}}
-    * If you **do not** see ''/​dev/​ttyUSB0''​ listed, you will need to update the script with the correct serial port. Visit [[Guides:​Virtual Modem:​Section 4:Changing the serial port|this page]] to update the script with the correct serial port. +    * If you **do not** see ''/​dev/​ttyUSB0''​ listed, you will need to update the script with the correct serial port. [[Guides:​Virtual Modem:​Section 4:Changing the serial port|Visit this page]] to update the script with the correct serial port. 
     * If you **do** see ''/​dev/​ttyUSB0''​ listed, continue on!     * If you **do** see ''/​dev/​ttyUSB0''​ listed, continue on!
 +
 +==== 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:
 +  - Run ''​sudo nano /​boot/​vmodem/​vmodem.sh''​
 +  - Find the line ''​etherp=eth0''​ and change it to read ''​etherp=wlan0''​.
 +  - Save file by pressing CTRL + o, then ENTER to save under the same name.
 +  - Exit editor with CTRL + x.
  
 ==== Network test on the Raspberry Pi ==== ==== Network test on the Raspberry Pi ====
 This would be a good time to test your network to eliminate any future headaches. This would be a good time to test your network to eliminate any future headaches.
  
-Over SSH run the command: +  * Over SSH run the command: ​''​ping ''''​www.google.com''​ 
-<code bash> +  * If you get ping replies, you are all set and the networking on your Raspberry Pi is working. 
-ping www.google.com +  * Press Ctrl Z to stop ping.  
-</​code>​ +==== Initial ​VModem ​testing ​==== 
-  * Press Ctrl and Z to stop ping.  +To test VModem, you should be able to simply run the script. Test it first over SSH to see it's output: 
-==== First Test of VModem ==== + 
-  ​* ​To fire up VModem, you should be able to simply run the script. ​+  * 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 [[https://​www.chiark.greenend.org.uk/​~sgtatham/​putty/​latest.html|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
 <code bash> <code bash>
 cd /​boot/​vmodem cd /​boot/​vmodem
Line 52: Line 68:
 </​code>​ </​code>​
  
-  * If you see the READY text on the screen, the script is ready to accept connections. +  * If you see the READY text on the Raspberry Pi, the script is ready to accept connections. 
-    Connect the one end of the serial cable to the Raspberry Pi's Serial-USB converterand the other end to an old computer ​with a serial ​portUse PuTTY, ​Trumpet Winsock (Windows 3.1) or Dial-up networking (Windows 95) to connect to the Raspberry Pi.  +  Nowopen up a SERIAL terminal, for example, PuTTY or HyperTerminal on the computer, and issue few basic Hayes commands.  
-  To exit VModem and return ​you back to shell, you can press **CTRL + z** +  * **If you are using HyperTerminal as your serial ​terminal** 
-  * If you get any error messagestake note of them and look for commonalities in any steps you've taken before ​this stepOpen 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 outfeel free to contact me (see bottom of page).+    * When you start HyperTerminal,​ hit cancel when it asks for the phone numberThis should take you directly to the serial console 
 +  * **If you are using PuTTY as your serial terminal** 
 +    * Under Connection typeselect Serial 
 +    * In Serial Line text box, type in COM1, COM2, or other COM port that you are using
 +    Under Speed, select the connection speed that you are using, by default VModem is set to 57600so you will match that speed. 
 +  * First press ENTER a couple of times to sync up. Then type "​AT"​ and then press ENTER. You should receive an "​OK"​ response.  
 +    ​If you receive a garbled or no response, the serial speed settings may be wrong. Make sure both computers are set to the same serial speed. 
 +    * If you do not receive ​any responsesomething may be wrong with the serial settings, or with the connection to the Raspberry Pi. Does the computer have fast 16550 UART and a good USB-to-Serial adapter? (check section 2 of this tutorial) 
 +    * 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. 
 +    * If you'​re ​still not able to get it working, see the Troubleshooting section below.  
 +  * On a serial terminal, this is the output you should be getting: 
 +{{ :​guides:​pics:​vmodem_hyperterm.png?​600 |}} 
 +  * Over on the Raspberry Pi, you should be seeing the corresponding output: 
 +{{ :​guides:​pics:​vmodem_putty2.png |}}
  
-===== Getting online ===== +----
-Check out specific guides on how to interface different computers and devices with VModem: +
- +
-  * [[Guides:​Connecting Windows 3.1 to the Internet]]  +
-  * [[Guides:​Connecting Windows 95/98 to the Internet]] COMING SOON +
-  * [[Guides:​Connecting a Digital VT100 compatible terminal to the Internet]] COMING SOON+
  
-Make sure vmodem.sh is running on the Raspberry Pi first before attempting connection!+Go ahead and continue to the next part of this guide, where we will go through using Virtual Modem!
  
-===== Making ​Virtual Modem run at startup ===== +| [[Guides:Virtual Modem:Section 3|<< ​3 - Setting up Raspbian]] | [[Guides:Virtual Modem:​Section 4|This Page]] | [[Guides:​Virtual Modem:​Section 5|5 Using Virtual Modem >>]] |
-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: +
- +
-<code bash> +
-sudo sh -c '​printf "`head -n -1 /​etc/​rc.local`\n\ncd /​boot/​vmodem\n./​vmodem.sh &​\n\nexit 0\n" >/​etc/​rc.local'​ +
-</code> +
-  * To restart the Raspberry and test the changes, issue the following command: +
-<code bash> +
-sudo shutdown ​-r now +
-</code> +
-  * After the Raspberry Pi boots, VModem should automatically start up with the system and start expecting connections on serial.+
  
 ==== Skip to other sections ==== ==== Skip to other sections ====
Line 84: Line 97:
   * [[Guides:​Virtual Modem:​Section 2|Section 2 - Shopping list]]   * [[Guides:​Virtual Modem:​Section 2|Section 2 - Shopping list]]
   * [[Guides:​Virtual Modem:​Section 3|Section 3 - Setting up Raspbian]]   * [[Guides:​Virtual Modem:​Section 3|Section 3 - Setting up Raspbian]]
-  * [[Guides:​Virtual Modem:​Section 4|Section 4 - Setting up Virtual Modem]] << You are on this page+  ​* **[[Guides:​Virtual Modem:​Section 4|Section 4 - Setting up Virtual Modem]] << You are here** 
 +  * [[Guides:​Virtual Modem:​Section 5|Section 5 - Using Virtual Modem]] 
   * [[Guides:​Connecting Windows 3.1 to the Internet]]   * [[Guides:​Connecting Windows 3.1 to the Internet]]
-  * [[Guides:​Connecting Windows ​95/98 to the Internet]] +  * [[Guides:​Connecting Windows ​9x to the Internet]] 
-  * [[Guides:​Connecting ​a Digital VT100 compatible terminal ​to the Internet]] +  * [[Guides:​Connecting ​Windows 2000 to the Internet]]
-  * [[Guides:​Virtual Modem:​Script|Source code and Coding Examples]]+
  
 ---- ----
  
-Questions? Comments? ​[[:Contact Information|Contact Me!]]+==== Get In Touch With Us! ==== 
 +Get support, share your thoughts and report bugs on Discord. \\ 
 +[[https://​discord.gg/​4w6CpZ8|{{:​images:​social-discord.png?​nolink|}}]]  
 + 
 +{{tag>​Guides Guides:​Networking}}
  
guides/virtual_modem/section_4.1550456987.txt.gz · Last modified: 2019-02-18 02:29 by omolini