Wednesday, 7 November 2012

GDI USB Printer on DD-WRT v24-SP2 (Laserjet 1018 on TP-Link TL-WR1043ND)

At home, I happen to use a TP-Link TL-WR1043ND router (with an external ADSL2 modem) and a cheap HP Laserjet 1018 laser printer. The printer is a GDI (meaning it has no PCL or Postscript support, relying on Windows to draw text and graphics), USB only device. The router has a handy USB port: with DD-WRT installed (v24SP2) it is possibile to activate a handy network printer server function even with such a brain dead printer. Here's how - this works with this particular version of DD-WRT, with others it will most certainly need modifications. I couldn't find the exact procedure online, so I am reporting it here, collected and amended from various sources. With other similar printers, like the Laserjet 1020 it's probably only necessary to change the firmware file.

On Windows, enter the printer properties and create a new tcp/ip port using custom settings: the port address must be the router ip address, the protocol must be RAW, the port 9100. Windows won't detect the port by itself, at least in my case

1 - Enter the web interface. Under Services/USB activate every USB option

With a normal printer and this DD-WRT version, this would be all that it's needed. But in the case of this GDI printer the effect is that print jobs are read from the router with no error, but the printer prints nothing. There is a small firmware file to be sent to the printer every time it's switched on and connected to the router, for this the firmware file must be kept on the router and a small script must send it every time the printer is recognized by the USB controller.

2 - Under Administration, activate JFFS2
3 - Enter the command line interface with telnet of SSH
4 - Enter cd /jffs to change directory to a persistent folder
5 - Enter wget http://oleg.wl500g.info/hplj/sihp1018.dl

The wget command downloads the 1018 firmware from a know location. With other similar printers one must of course change the URL: of course it's always possibile to download the file to a USB pen drive, mount it on the router and copy to /jffs (other locations in the filesystem are in ram and won't survive a power off

6 - Under commands enter this script

PRINTEROFF="<6>usblp0: removed"

#time to watch for printer state
WATCHTIME=5

FIRMWARE="/jffs/sihp1018.dl"

LASTPRINTER=" "

while true; do
sleep $WATCHTIME
LAST=`dmesg |grep "<6>usblp0" | tail -n -1`
if [ "$LAST" != "$PRINTEROFF" ];then
        if [ "$LAST" != "$LASTPRINTER" ]; then
                LASTPRINTER=$LAST
                #echo flashing the printer
                cat $FIRMWARE > /dev/lp0
        fi
fi
done 

and click on the SAVE STARTUP button. The script is added to the init chain. Note that hotplug script do not seem to work with printers on this DD-WRT version, so a polling cycle like the one above is needed. The script has been adapted from the DD-WRT forum: on my system the printer is on /dev/lp0 not /dev/usb/lp0. The PRINTEROFF and grep arguments are based on the output of the dmesg command. Your mileage may vary: check the dmesg output using dmesg at the command line, and filtering with grep. If the procedure is correct every time the printer is connected the firmware will be sent within 5 seconds. The printer orange led will light up, and the engine will start briefly, like when attaching the device directly to a windows PC via usb.



EDIT 14/2/2016: I still have the TL-WR1043ND and the HP 1018, I've upgrade to DD-WRT v24-sp2 (12/22/14) std - build 25697, and .. JFFS is gone, that is there is no more space in newer builds for a real JFFS partition. Furthermore, the dmesg output has changed, so the script above no longer works. Here's a partial solution. The script below must still be copied in Commands/Startup as before, and one won't wget the printer's firmware to /jffs because the mount point is now empty and not writable. What the script will do is parse correctly the dmesg output to check for the printer switching on and off and then trying to upload the firmware file from /tmp (which is in volatile ram disk). If it doesn't find it it tries to wget from the URL mentioned above, which still works.Of course it won't work without net access, it possibly won't work the first time/times the router is booted, it would probably better to use one's web server to wget the firmware et cetera. But in any case if the router will stay on for long periods of time it should be acceptable. One can always load sihp1018.dl in /tmp with scp or something like that of course.



#time to watch for printer state
WATCHTIME=5

FIRMWARE="/tmp/sihp1018.dl"

LASTPRINTER=" "

while true; do
sleep $WATCHTIME
LAST=`dmesg |grep "^<6>.*\(usblp0.*\)" | tail -n -1`
if [ "$LAST" != *"removed" ];then

           
        if [ "$LAST" != "$LASTPRINTER" ]; then
                LASTPRINTER=$LAST
                #echo flashing the printer
                if [ ! -f "$FIRMWARE" ]
                then
                    cd /tmp
                    wget http://oleg.wl500g.info/hplj/sihp1018.dl
                fi
               
                cat $FIRMWARE > /dev/lp0
        fi
fi
done 

Saturday, 3 November 2012

Zerozeroseptium

PC Professionale di Novembre 2012, pag. 123

"Allora la riduzione delle dimensioni fu tale da poter integrare sempre più elementi all'interno di uno spazio ridotto, in modo da creare processori sempre più potenti e permettere a Roger Moore di formulare la sua famosissima legge"

Technotrend S2-3200 unexplainable reception problems?

The other day I was about to watch the new german Rommel TV-Movie on ARD, Germany's first public tv channel. I wanted to use my rather old DVB-S2 PCI card, a Technotrend S2-3200, with DVBViewer, but most channels were showing a lot of pixelation and cracky audio. Some more than others: it looked just like the quality of the signal from my dish had suddenly dropped. Dish orientation was ok (it never needed to reposition it since it was installed in 1994). I checked the cable connectors, recutting the stub: no result. I tried with another stand alone receiver connecting to the same cable drop: perfect picture, the signal quality bar well above 75%.
Going back to the S2-3200, I tried upgrading DVBViewer Pro, tried upgrading the MPEG/H.264 codecs. No result.  Tried even a couple of other DVB softwares. No result.
Eventually I watched 'Rommel' with the stand alone receiver: I thought that the analog stage in the S2-3200 had developed some problems, and started looking for a replacement on the net.
Then I rememembered that a few days earlier I had changed the DDR speed in the BIOS to check for a possible compatibility problems. I rebooted and set it to 'Auto': perfect picture again on the S2-3200.
The funny thing is not the necessity of using the 'Auto' setting, it's that it just looked like a low quality signal problem, visually. If somebody is experiencing the same problem and is looking for an answer googling, I hope this post will be of some help.
Oh, and the (rather good) Rommel movie looks just like a (albeit partial) rip off of 'The Trail of the Fox' by David Irving. The influence of that book on the screenplay is rather obvious.

Saturday, 20 October 2012

Using Rocksmith USB Cable with ASIO


On Octobert 18th, I received with perfect timing from Amazon.it my copy of Rocksmith just released for Windows. I haven't really played videogames for years and years, with the exception of FSX and Xplane, which of course are not really videogames, but something a bit more adult - like a rhythm game playable with a real guitar or bass, indeed. Now, I'll have to stick to the demo for a few days, because the folks at Ubisoft seem to have cocked up on a colossal scale: it looks like if most if not all the activation codes in the physical boxes are missing for the PC version. On amazon.it the release date has been pushed forward to November 29th! Hope to get the new code soon, but Ubisoft doesn't seem to pay extra time to his customer care staff on the weekend following the release..

But I digress: in the Rocksmith box there's of course the 6.3mm jack to usb guitar cable. It's actually a one input audio interface of seemingly decent quality, made by Hercules. The device is recognized as a WDM device in Windows: for example, you can record your guitar from Audigy with no particular configuration.

For more serious guitar software, like Guitar Rig, you would need ASIO driver, but none are included. As a matter of fact you would need different hardware with ASIO, since this kind of driver requires at least one input and one output to be functional, at least in a real time situation. Well, there's the well-known ASIO4ALL universal driver coming to the rescue. Download and install ASIO4ALL, if you don't have it already: then configure it this way from the configuration panel from the advanced options:

It's just a matter of selecting the Rocksmith cable as input and one of your (free) audio outputs as the output for ASIO. If the device you need is busy, try exiting audio software and/or deselecting the output as the default device in the Windows control panel.

This way, I'll be able to play some real guitar with Guitar Rig, waiting for the code to play a guitar game... :-/


Thursday, 23 August 2012

Cartolina da Napoli


Domenica scorsa alla libreria Feltrinelli della Stazione Centrale di Napoli. "Not only for strangers". Che strana città (ci saranno cartelli simili nelle altre Feltrinelli italiane? I do not know, ma it's sure in tone con quella strange city).

Friday, 15 June 2012

Lettera aperta alla Merkel e ai tedeschi..

Oggi su MF e Handelsblatt appare una lettera aperta di 'Italia c'è' indirizzata alla Merkel e ai tedeschi.. Mi hanno chiesto di tradurla, e senza nessuna pretesa di esattezza o altro, ecco il risultato:


Pregiatissima Sig.ra Cancelliere Merkel,
cari cittadini della Germania

La Germania e l'Italia sono due paesi che con due dittature nel secolo scorso hanno provocato la più grande tragedia che l'Europa (e non solo l'Europa) ha vissuto nella sua storia millenaria. La Germania e l'Italia dovrebbero perciò mostrare il più grande senso di responsabilità ed agire in modo da impedire l'inizio di un'altra tragedia, che può essere di natura puramente economica, ma ha la possibilità di essere comunque mortale.

Non è un caso che dopo la IIGM   i capi di stato di entrambi i nostri Paesi, Konrad Adenauer e Alcide de Gasperi furono in prima linea per accelerare col trattato di fondazione della Comunità Europea, l'unificazione dell'Europa per il benessere e l'unità di tutti i popoli del continente. Dobbiamo dunque essere coscienti del fatto che Italia e Germania sono in prima linea per difendere la Comunità e il benessere di tutti i popoli, anche quelli che abbiamo accolto troppo affrettatamente nella Comunità.
L'Italia ha anche riconosciuto, sia sotto l'ultimo governo e ancora di più sotto il governo Monti,  di essere una delle cause della destabilizzazione della Comunità, a causa di un rapporto troppo elevato tra debito pubblico e PIL. Per questa ragione sono e sono stati richiesti agli italiani grandi sacrifici per riportare in equilibrio la situazione finanziaria del paese. E' perciò necessario che anche la Germania riconosca la sua enorme responsabilità e i grandi vantaggi, che sinora ha tratto dall'esistenza dell'UE, in modo da cambiare l'orientamento delle sue decisioni in materia di politica economica per il bene di tutta l'Europa. Senza voler polemizzare eccessivamente vorremmo riportarVi alla memoria questi vantaggi e questa responsabilità.

Nel nome dell'unicità del suo passato e sostenuta dalla solidarietà della Comunità fino ad ora la Germania ha tenuto un comportamento unilaterale a suo esclusivo vantaggio, ed ha così ottenuto agevolazioni e regolamenti in deroga, ottenendone enormi vantaggi.

1) L'unificazione monetaria tedesca del 1990 non seguì tassi di cambio basati sulla realtà del mercato: una pura decisione politica che consistette in una nobile manifestazione di fratellanza con i cittadini della DDR, che fu lanciata da un grande statista come Helmut Kohl e che contraddisse il principio di stabilità. L'inflazione risultante fu combattuta con un aumento delle tasse la cui estensione non era conciliabile con la stabilità dei mercati finanziari europei.

2) Come regolamento in deroga nel Trattato di Fondazione dell'UE nel 1992 furono previsti "aiuti per l'economia dei territori della repubblica federale colpiti a causa dell'unificazione tedesca" e dichiarati compatibile con il mercato interno europeo "per quanto sono necessari per la compensazione degli svantaggi nati dalla divisione.." Questa deroga non solo è ancora in vigore, ma nel 2007 è stata nuovamente confermata. Secondo l'Art. 170, Par. 2 lett. C del trattato di Lisbona il Consiglio d'Europa su proposta della Commissione può decidere "cinque anni dopo l'entrata in vigore del trattato di Lisbona" se  abolire questa disposizione. Dopo l'entrata in vigore del trattato il primo gennaio 2009 una nuova trattativa è possibile ora a partire dal 2014. Si tratta di un regolamentazione di puro e semplice favore, che non è stata applicata a nessun altro paese ex comunista  che sia entrato a far parte della UE.

3) Nel 2002 l'UE in materia di garanzie statali per il settore bancario tedesco ha concesso un periodo di transizione eccezionalmente lungo, fino alla metà del 2005. I rischi assunti fino a quel punto sono considerati come coperti dalla 'Responsabilità del Garante' (termine legaletedesco in realtà ndf) , a patto che si esauriscano per la fine del 2015. Questo è probabilmente uno dei motivi che ha determinato l'intervento finanziario statale a favore del sistema bancario, cosa che pesa in modo così incisivo sul contribuente tedesco.

4) Dal 2000 al 2007 il rapporto debito pubblico/PIL della Germania è salito di 5,2 punti percentuali dal 59,7% al 64,9%. In Italia invece è sceso di 5,6 punti percentuali dal 109,2% al 103,6% avvicinandosi verso il valore di riferimento del 60% secondo il ritmo appropriato. A differenza dell'Italia invece la Germania ha preso decisioni politiche che alla luce dei doveri stabiliti dal trattato di Maastricht sono assolutamente discutibili e la allontanano sempre più dal valore di riferimento.

5) Nel 2002 e nel 2003 la Germania ha oltrepassato il limite del 3% di deficit e si avvantaggiata insieme alla Francia delle decisione di Ecofin di soprassedere a un procedimento formale secondo l'art. 104 del trattato.

6) Dopo la crisi del 2008 la Germania ha deciso misure potenziali fino a 418 miliardi di euro,  nel  quadro delle disposizioni comunitari per gli aiuti statali al settore bancario. Quasi un terzo dell'eccedenza del bilancio delle partite correnti accumulato dalla Germania dopo l'introduzione dell'Euro. Non sembra che il sistema bancario tedesco abbia in qualche modo contribuito a ridurre il rischio di instabilità finanziaria di tutto il continente. Piuttosto ha ricevuto aiuti pubblici in misura molto considerevole.

L'elenco potrebbe continuare, così come sarebbe possibile una lista delle deroghe e degli errori da parte italiana. Di fronte alla tragica verità con cui l'Europa (e non solo l'Europa) si vede a confronto, le imputazioni a carattere nazionalistico cambiano davvero poco.
Per superare la crisi l'Europa necessita senza dubbio di una grande rigorosità da parte degli stati membri (e l'Italia mostra per il momento al mondo di esserne capace). Ha bisogno ancora di più del supporto di coloro che dell'Euro hanno profittato in grande misura (il 42% dell'export tedesco va nei paesi della moneta comune). La Germania deve ora mostrare di possedere una visione politica e una leadership tale da ritrovare la necessaria dinamica di solidarietà nei confronti di tutti quei popoli che nel seno del trattato di fondazione della Comunità Europea lottano per unirsi un vero stato federale.
Chiediamo dunque alla Signora Merkel e a tutti i cittadini tedeschi una immediata e rapida riflessione  affinché si ponga un freno alla pratica dei rimproveri e delle punizioni e si rivedano le misure per la costruzione dell'unità politica dell'Europa e quindi dell'economia europea.

Come il presidente del consiglio Mario Monti ha detto con grande franchezza, la Grecia si merita in ogni caso rispetto umano.

Sunday, 3 June 2012

Spaceship Alterprice

Jesko Friedrich has made another very funny sketch on the european debt crisis. The satire is maybe a bit unjust, but it hits the mark and the Trek setting is outstanding. I've had the pleasure of subtitling in English with universalsubtitles.org