WiFi: HotSpot - DD-WRT Printer Sharing

From OnnoWiki
Jump to navigation Jump to search

DD-WRT Persiapan

  • Masuk ke Web DD-WRT
  • Services -> USB -> USB Support -> US Storage Support Disable
  • Administration -> Management -> JFFS2 Support -> Enable
  • Administration -> Management -> JFFS2 Clear -> Enable
  • Boot DD-WRT

Pastikan folder /jffs masih ada sisa space. Biasanya /jffs penuh, tidak ada sisa. Ini akan menyebabkan kita tidak bisa menginstalasi driver yang dibutuhkan.

WARNING: Orek-orekan ini masih gagal, karena /jffs penuh.


DD-WRT Konfigurasi di Shell

  • Login SSH ke DD-WRT
root@DD-WRT:~# ls -la /dev/usb/
crw-rw----    1 root     root     180,   0 Jan  1 00:00 lp0
root@DD-WRT:/jffs#  dmesg | grep usb
printer.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x03F0 pid 0x3E17
  • Jika keluar tampilan seperti di atas berarti printer telah terdeteksi.


Siapkan Printer Driver

Di Sisi Laptop

  • Download dari
http://downloads.openwrt.org/backports/rc6/p910nd_0.7-2_mipsel.ipk
http://downloads.openwrt.org/backports/rc5/p910nd_0.7-2_mipsel.ipk
  • Copy ke sebuah folder misalnya
cd ~
mkdir ~/printer-sharing
cp ~/Downloads/*ipk ~/printer-sharing


Di Sisi DD-WRT

  • Login ke DD-WRT
ipkg update
cd ~
scp odc@192.168.111.160:/home/odc/printer-sharing/* ~
ipkg -d root install p910nd_0.92-1_mipsel.ipk

DD-WRT Instalasi Driver

  • Login ke DD-WRT
ssh root@192.168.1.1
scp lina@192.168.111.184:/media/4FA5-4298/printer-sharing/p910nd_0.92-1_mipsel.ipk .
Host '192.168.111.184' is not in the trusted hosts file.
(fingerprint md5 21:0d:be:d7:a1:fe:7f:3f:e3:9f:96:68:29:49:f1:e3)
Do you want to continue connecting? (y/n) yes
lina@192.168.111.184's password: 
p910nd_0.92-1_mipsel.ipk                      100%   12KB  12.5KB/s   00:00 
ipkg -d root install p910nd_0.92-1_mipsel.ipk


Enable All USB options - set mount point to /opt
Since ipkg update seems broken, 
to a USB stick formatted with FAT32
Insert USB into router and reboot router
SSH to router
cd /opt
ipkg -d root install p910nd_0.7-2_mipsel.ipk


Run the following commands to install and start the printer daemon:

mkdir /dev/usb
mknod -m 660 /dev/usb/lp0 c 180 0
ipkg install p910nd
echo "/usr/sbin/p910nd  -b -f /dev/usb/lp0 0" > /mnt/etc/rc.p910nd
/bin/sh /mnt/etc/rc.p910nd
sleep 1


Harus instalasi driver untuk printer di DD-WRT

ipkg -force-depends install kmod-usb-printer

Edit /jffs/etc/config/usb.startup and add

insmod /jffs/lib/modules/2.4.30/printer.o

7. Look at the following files:

 /jffs/etc/default/p910nd
 /jffs/etc/init.d/p910nd

To do so, type: vi /jffs/etc/default/p910nd. vi is a text editor. You start in "command mode". Press 'a' to switch to editing mode, where you can edit the file. Press 'Esc' to get to command mode. Press :w[enter] to write (save) and :q[enter] to quit without saving, or :wq[enter] to save and quit.

At least on my version of v24, the third line in the startup script had the following line:

 DEFAULT=/etc/default/p910nd

this was invalid on my router (people more familiar with the router, please correct me here or explain the intricacies involved) and I had to edit this file and change the line to say:

 DEFAULT=/jffs/etc/default/p910nd

there are two commands that you can run to check if the server is running:

 root@my-ddwrt-router:/jffs/etc/init.d# netstat -an
 Active Internet connections (servers and established)
 Proto Recv-Q Send-Q Local Address           Foreign Address         State
 tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN
 tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
 root@ddwrt-se-office:/jffs/etc/init.d# ps | grep p9100d
 561 root        680 S   p9100d -b -f /dev/usb/lp0 0

If you see a 91xx port listening in netstat and you see the p9100d running in ps, your server is probably up and running properly. Check that the server is not running yet. If not, test starting the the server by issuing:

 /jffs/etc/init.d/p910nd

For v24_TNG (sp2) versions, the command should be:

 /jffs/etc/init.d/p910nd start

Di sisi Client

Asumsi Sistem Operasi Ubuntu. Yang perlu dilakukan adalah,

  • scan wireless
  • sambung ke access point linksys
  • system -> administration -> printing
klik New -> Select Device -> Network Printer -> AppSocket/HP JetDirect ->
            Host 192.168.0.1
            Port 9100


Referensi

Pranala Menarik