Some Useful Commands

Commands: These are some useful commands that can be keyed into the pistar command prompt.

Instructions: Use these command prompt commands carefully as they can introduce drastic changes to pistar.

There are many commands that can be given to pistar. The commands shown here are tested to work correctly. More commands will be placed on this page after they are tested to work correctly.
HTML Templates

Welcome to the Useful Commands Page



***************** Useful Commands: *****************


  Pistar defaults to the Read Only mode when it first starts.
  The pistar prompt will contain ro when pistar is in the
  Read Only mode. To change pistar to the Read Write mode
  Type the following command to the Linux Prompt.

rpi-rw   and press enter

  The prompt will change now and will contain rw in the prompt.


  The following command should be issued immediately after the
  first boot of the hotspot. This command will expand the file
  system of the SD card. NOTE: The expand command is not necessary if
  the pistar system is running pistar 4. The pistar 4 firmware executes
  the expand command automaticaly. The expand command is only required
  when the firmware is version 3.x.x
  Type the following command to the Linux Prompt.

sudo pistar-expand   and press Enter

  The pistar system will require a reboot after issuing the expand
  command.


  The following Update command should be issued soon after first boot
  of the hotspot. This command will download the packages available for
  certain installs to pistar. NOTE: There are several variants of the
  Update command. Each will be described separately.
  Type the following command at the Linux Prompt.

sudo apt-get update   and press Enter

  The pistar system will require a reboot after issuing the update
  command.


  Nextion Screen Code from Mitch EA7KDO and Jim KF6S,
  requires the Linux Utility BC. BC must be Installed in order for the
  Temperatures to display correctly. The Script being used to
  retreive and display the Temperatures depends on BC.

  Update must be executed prior to Installing BC. Update will
  retreive the libraries needed for BC to Install properly.
  Type the following into the Linux Prompt, and press Enter.

sudo pistar-update

  Update will require varying amounts of time depending on
  Which Rpi and how long since the last Update.


  Now Install BC. Type the following into the Linux Prompt
  and press Enter.

sudo apt-get install bc

  It can take a few moments for BC to install. Wait for
  the Linux Prompt to return.


  This command will turn Off HDMI. If you turn Off
  HDMI, the Raspberry pi will draw less current and
  therefore will run cooler.

  Simply type the following command at the Linux prompt
  and press enter to turn Off HDMI.

/opt/vc/bin/tvservice -o

  If you need to turn HDMI back on, then simply type
  the following command at the Linux promp and press
  Enter. The following command will turn On HDMI.

/opt/vc/bin/tvservice -p



  Changing or resetting ssh password if necessary.



  Changing or resetting Dashboard password if necessary.
  Enter the following command at the Linux Prompt and
  Press Enter.

sudo htpasswd -c /var/www/.htpasswd pi-star

  This is what the Linux Prompt will now look like.



  Now, Enter the New Password. As the new password
  is entered, it will not be echoed to the prompt.
  Linux will ask to Re-type new password. Re-type
  the new password and Press Enter. This is what
  will be seen at the Linux Prompt.



CONGRATULATIONS! The Dashboard password has
  been Changed.


  This command can be useful if the TGDROP is not working.
  This error can occur if the OUTBOUND Port is not open.
  The OUTBOUND Port in the Raspberry pi, Port 5040, should
  be open. Below is the command to check if the port is open.
  Type the following command at the Linux Prompt.

sudo iptables -S   and press Enter

  Below is what should be seen in the iptables file when
  the sudo iptables -S command is issued.

-A OUTPUT -p tcp --deport 5040 -j ACCEPT

  The above line in the iptables file indicates that port 5040
  is open for OUTPUT, not open for INPUT.

NOTICE:  The ssh Window must be scrolled back to reach
  the top of the OUTPUT section of the iptables file. The output
  rule (if present) will appear in the top three lines of the
  OUTPUT section.



  In event the Port is not open in iptables, you can issue the
  following command to manually enter the correct entry into
  the iptables file. Just key the below command to the prompt
  and press Enter on the keyboard.

sudo pistar-firewall   and press Enter



  The above command should add the entry to the iptables file.
  Now, check the iptables file and see if the Port 5040 is
  listed in the OUTPUT section. Use this command to see if
  OUTPUT rule was added>

sudo iptables -S

  If the output rule was not added, the following procedure
  will add the rule to the iptables file.

  Use the following procedure exactly to add the FW rule.

  You must do a git from the Nextion Display to get the
  latest Scripts from github and put them in the correct
  Directory.
  Next change directory into the /tmp directory and be sure
  the git placed the correct files into the directory.
  Use this:

cd /tmp

  Now, get a listing of the /tmp directory with ls.
  Issue the following command at the Linux Prompt.

ls