On Sun, 02 Apr 2017 23:36:43 +0100, T i m <
ne...@spaced.me.uk> wrote:
<snip>
>I think I'll start again, get back to as close as I can get and report
>back in case there are some specific things you would like me to
>check?
I did start again and I'm not sure what / if I did differently to the
first time(s) but this time it worked. I've tried to document (for
myself and maybe others) the key steps in the hope that it's still
pertinent the next time.
If you (Theo?) wouldn't mind running a quick eye over it in case I've
missed or added something that isn't correct.
-------------------------------
The object of the exercise was to create a very small, cheap and low
power wireless (only) print server using a Raspberry Pi Zero W.
https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/
In my case it was to be used to wirelessly share a Dymo LabelWriter
450 to mostly Windows clients.
Whilst I could have plugged the Pi into a HDMI monitor / TV and add a
USB keyboard and mouse, I wanted to do it 'headless'.
1) Get Raspbian image. I used Jessie Lite (v March 2017)
https://www.raspberrypi.org/downloads/raspbian/
2) Write image to uSD card. I used an 16G card and Win32DiskImager
under Windows.
https://sourceforge.net/projects/win32diskimager/
3) Because ssh is disabled by default (now), create an empty file
called 'ssh' (no quotes) on the uSD card Fat32 partition called
'boot'. I opened up Explorer, browsed to the boot partition and right
clicked there, New, > Text document, and call it ssh
4) Whilst on the boot partition, create another plain text file called
'wpa_supplicant.conf' and enter (I opened it with Notepad (Open with))
and save the following code:
network={
ssid="myssid"
psk="mypassword"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
(change myssid and mypassword to suit your own)
5) Put the uSD card in the Pi and power up (the uUSB connector nearest
the end is for power) and wait till the green LED stops flickering
(stays on solid).
6) Locate the Pi on the LAN. I use the free 'Advanced IP Scanner' on
Windows.
https://www.advanced-ip-scanner.com/
7) Connect to the Pi using an ssd client. Many use 'Putty' and I also
use MobaXterm Personal Edition.
http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
http://mobaxterm.mobatek.net/
The default login is 'pi' with the password 'raspberry'.
8) You should now be able to run raspi-config and change some stuff
from there:
sudo raspi-config
Then as a minimum use '7 Advanced options' then A1 'Expand Filesystem
I also
Change Hostname
Set Localisation
Update utility.
Exit raspi-config (escape) and reboot
sudo reboot
(I *think* you should also update Raspbian at this point with:
sudo apt-get update
sudo apt-get upgrade)
9) If you want to use a static ip address, edit /etc/dhcpcd.conf
sudo nano /etc/dhcpcd.conf
and add / edit:
interface wlan0
static ip_address=<ip address for pi>/24
static routers=<ip address for router>
static domain_name_servers=<probably ip address for router>
Ctrl+O > Enter, Ctrl+x.
10) To create the printer server part for the Dymo I needed to install
CUPS and some other bits to be able to provide the Dymo drivers.
sudo apt-get install libcups2-dev libcupsimage2-dev g++ cups
cups-client
(It's possible that if you didn't have to make the drivers you could
just install cups)?
For the Dymo stuff I did the following.
wget
http://download.dymo.com/Download%20Drivers/Linux/Download/dymo-cups-drivers-1.4.0.tar.gz
(Watch line wrap. Should be one string)
then (one cmd at a time)
tar xvf dymo-cups-drivers-1.4.0.tar.gz
cd dymo-cups-drivers-1.4.0.5/
sudo ./configure
sudo make
sudo make install
12) add user pi to lpadmin
sudo usermod -a -G lpadmin pi
13) To be able to access the CUPS server from a workstation on the LAN
you need to edit the Cups configuration file:
sudo nano /etc/cups/cupsd.conf
You then need to change add the following 4 bits:
# Only listen for connections from the local machine
# Listen localhost:631
Port 631
< Location / >
# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >
# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >
Ctrl+o Enter, Ctrl+x
restart the CUPS server:
sudo /etc/init.d/cups restart
13) You should then be able to access the CUPS admin remotely using a
web browser:
<ip address of pi>:631/admin
Username should still be 'pi' and password still 'raspberry' (unless
you have changed it previously).
Because I wanted to share the Dymo LabelWriter 450 I made sure that
was plugged into the other uUSB port (I ordered a short uUSB to Type B
usb lead from eBay). The printer then appears in the list and can be
added by just following the prompts.
Add Printer, select Dymo etc ... and make sure you check the Shared
option.
14) To share the printer to Windows machine I added SAMBA.
sudo apt-get install samba
Then edit the configuration file to resemble the following sections.
sudo nano /etc/samba/smb.conf
workgroup = WORKGROUP
(Change to your workgroup if you have one)
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no
I used the following sites for some of the info and other bits gleaned
from elsewhere.
https://www.hmazter.com/2013/05/raspberry-pi-printer-server-for-labelwriter
https://chicagodist.com/blogs/news/15272985-using-the-raspberry-pi-as-a-print-server-for-a-dymo-4xl-label-printer
-----------------------------------------------
I think I should be able to upload the drivers into the various
folders under /var/lib/samba/printers but I'm not sure where to get
them from?
Cheers, T i m