Russ's Pi Recipie

From OpenCircuits
Jump to navigation Jump to search

This is a list, for russ, by russ for setting up a raspery pi. You may use it or make your own.

Newer ??[edit]

Pi Setup Nov 2016 Pi Setup Dec 2017 Stretch

Pi Setup Python 3 MySql

Initial Log On[edit]

User management in Raspbian is done on the command line. The default user is pi, and the password is raspberry. You can add users and change each user's password.


Bring Your System Up to Date[edit]

Before installing new application or service in Raspbian, make sure to always type this into terminal:

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

Set Up Remote Desktop[edit]

  1. use this command to setup the pi
sudo apt-get install xrdp

  1. on the windows machine go to router admin and get tcpip address of the pi or
  2. on the pi issue the command
  1. and read the tcpip address of the pi( inet addr )

on the windows machine run "Remote Desktop Connection" in it enter the pi address and the user name ( default pi ) click connect, if you need a password the default is raspberry.

  1. you should now be able to use your windows machine as the keyboard, mouse, and
  2. screen.
  3. if this step does not work try a reboot of the pi and try again, if that does not work
  4. try googling, it is beyond me.

I have been having some issues around which session ( there can be many ) rdp connects to. I have not solved it yet but the most useful ref so far is

Power Icons[edit]

make these icons by copying over to desktop and then editing. A few more details here would be nice.

sudo pcmanfm   -- runs the file manager so it can change permissions on the shared drive
sudo leafpad   -- runs the editor and can save to protected places


Static IP[edit]

Pi Setup: Static IP this may be a newer way

my table of addresses D:\Russ\0000\Farm\FarmNet.ods my first pi

look at current config

cat /etc/network/interfaces

look for dchp



record inet addr – (Pi's Current IP Address) = address

Bcast – (The Broadcast IP Range) = broad cast

Mask – (Subnet Mask Address) = netmask

in file format address netmask broadcast

>>> netstat -nr

record: ( or fix area below )

'Gateway' Address – = gateway 'Destination' Address – = network

gateway network

>>> use one of the following

sudo nano /etc/network/interfaces
sudo leafpad /etc/network/interfaces

> comment out with #

iface eth0 inet dhcp

> add

iface eth0 inet static    # new for static ip

> save

>>> release address

sudo rm /var/lib/dhcp/*

Then we'll need to reboot and check your changes. . .

sudo reboot

Log back in and run ( just to check config )


Arduino Setup[edit]

  1. see the link below for more directions:
  1. use this for installation
sudo apt-get install arduino

Access Network Drive[edit]

command line share[edit]

use your router info to get tcpip address of the share device -- might work with name but not for me do we need samba for this?

which samba

did not whow samba but apt-get install samba showed it was there

  • create mount point
mkdir /mnt/share1

>>> # works from command line but get read only access sudo mount -t cifs -o guest // /mnt/share1

>>> seems also to work can I write? no read only sudo mount -t cifs -o username=russ,password=squeak13 // /mnt/share1

>>> share less


sudo mount -t cifs -o username=russ,password=squeak13 // /mnt/share1

>>> another thing to try this worked for read write, see

sudo mount -t cifs -o username="russ",password="squeak13",workgroup="MSHOME",file_mode=0777,dir_mode=0777,nobrl //  /mnt/share1

But there is a graphical tool available which can browse shares and even mount them: smb4k apt get cannot find

I:\_Source\rPi and this for fstab

// /mnt/share1 cifs user=russ,pass=squeak13,_netdev 0,0

// /mnt/share1 cifs user=russ,pass=squeak13,_netdev 0,0

    sec=ntlmm instead of guest seemed to work

more recently above fails but using

sudo rpi-update
sudo reboot

makes it work see:

// /mountpoint cifs sec=ntlm,noauto,x-systemd.automount 0 0

except that file manager cannot see the directories or files there but can be coaxed to see them if you put in the sub dir like /mnt/share1/_Global this is real odd

then look in dir /rPi copy over this win_to_pi_info.txt so have reference there

when share works copy over to /pi so you can refer to it without a share ( or put on web? )

command line for this would be ( need sudo? )

using fstab[edit]

  1. using fstab this will let you auto mount

for nano ctrl O writes a file

sudo leafpad /etc/fstab
sudo nano    /etc/fstab            

note that fstab may be hidden file >> // /mnt/share1 cifs user=russ,pass=<password_in_quotes??>,_netdev 0,0


this looks good for stab


 # For Guest Login
     //WindowsPC/Share1 /mnt/mountfoldername cifs guest 0 0

For Password Protected Login //WindowsPC/Share1 /mnt/mountfoldername cifs username=yourusername,password=yourpassword 0 0

// /mnt/share1 cifs user=russ,pass=squeak13,_netdev 0,0

Auto Python[edit]

How To Autostart Apps In Rasbian LXDE Desktop
sudo leafpad /etc/xdg/lxsession/LXDE-pi/autostart
rh: this was found but not the same as the other file note the - pi ??


my line for auto
@python  /home/pi/
@python  /home/pi/

ls  /home/pi/


..... and more 

method 2
sudo leafpad ~/.config/lxsession/LXDE/autostart
rh: file was empty or not found 
..... and more 

You can auto-launch your own Python scripts by adding the line :

@/usr/bin/python /home/pi/

sudo leafpad /etc/rc.local

and add at end

python /home/pi/ &

Shortcut icons and Menu Maintenance[edit]

Shortcut Icons[edit]

Create a new text file called yourname.desktop in the /home/pi/Desktop/ directory, e.g. /home/pi/Desktop/yourname.desktop As far as I can tell the name yourname has no particular meaning.

leafpad  /home/pi/Desktop/pi.desktop

leafpad  /home/pi/Desktop/pi2.desktop

It should contain the following: ( one shortcut per file, do not repeat [Desktop Entry] )

[Desktop Entry]
Name=My Name
Comment=My application which does this

All the new icons are here if you need access to them for your own documentation or apps… /usr/share/icons/PiX


how i ran my python smarttermainal

[Desktop Entry]
Comment=My application which does this
Exec=python /home/pi/SpyderP/SmartTerminal/


An editor perhaps:

[laurent@localhost applications]$ cat ~/.local/share/applications/hardinfo.desktop

[Desktop Entry]
Name=Hardware info
Name[en_US]=Hardware info
Comment[en_US]=Hardware info

leafpad /etc/xdg/menus/ It’an XML file that contains a bunch of <Menu> tags describing the menu layout. On my Fedora box, the “Accessories” section is described like this:


fix it maybe: rdp[edit]

The problem:

connecting to sesman ip port 3350
sesman connect ok
sending login info to sesman
login successful for display 10
started connecting
connecting to 5910
error - problem connecting

IF this is the same issue you are having I fixed it thusly...


sudo apt-get install tightvncserver

Other RDP Issues[edit]

Does not always connect back to the same session....... seems to be based on using different ports on different connects Google offers hints to things that may help

these files may exist and be in use

  • sudo leafpad /etc/xrdp/xrdp.ini
  • sudo leafpad /etc/xrdp/sesman.ini