raspberry pi setup high voltage documentationidlab/taskandschedule/hvprojpage/raspberry pi... ·...

17
High Voltage Module Raspberry Pi Documentation Page 1 Raspberry Pi Setup High Voltage Documentation Instrumentation Development Lab Department of Physics and Astronomy University of Hawaii at Manoa AUTHOR: Cameron Asaoka DATE: 7/6/2017

Upload: others

Post on 25-Dec-2019

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 1

Raspberry Pi Setup

High Voltage Documentation Instrumentation Development Lab

Department of Physics and Astronomy

University of Hawaii at Manoa AUTHOR: Cameron Asaoka

DATE: 7/6/2017

Page 2: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 2

TABLE OF CONTENTS Page #

1.0 INTRODUCTION ............................................................................................ 3

2.0 BASIC SETUP ................................................................................................. 3

2.1 HARDWARE ................................................................................................................3

2.2 CHOOSING OPERATING SYSTEM (OS) .................................................................4

2.3 INTERNATIONALISATION .......................................................................................5

2.3.1 LOCALES.......................................................................................................5

2.3.2 TIMEZONE .....................................................................................................7

2.3.3 KEYBOARD OPTIONS .................................................................................7

2.4 INTERFACE OPTIONS ................................................................................................8

2.4.1 SSH (SECURE SHELL) .................................................................................8

2.4.2 SPI (TRANSFER PROTOCAL).....................................................................9

2.5 ADVANCED OPTIONS ...............................................................................................9

2.5.1 SETTING THE SCREEN RESOLUTION .....................................................9

2.6 REBOOT.........................................................................................................................9

2.6.1 UPDATING THE RASPBERRY Pi ..............................................................9

3.0 TAKING THE RPI TO THE INTERNET ..................................................... 9

3.1 LOOKING UP THE RASPBERRY PI IP .....................................................................9

3.2 PROBLEMS CONNECTING RPI TO THE INTERNET..........................................10

4.0 SETTING UP WIRING PI ............................................................................ 11

4.1 INSTALLING WIRING PI .........................................................................................11

4.2 GPIO PINS...................................................................................................................12

4.3 MODIFIED WIRING PI FOLDER .............................................................................13

4.4 REBUILDING WIRINGPI ..................................................................................... 14/15

5.0 UTILIZATION OF MOBAXTERM - OPTIONAL ................................... 16

5.1 INSTALLING MOBAXTERM ...................................................................................16

5.2 CONFIGURING WITH PI ..........................................................................................16

Page 3: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 3

1. Introduction This documentation includes the modified wiringPi library’s and headers and describes the

process of setting up a Raspberry Pi for utilization with a High Voltage Module. This is a

complimentary documentation to the already existing HV Module’s user manual which links

are provided below.

Link:

http://www.phys.hawaii.edu/~idlab/taskAndSchedule/HVprojPage/ManualHVupdat

ed.pdf

Should any problem arise in the software of the Raspberry Pi, this documentation shows the

procedures to reinstall all the proper files (including the Operating System (OS)) on the

Raspberry Pi and all the complete packages for correct operating of the HV Module.

When the software on the RPi needs to be rebuilt, then Re-installtion of the (OS) will require

the following.

1. External Keyboard

2. External Mouse

3. SD Card (>4gb)

4. External Monitor (W/HDMI input and/or adapter for VGA to HDMI conversion.

2. Basic Setup

2.1 Hardware In order to setup the RPi, It must have a list

of hardware and Cables:

1) Hardware

a) USB Keyboard and USB Mouse

b) Monitor

c) RPi Power Supply (5V MicroUsb

cable)

2) Cables

a) HDMI (for Monitor)

b) Ethernet Cable

Fig. 1 Raspberry Pi Initial Hardware setup

Page 4: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 4

2.2 Operating System (OS) Installation While there are many operating system’s that may be installed on the Raspberry Pi, the

Official Operating System for the Raspberry Pi and what I’ll be covering in this

documentation is for Raspian.

https://www.raspberrypi.org/downloads/raspbian/

Fig. 2 Raspian and the official download of Jessie Lite

Page 5: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 5

2.3 Internationalism

2.3.1 Locales After installing the hardware for the RPi it will take some time for the hardware to boot up.

First it will take us to a screen:

Fig. 3 Initial Bootup

This screen is basically the loading screen for the Raspberry Pi and usually gets to the

terminal in around 20-30 seconds.

Page 6: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 6

Fig. 4 Login Screen

Once it takes us to the login screen, next use the default login:

Username: pi

Password: raspberry

Warning: It’s a good idea to change the default raspberry Pi password as if left

unchecked will allow anyone in the world to connect and SSH into the RPi maliciously.

This login can be changed but for now just use the standard login and then run the

command,

‘sudo raspi-config’

Fig. 5 Raspberry Pi Configuration Tool

Page 7: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 7

Go to the “Localisation Options”. Choose “Change Locale” from the menu and change

from the default “en_GB.UTF-8 UTF-8” (Great Britain UK) to “en_US.UTF-8 UTF-8”

(USA).

Fig. 6 The Localization Menu

2.3.2 Time Zone

First go back to the Localization Menu and click the “Change Time zone” setting, it will

allow us to change which time zone the Raspberry Pi is using.

I’m currently using the Pacific Ocean time zone, but for others it may vary.

2.3.3 Keyboard Options

If hook up a brand new RPi, it will have the British Keyboard as the default keyboard in

Raspi-Config. This guide is not setup for the British Keyboard and it might be easier to

change the keyboard in the “Change Keyboard Layout” setting, to the standard US-English

Keyboard.

Page 8: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 8

2.4 Interface Options

2.4.1 SSH (Secure Shell)

When using the Raspberry Pi from another computer first we need to enable the SSH

configuration from our Raspberry Pi configuration.

Fig. 7 The Interface Tool (Raspberry Pi – Configuration)

To SSH into a Raspberry Pi on the local network first we’ll need to enable SSH by

clicking on the “P2 SSH” in the Menu.

For a specific tool to use to SSH into the Raspberry Pi, I would recommend MobaXterm,

which is a tool that allows us to SSH into multiple devices at once.

For more help in using MobaXterm I would recommend going to section 6.0 (Utilization

of MobaXterm).

Using any specific tool to SSH into another device, you will use the IP address you found

using the “ifconfig” command and use on the command line “[email protected]” , x

being your specific IP address.

Page 9: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 9

2.4.2 SPI (Transfer Protocal)

You also will need to enable SPI in the same Raspberry Pi configuration Tool. This will

allow you to use SPI from the Raspberry Pi’s program’s.

2.5 Advanced Options

2.5.1 Setting the Screen Resolution

To set the screen resolution to your specific monitor, in case the edges of the OS is outside

the range of your monitor, you will need to change the default resolution on the Raspberry Pi.

Going back to the Raspberry Pi Configuration tool, simply click on the change resolution

option and it will give you a list of the different resolutions that your Pi can handle.

2.6 Reboot and Configuration is Finished

2.6.1 Updating Your Raspberry Pi

Once you finished all your configurations, you can simply exit the configuration tool and

reboot your Pi. Once the reboot finishes you will then want to update your Pi to the latest

versions of the OS. If you are unable to connect your Pi to the internet, look at Section 3

(Taking your Raspberry pi to the Internet) and come back to this section. Your Raspberry Pi

has an abundance of programs and functions built into it, and from time to time, there may be

a newer version of the software on the programmer’s website or Github. To update your

Raspberry Pi to the latest version, simply write in the command line, “sudo apt-get update”.

When that finishes run the command, “sudo apt-get upgrade”. This in tandem will update

your Pi to the latest version.

3.0 Taking your Raspberry Pi to the Internet

3.1 Looking up your Raspberry Pi’s IP Address Your Raspberry Pi is by default set to DHCP or Dynamic Host Configuration Protocal. Thus

your IP could change based on location. The easiest way to check your IP address is to use

the command line and type “ifconfig” and click “enter”.

This will show you “inet addr: 192.168.153.63”

Page 10: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 10

Fig. 8 Showing the current IP configuration

3.2 PROBLEMS CONNECTING YOUR PI TO THE INTERNET

If your Pi isn’t connected to the Internet and/or you do not receive a IP address from the

DHCP server, you may have a faulty cable/Modem.

To check if your Raspberry Pi is connected to the internet simply write on the command line

: “ping google.com”, this will show the bytes it’s receiving from the internet.

Fig. 9 showing the bytes receiving from google.com

Page 11: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 11

Usually there should be no problem connecting your Raspberry Pi to the internet as it’s a

relatively simply device, but in case you receive more problems, you might try checking the

manufacturing specs and with your internet provider.

4.0 SETTING UP WIRING PI

4.1 INSTALLING WIRING PI

http://wiringpi.com/download-and-install/

Fig. 10 Webpage of WiringPi

Page 12: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 12

Check to see if you already installed wiringPi by using the command

“gpio –v”

Fig. 11 checking for GPIO pin access

If you get a response to that command, then STOP. You already installed wiringPi and do not

need to install it again.

If instead you are trying to reinstall it or installing it for the first time then please continue.

To uninstall wiringPi use the command:

“Sudo apt-get purge wiringPi”

“hash –r”

This will uninstall wiringPi.

Now install ‘GIT’

“sudo apt-get install git-core”

Now to install wiringPi using GIT run this command:

“cd”

“git clone git://git.drogon.net/wiringPi”

Then build it…

“cd ~/wiringPi”

“./build”

Page 13: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 13

4.2 GPIO PINS

To test if you correctly installed wiringPi simply run the command, “gpio –v”. Then run “gpio readall”.

This should give you a list of all the pins and their digital values at any given point.

Fig. 12 Showing the complete digital readout of all the GPIO pins

4.3 MODIFIED WIRING PI FOLDER

http://www.phys.hawaii.edu/~idlab/taskAndSchedule/HVprojPage/Files/NIM_HV.zip

At this point you will need to have downloaded the ‘NIM_HV’ zip file from the IDLAB website (Link

above). This contains a installation of Jessie Lite for the Raspberry Pi and the modified WiringPi folder

needed to run the HV_NIM program.

Simply delete the wiringPi folder in your home folder of your Pi and then drop and drop the new

modified wiringPi folder into the same directory.

Page 14: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 14

Fig. 13 Modified WiringPi folder

4.4 REBUILDING WIRINGPI

Now you have to rebuild wiringPi with the new wiringPi folder. You want to ‘cd’ into the folder and you

may get a permissions and/or unable to find command error. This is normal and to make the build file

executable you need to run the command in the same directory “cdmod a+x a.out” as this will give the

permissions to make a.out executable.

Fig. 14 rebuilding wiringPi folder

Page 15: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 15

Now run the command “sudo ./a.out” and it should run.

Fig. 15 HV_NIM_mod code running correctly

Note: Should an error such as below result :

pi@raspberrypi:~/NIM_HV $ sudo ./a.out

Initializing SPI...

gpio: Unable to open GPIO direction interface for pin 4: No such file or directory

wiringPiISR: unable to open /sys/class/gpio/gpio4/value: No such file or directory

Simply, run “sudo raspi-config”, go to the Interface Options and scroll down to 1-wire; It may

have been enabled when turning on the other Interface options, simply disable it and reboot the

Raspberry Pi and you should be up and running.

Page 16: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 16

5.0 UTILIZATION OF MOBAXTERM

Fig. 16 Website for MobaXterm

5.1 INSTALLING MOBAXTERM

http://mobaxterm.mobatek.net/

MobaXterm is a great program to use for ssh-ing into multiple devices and how powerful

programs build into it such as the solaris server, 3D analysis, MobaTextEditor, and supports

many different transfer protocols, such as SSH,Telnet Rsh, Xdmcp, RDP, NVC, FPT, SFTP,

serial, File, Shell, Browser, and Mosh.

To install mobaXterm we will go to the website (Link above), and click on the Get MobaXterm

Now button.

5.2 CONFIGURING WITH PI

After installing MobaXterm ensure your device is connected to the same network as your

computer and use the command on MobaXterm, “[email protected]” , based on what your

actual IP address is. This will add a session key and allow you to SSH into your Pi.

Page 17: Raspberry Pi Setup High Voltage Documentationidlab/taskAndSchedule/HVprojPage/Raspberry Pi... · High Voltage Module Raspberry Pi Documentation Page 8 2.4 Interface Options 2.4.1

High Voltage Module Raspberry Pi Documentation Page 17

Now were finished, and can start using the HV Module.

Fig. 17 Our up and running Raspberry Pi