Pi Setup Nov 2016

From OpenCircuits
Revision as of 07:52, 22 November 2016 by Russ hensel (talk | contribs) (→‎Arduino)
Jump to navigation Jump to search

Yet another setup for the Pi


Base OS

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

  • Raspbian
  • RASPBIAN JESSIE WITH PIXEL
  • Win32DiskImager utility
  • put on 16 gig micro card
  • boot
  • Before installing new application or service in Raspbian, make sure to
  • always type this into terminal: ( if this file is on your PI use cut and paste )

This takes awhile ( perhaps an hour? )

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Change Password

  • as shipped id is pi password is raspberry. default user is pi , and the password is raspberry
  • Change your password. When logged in as the pi user, you can change your password with the passwd command. Enter passwd on the command line and press Enter . You'll be prompted to enter your current password to authenticate, and then asked for a new password.
passwd


Preferences

Use the menu to change to a us keyboard or whatever preference you may have.. timezone?

  • WiFi Country code
  • Timezone
  • Keyboard

Set Up Remote Desktop

Base Install

  1. use this command to setup the pi => should work but did not see below
sudo apt-get install xrdp

but there seem to be problems on the pi 3 see

Summary ( and this worked for me )

remove the following packages : xrdp, vnc4server, tightvncserver ( may not be present, but no worry, just do it )

sudo apt-get remove xrdp vnc4server tightvncserver

install tightvncserver followed by xrdp

sudo apt-get install tightvncserver
sudo apt-get install xrdp

Need the IP Address

on the pi issue the command

ifconfig

and read the tcpip address of the pi( inet addr ) which you can then use, or better use a fixed address

fixed ip address

sudo leafpad /etc/dhcpcd.conf

Scroll all the way to the bottom of the file and add one, or both of the following snippets. Depending on whether you want to set a static IP address for a wired connection or a wireless connection eth0 = wired, wlan0 = wireless. You’ll need to edit the numbers in the snippet so they match your network configuration.

  • interface = This defines which network interface you are setting the configuration for.
  • static ip_address = This is the IP address that you want to set your device to. (Make sure you leave the /24 at the end)
  • static routers = This is the IP address of your gateway (probably the IP address or your router)
  • static domain_name_servers = This is the IP address of your DNS (probably the IP address of your router). You can add multiple IP addresses here separated with a single space.
  • my next Rasberry Pi 178/179
interface eth0

static ip_address=192.168.0.176/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

interface wlan0

static ip_address=192.168.0.200/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Spyder and More Python

>>> sudo apt-get install spyder

My Projects

This is the directory I use, can we do it from file manager? Yes so command below is optional.

sudo mkdir /home/pi/SpyderP


No module named pymysql

sudo pip install pymysql




ImportError: No module named pyperclip

sudo pip install pyperclip

The two above got the terminal running, even pyserial seems to have been included.


My Sql

Pi MySql


Share Net Drive

which samba	             

did not show samba but

sudo apt-get install samba

showed it was there -- not this time it did a big install ?? did it remove and install, the mysteries continue

>>> create mount point

sudo mkdir /mnt/share1

this gave read access

sudo mount -t  cifs -o guest  //192.168.0.170/share /mnt/share1

read write with this

sudo mount -t cifs -o username="russ",password="passwordhere",workgroup="MSHOME",file_mode=0777,dir_mode=0777,nobrl //192.168.0.170/share/_Source/rPi  /mnt/share1

Arduino Setup

  1. see the link below for more directions:
  2. http://tech.cyborg5.com/2013/05/30/irlib-tutorial-part-3d-installing-the-arduino-ide-on-a-raspberry-pi/
  1. use this for installation

sudo apt-get install arduino


Arduino

Use the menu based setup

where do the libr go

  • needed to download the zips, decompress
  • move, rename to remove ilegal char
  • include sensor.h in main program
  • install from zip did not work.





/usr/share/arduino/libraries

get from on the pc at

to do file management with sudo privilidge
sudo pcmanfm


Old