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
Next revision Both sides next revision
guides:virtual_modem:section_4 [2019-12-11 16:37]
omolini [Initial VModem testing]
guides:virtual_modem:section_4 [2020-02-14 17:49]
omolini [Download VModem and adjust settings]
Line 25: Line 25:
     * **/​boot/​vmodem/​ppp.sh**     * **/​boot/​vmodem/​ppp.sh**
  
 +  * Make sure they are executable:
 +    * chmod 770 /​boot/​vmodem/​vmodem.sh
 +    * chmod 770 /​boot/​vmodem/​1.sh
 +    * chmod 770 /​boot/​vmodem/​ppp.sh
 ==== 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. 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: 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:
Line 50: Line 54:
   * 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).    * 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.   * Connect with the terminal program to the Raspberry Pi.
-  * Over SSH, on the Raspberry, issue the following commands. ​+  * 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 58: Line 62:
   * If you see the READY text on the screen, the script is ready to accept connections.   * If you see the READY text on the screen, the script is ready to accept connections.
   * To exit VModem and return you back to shell, you can press **CTRL + z**   * To exit VModem and return you back to shell, you can press **CTRL + z**
-  * The script emulates a few basic Hayes commands, so you should be able to issue the AT command on the terminal. Type "​AT"​ and then press ENTER. You should receive an "​OK"​ response. If you do not, you may need to press sync up the connection by pressing ENTER a couple of times. ​+  * The script emulates a few basic Hayes commands, so you should be able to issue the AT command on the terminal. Type "​AT"​ and then press ENTER. You should receive an "​OK"​ response. If you do not, you may need to sync up the connection by pressing ENTER a couple of times. If you still do not receive a response, something may be wrong with the serial settings, or with the connection to the Raspberry Pi. Also check to see that the vmodem.sh script is running. If it is, it should echo your input on the serial terminal to the script'​s output.
   * On a serial terminal, this is the output you should be getting:   * On a serial terminal, this is the output you should be getting:
 {{ :​guides:​pics:​vmodem_hyperterm.png?​600 |}} {{ :​guides:​pics:​vmodem_hyperterm.png?​600 |}}
Line 76: Line 80:
  
 ===== Making Virtual Modem run at startup ===== ===== Making Virtual Modem run at startup =====
-After you **have verified** that the VModem works properly on the console ​(see previous section), 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.+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.
  
-There are two ways you can do this: +  ​Edit the /​etc/​rc.local ​file. Make sure your /​etc/​rc.local has the following at the bottom:
- +
-**1)** You can either run the following command which will automatically add VModem to your /​etc/​rc.local+
-<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>​ +
- +
-**2)** Or you can edit your rc.local manually. Make sure your /​etc/​rc.local has the following at the bottom:+
 <code bash> <code bash>
 # Start serial port and simulate a modem # Start serial port and simulate a modem
Line 91: Line 88:
 /​boot/​vmodem/​vmodem.sh & /​boot/​vmodem/​vmodem.sh &
 exit 0 exit 0
 +</​code>​
 +
 +  * You can alternatively run the following command on the Raspberry Pi shell which will do the appropriate changes for you:
 +<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>​ </​code>​
  
guides/virtual_modem/section_4.txt · Last modified: 2023-11-24 23:16 by omolini