DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-03-02 14:24:19

mitch
New member
Registered: 2008-03-02
Posts: 2

HOWTO: GDI-Printers on DNS-323

Use the following at your own risk!!!

Some people here failed to get their GDI-printers to work with the DNS-323 as a print server.

Some explanation:
GDI-printers get part their operting system (i.e. firmware) uploaded by the hosts operating system. Either at the printer's or the Windows PC's starting time. Using the DNS-323 as a print server normally the printer doesn't get fed with it's firmware. That's what we need to change to make GDI-printers work.

1. Get the firmware from some place
You need to get the firmware file for your printer. Google is your best friend. For my Laserjet 1018 I found it here:
http://foo2zjs.rkkda.com/. The file is named sihp1018.dl for my printer. Copy it to /mnt/HD_a2/.

2. Change the hotplug scripts so it uploads the file to the printer once the printer starts.
Backup /etc/hotplug/usb.agent first.
Hotplug is a kernel-functionality that enables Linux to perform stuff when usb- (and other) devices get attached or detached from the system.
For the DNS-323 (using original firmware V1.04) the kernel calls the /sbin/hotplug script whenever a hotpluggable device is attached or detached. We need to make the kernel aware of our device. For USB-devices /sbin/hotplug calls the file /etc/hotplug/usb.agent. That's the file we need to change.
After the first few comments add the following to the file:

Code:

# start of printer-specific code
if [ "$PRODUCT" = "3f0/4117/100" ]; then
        if [ "$ACTION" = "add" ]; then
                echo HP Laserjet 1018 detected >> /mnt/HD_a2/hotplug.log
                sleep 10
                echo Uploading firmware assuming /dev/usblp0 >> /mnt/HD_a2/hotplug.log
                cat /mnt/HD_a2/sihp1018.dl > /dev/usblp0
                echo Firmware uploaded successfully >> /mnt/HD_a2/hotplug.log
        fi
fi
# end of printer specific-coce

What does it do? It checks the variable PRODUCT for a string that is specific to the HP Laserjet 1018. You need to change that string for your printer (google for USB product code <your printer>). Then it checks if the printer was attached (added) to the system (we don't want to upload the firmware when the printer is removed). Then it waits 10 seconds for the printer to fully start. Then we upload the firmware by writing it to the usb device (/dev/usblp0).

4. Create log file

Code:

touch /mnt/HD_a2/hotplug.log

3. Test.
Type

Code:

tail -f /mnt/HD_a2/hotplug.log

Restart your printer and wait until the console says "Firmware uploaded successfully".
Print something.

Hope it helps.

Offline

 

#2 2008-03-15 13:44:32

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

It was a real torture to get working my HP LaserJet 1000w without turning on the desktop. I've tried several print servers and I realized that this is a host based printer: it won't work without uploading firmware. And I've bought a DNS-323 and finally found this thread. Thank you for the solution! It took me at least 5 years to get working this printer outside the desktop PC... big_smile

HP LaserJet 1000w specific info: product ID is 3f0/517/120
HP firmwares for 1000, 1005, 1018, 1020: http://oleg.wl500g.info/hplj

Mod:

My problem is when you switch off the printer and DNS-323 too (i.e. power failure) and turn on again simultaneously, the firmware hasn't been fed to printer yet. Is there any way to upload the firmware before the first print job (i.e. using a flag to know that firmware has been uploaded)? It's not such a big problem, I'm happy to see my printer working with a print server... smile

Last edited by Rival (2008-03-15 16:53:50)

Offline

 

#3 2008-03-15 18:13:38

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

Rival wrote:

My problem is when you switch off the printer and DNS-323 too (i.e. power failure) and turn on again simultaneously, the firmware hasn't been fed to printer yet. Is there any way to upload the firmware before the first print job (i.e. using a flag to know that firmware has been uploaded)? It's not such a big problem, I'm happy to see my printer working with a print server... smile

It's not a nice solution, but I've put the line "cat /mnt/HD_a2/fun_plug.d/etc/sihp1000.dl > /dev/usblp0" to the end of fun_plug script, so my problem solved. It forces firmware upload after the dns-323 restarts. I don't use any other USB devices so it's a working solution to me...

Offline

 

#4 2008-03-15 18:23:59

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: HOWTO: GDI-Printers on DNS-323

Uhm. wierd. I have a HP Laserjet 1010, which perfectly fits by it's number in that line, but it does not need such workarounds.

Offline

 

#5 2008-03-15 18:42:38

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

oxygen wrote:

Uhm. wierd. I have a HP Laserjet 1010, which perfectly fits by it's number in that line, but it does not need such workarounds.

I think HP LJ 1010 is slightly "better" than 1000w. You have USB2.0 capability and 8MB of RAM. These are not in the same product line. 1000w has been discontinued long ago. I'm not sure but 1010 has it's own firmware, and the "host-based" term means that the driver rasterizes the data to print not the printer itself. I think host-based might also mean "firmwareless" in my case.

From somewhere on Internet: "A printer that has built-in support for Windows Graphical Device Interface (GDI). GDI is used by most Windows applications to display images on a monitor, so when printing from a Windows application to a GDI printer, there is no need to convert the output to another format such as PostScript or PCL.
GDI printers are sometimes called host-based printers because they rely on the host computer to rasterize pages."

So If I'm right there are dumb and dumber host-based printers. You have the smarter one... smile

Offline

 

#6 2008-03-21 14:30:34

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

I realised that after turning on the printer the DNS-323 doesn't want to go to standby mode. I checked the HDD usage, and found that the lpd daemon reads its .lpd directory on /mnt/HD_a4. I made some changes to usb.agent file so the lpd daemon starts and stops with turning the printer on and off. It looks like this:

-----

if [ "$PRODUCT" = "3f0/517/120" ]; then

   if [ "$ACTION" = "add" ]; then
      echo "Printer detected" >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      sleep 5
      echo "Uploading firmware assuming /dev/usblp0..." >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      cat /mnt/HD_a2/fun_plug.d/etc/sihp1000.dl > /dev/usblp0
      echo "Starting lpd..." >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      lpd
   fi

   if [ "$ACTION" = "remove" ]; then
      echo "Printer removed" >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      echo "Killing lpd..." >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      kill `pidof lpd`
   fi

fi

-----

The "3f0/517/120" is my HP 1000w product ID. I also had to add a line to fun_plug too:

-----

echo "* Killing lpd..." >>${LOGFILE}
kill `pidof lpd` >>${LOGFILE}

-----

After these modifications my DNS-323 spins down the HDDs after turning off the printer, so there is peace and silence at home... big_smile

Mod.: It's working fine connected to a 4 port USB HUB...

Last edited by Rival (2008-04-09 16:43:42)

Offline

 

#7 2008-03-21 16:43:59

blahsome
Member
Registered: 2008-03-02
Posts: 157

Re: HOWTO: GDI-Printers on DNS-323

Great work!

For my case, the printer prints fine without injecting GDI firmware, and I just want the unit to sleep properly. Let's assume I'm only connecting the printer to the USB port. I assume I can remove product identification and simplify the script to do the following?

   if [ "$ACTION" = "add" ]; then
      echo "USB Device (Printer?) detected" >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      sleep 5
      lpd
   fi

   if [ "$ACTION" = "remove" ]; then
      echo "USB Device (Printer?) removed" >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      echo "Killing lpd..." >>/mnt/HD_a2/fun_plug.d/log/hotplug.log
      kill `pidof lpd`
   fi

Will this work?

An alternative solution would be to create the .lpd on a USB key and bypass the hard disk for printing purposes all together. Of course that involves using a USB hub.

Offline

 

#8 2008-03-21 16:49:05

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: HOWTO: GDI-Printers on DNS-323

For me, a connected printer does not prevent that the unit goes to sleep mode.

Offline

 

#9 2008-03-21 17:42:47

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

blahsome wrote:

Will this work?

Yes, I think so. You simply just start lpd daemon when turning on the printer and kill when turning off (or unplug). If you would like this, it's fine. For me this must be the solution to the spin-down problem (I'm testing it).

Offline

 

#10 2008-03-21 17:45:57

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

oxygen wrote:

For me, a connected printer does not prevent that the unit goes to sleep mode.

I think it depends on the printer model, firmware and fun_plug version. Mine is v1.04b84, fun_plug v0.3 (modified, ctorrent client).

Offline

 

#11 2009-02-13 17:04:49

Joshua
New member
Registered: 2009-02-13
Posts: 2

Re: HOWTO: GDI-Printers on DNS-323

Unfortunately, I can't have my laserjet 1000 (connected to the DNS-323) work from XP : each time I try to print something, the document stays in the Windows printer queue with an "error" status...

Is there anything I can do on the DNS side to check what's wrong (logs, debug level...) ? (I've got firmware 1.05 + fun_plug)

May I, for instance, try to print something from the DNS-323 so that I would be sure everything is ok from the printer point of view ?

Thanks in advance !

Offline

 

#12 2009-02-13 18:02:09

Joshua
New member
Registered: 2009-02-13
Posts: 2

Re: HOWTO: GDI-Printers on DNS-323

Ok, I've just solved it ! (I notice one often finds the answer just after having asked the question...)

I simply disabled the "bidirectional mode" in the printer setup window...

I don't really understand why, but it works (better than "It does not work but I perfectly know why"...)

Nevertheless, thank you for everything else !!

Offline

 

#13 2009-02-17 09:36:44

phosphato
Member
Registered: 2009-01-10
Posts: 5

Re: HOWTO: GDI-Printers on DNS-323

Hello everyone:

Got a DNS-323 with 1.6 firmware and a HP 1018 printer.

   
I followed all the steps described here (at least that's what I think and I'm very new to Linux) but my printer doesn't work.

Can someone help me?

Thanks in advance.

Offline

 

#14 2009-05-25 03:23:08

hricardo
New member
Registered: 2009-05-25
Posts: 1

Re: HOWTO: GDI-Printers on DNS-323

Hello,

Just a reminder that's not easy to find the USB code for your printer around. However, there is a simple way to do that. If you already have your printer, include the following line on your usb.agent file (instead of suggested at beginning of this thread:

echo $PRODUCT >> /mnt/HD_a2/hotplug.log

Follow the touch part and then plug your printer. Do the tail and it sould show your USB printer ID. Change the code provided on the script with this one. And follow everything else here.

This may be the problem with phosphato, for instance.

Enjoy!

Last edited by hricardo (2009-05-25 03:50:29)

Offline

 

#15 2009-07-31 14:21:09

Rival
Member
From: Budapest
Registered: 2008-03-13
Posts: 53
Website

Re: HOWTO: GDI-Printers on DNS-323

For fun plug v0.5 you should edit /etc/hotplug/usb.agent file and insert the "if [ "$PRODUCT" = "xxx/xxx/xxx" ]..." lines to it's add) and remove) sections.

Last edited by Rival (2009-07-31 15:18:09)

Offline

 

#16 2010-04-11 23:57:13

Arvur
New member
Registered: 2010-04-11
Posts: 1

Re: HOWTO: GDI-Printers on DNS-323

How to make this work on NSA-220 with fun_plug 0.5?
There is no "/etc/hotplug/usb.agent" file and I can see no calls to it in hotplug script ((

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB