HP printer / scanner

This is just a quick writeup of what I have done so far to get an HP LaserJet M1522nf (printer / fax / scanner) to work. Currently this device is only used as a copier at the office, but many people asked about the scan button. My main goal is that users can simply press the scan button on the device in order to scan a document and save it to a Samba share.

After connecting the USB cable, Kubuntu automatically installs the printer in Cups. You can change the settings on http://localhost:631. To change the name of the printer (how it appears on the printers list), add a new printer with the same settings, and delete the old one. So now we have a working printer.

For scanning under X Window, try xsane. In my case it failed with an I/O error. The solution was this command:

hp-plugin -i

This installs any missing driver from HP. After that xsane works and we can do some scanning. So far so good.

For scanning on the commandline, use scanimage -L to get a list of devices, and use something like the following command to actually scan:

scanimage -d 'hpaio:/usb/HP_LaserJet_M1522nf_MFP?serial=00CNDT914GWT' --mode Color --resolution 300 > test.pnm

The argument after -d specifies the device found using scanimage -L.

Great! Next thing to do is monitoring the scan button. This however seems to be a major problem, because nobody appears to have implemented it yet. Even after more than 5 years, HP appearently has serious trouble supporting this simple scan button in their HPLIP library. Fortunately, there is another way. If you press the scan button, a message appears on the LCD: "Waiting for PC",

and after a few seconds a timeout occurs because the PC is not responding, after which the printer returns to its ready state.

On some HP printers you can read out the LCD, using the SNMP protocol. So indirectly you can tell whether or not the scan button has been pressed. The only thing to do is hookup the HP device to the network and give it a static (fixed) IP address. Here are some useful commands:

snmpwalk -v 1 -c public <ip_address_of_scanner>
scli <ip_address_of_scanner> -c "show printer display"
scli <ip_address_of_scanner> -c "show printer lights"

The snmpwalk command is part of the snmp package and you can find the scli command in the scli package.

However, the M1522nf does fully support SNMP; you cannot read out the LCD using SNMP on this thing. It does not support Telnet either, and there is no PJL command you can send to the JetDirect port (9100) to query the LCD display. The only way to do that using the web interface, so we use wget to do that every 5 seconds. Here the script I have come up with:

#!/bin/sh

while [ 1 ]
do
   MSG="`wget -q -O - \
      'http://192.168.1.4/info_deviceStatus.html?tab=Status&menu=DevStatus' | \
      grep -A2 'itemLargeFont' | tail -1 | sed -r 's/(&nbsp;| |\t)+/ /g' | \
      sed 's/<[^>]*>//g'`"
   if echo "$MSG" | grep -q 'Waiting for PC'
   then
      echo "Scanning"
      scanimage -d hpaio:/usb/HP_LaserJet_M1522nf_MFP?serial=00CNDT914GWT \
         --mode Color --resolution 300 | cjpeg -optimize -quality 85 > \
         /share/Scanner/`date '+%Y-%m-%d-%H-%M-%S'`.jpg
   else
      echo "Idle"
   fi
   sleep 5
done

In this case 192.168.1.4 is the IP address of the printer and /share/Scanner is a directory on our NFS / Samba server. Now if someone presses the scan button, the scanner starts and the resulting image is converted from PNM to JPEG, and saved under a name like 2010-11-16-12:34:56.jpg.

Mission accomplished ;-)

Exceptionally fascinating web

Exceptionally fascinating web journal. Alot of websites I see nowadays don't generally give anything that I'm occupied with, however I'm most definately keen on this one. Recently believed that I would post and let you know. Cheap fifty fiveprint Discount

Keep doing awesome read few

Keep doing awesome read few posts on this site and I consider that your web journal is exceptionally fascinating and has sets of fabulous data. http://mirlasabinoblog81.suomiblog.com/effective-mirla-sabino-advice-simplified-2603371

The Ideal Dream Laser Clinic

The Ideal Dream Laser Clinic is a cosmetic-medical center offering only certified, result-oriented hair removal, Skin rejuvenating, body countering and weight loss services for both men and women. Our team includes certified technicians, Registered Dietitian and specialized skin and laser consultants. We offer the highest level of safety and service in an environment where the main priority is your safety, health and privacy. Our clinic located in heart of north York , Yonge and Steeles area close to public transit. 5 min walk to center of Yonge and Steeles, 88 Steeles Ave. East Toronto. laser clinic toronto

This is very informatics,

This is very informatics, fresh and clear. I feel that everything has been portrayed in methodical way with the goal that peruser could get greatest data and realize numerous things. fifty five print Discount Code

Much obliged for each other

Much obliged for each other educational site. The spot else might just I understand that sort of data written in such a perfect means? I have an endeavor that I'm a few seconds ago working on, and I have been watchful for such data. home equity line of credit vs cash out refinance

Thank you very much for

Thank you very much for writing such an interesting article on this topic. This has really made me think and I hope to read more. limo service from NYC to CT

Exceptionally fascinating web

Exceptionally fascinating web journal. Alot of websites I see nowadays don't generally give anything that I'm occupied with, however I'm most definately keen on this one. Recently believed that I would post and let you know. macchinette tatuaggi

imranuddin

My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more! arabic news

Its me Brayden Ben a

Its me Brayden Ben a professional and well experienced Designer.There are many designer more experienced then me , but now i am here to provide you the real design service I will design your name with real stones and give you high quality image , Unique and professional and no one will copy your design because its all Hand Made. awesome name design

I think you can follow the

I think you can follow the instructions from the manual book. If not, just try to share your problem. judi bola

Wrought iron lighting

That's the IT engineering works, I am just a staff and don't know about it. Wrought iron lighting

moonstone jewelry

This stuff reminds me to the place where I was an internship there. moonstone jewelry

A debt of gratitude is in

A debt of gratitude is in order for offering this quality data to us. I truly delighted in perusing. Will clearly going to impart this URL to my companions. video submission

imranuddin

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. sleep surface made from a flexible product

Mebel Furniture Jepara

Berbagai macam pilihan model dan desain untuk mengisi perabot furniture rumah anda. Furniture Jepara Furniture Jepara Minimalis Indoor Furniture Outdoor Furniture

imranuddin

wow this good but ,I like your post and good pics may be any peoples not like because defrent mind all poeple , sleep surface made from a flexible product

imranuddin

Hi I found your site by mistake when i was searching yahoo for this acne issue, I must say your site is really helpful I also love the design, its amazing!. I don’t have the time at the moment to fully read your site but I have bookmarked it and also add your RSS feeds. I will be back in a day or two. thanks for a great site. different sort of whatsthebestbed design

devidmiller5060

Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”. ESR wheels

台北當鋪

How much the cost if I want to buy this printer? 台北當鋪

Wait till you see KRW Personal Injury Lawyers

Those are long code. I am a beginner in coding so those look so confusing. http://www.krwlawyers.com/start_San-Antonio-Personal-Injury-Attorney.php

good

This looks quite useful for the installation of the HP printer or scanner in a linux system I have been searching for a tutorial for the same since a while. I have bought one scanner last week and was not able to install it correctly. free womens clinic

micropigmentação fio a fio

This will help the staffs and the officer to finish their work faster. micropigmentação fio a fio

This Amazing

very amazing post, I like It, Thank you for presenting a wide variety of information that is very interesting to see in this artikle, good job adnd succes For you
Artikle yang sangat keren, semoga sukses selalu
Ingin Liburan dan Wisata Karimunjawa dengan aman dan nyaman di karimunjawa ? Ingin Paket Wisata Karimunjawa dan gak murahan? Hubungi Kami "Raja Karimunjawa" biro lokal asli paket wisata Karimunjawa . Untuk Book Paket Karimunjawa dan Tour Karimunjawa. Kepuasan Wisata Karimunjawa anda di pulau Karimunjawa adalah kebahagia'an dan tujuan kami. Terimakasih telah mempercayakan paket karimunjawa bersama kami. Kami juga menjual produk tenun troso dan kain tenun ikat khas jepara. untuk harga paket wisata karimunjawa sangat terjangkau, silahkan Untuk booking paket tahun baru karimunjawa dan paket honeymoon karimunjawa dan paket backpacker karimunjawa. juga untuk paket lebaran silahkan klik paket lebaran karimunjawa Kami Juga Punya Paket Bulan Mei Karimunjawa dan ada pula Paket karimunjawa 3 hari 2 malam maupun paket karmunjawa 2 hari 1 malam dan paket karimunjawa 4 hari 3 malam. ada juga paket hotel karimunjawa dan jadwal kapal karimunjawa.
Di jepara juga terkenal Produk Furniture Jepara yang sudah mendunia. dari segi kualitas mebel jepara juga sangat bagus.di jepara banyak sekali toko furniture jepara maupun toko jual mebel minimalis. adapun produknya yaitu toko sangkar burung, mebel minimalis, mebel jati, Lemari pakaian kayu jati, kursi tamu jati jepara, tempat tidur kayu jati, meja makan kayu jati murah, mimbar podium minimalis,

The article has actually

The article has actually peaks my interest. I am going to bookmark your web site and maintain checking for brand new information. Berlin attractions

shiprabrock

his is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the excellent work. ESR wheels

wilwilson

Hey there! Someone in my Facebook group shared this site with us so I came to look it over. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers! Outstanding blog and amazing style and design. Check This Website

steve smith

Yes, great US Military force. Also, in his post you have given a chance to listen about US Military. I really appreciate your work. Thanks for sharing it. sistema di gestione sicurezza alimentare roma

smith

I really like your article. It’s evident that you have a lot knowledge on this topic. Your points are well made and relatable. Thanks for writing engaging and interesting material. www.Everydaylocksmith.org

imranuddin

Should there be another persuasive post you can share next time, I’ll be surely waiting for it. web tasarımı

And the

And the third one is the cantilevered bank which is fabricated from an centralized axis of steel-combined, cast-in-place authentic or mortared masonry. This bank axle endless to a big, structural footing, alteration accumbent burden into vertical on the arena below. aussiessay

And the third one is the

And the third one is the cantilevered bank which is fabricated from an centralized axis of steel-combined, cast-in-place authentic or mortared masonry. This bank axle endless to a big, structural footing, alteration accumbent burden into vertical on the arena below. aussiessay

devidmiller5060

My friend mentioned to me your blog, so I thought I’d read it for myself. Very interesting insights, will be back for more! Standard Internazionali sicurezza alimentare

devidmiller5060

Should there be another persuasive post you can share next time, I’ll be surely waiting for it. nordictrack e 7.0 z elliptical trainer reviews

devidmiller5060

So luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site. Prince2 Training

imranuddin

I read this article. I think You put a lot of effort to create this article. I appreciate your work. facebook

imranuddin

I read this article. I think You put a lot of effort to create this article. I appreciate your work. facebook

imranuddin

I read this article. I think You put a lot of effort to create this article. I appreciate your work. facebook

shiprabrock

Hey – great blog, just looking around some blogs, seems a really nice platform you are using. I’m currently using WordPress for a few of my blogs but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it? costco adjustable beds

devidmiller5060

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... mexican restaurants ann arbor

toooppp

Kanker adalah suatu penyakit yang dikategikan sebagai penyakit yang mematikan. Jika si penderita kanker tidak segera mendapatkan penanganan pengobatan, maka sel-sel kanker akan cepat menyebar ke bagian-bagian tubuh lainnya seperti beberapa organ vital seperti jantung, paru-paru, hati, pankreas, usus, otak, dll. Proeses penyebaran sel-sel kanker ini sering disebut dengan istilah metaphase yang kemudian akan menentukan stadium penyakit kanker yang dialami oleh penderita. Semakin banyak sel kanker yang menyebar ke bagian tubuh si penderita, maka si penderita akan mengalami stadium yang lebih tinggi. Dunia medis telah mengidentifikasi jenis-jenis kanker yang berpotensi menyerang manusia. Jenis-jenis kanker tersebut antara lain: kanker otak, kanker darah (leukemia), kanker kulit, kanker tiroid, kanker mulut, kanker mata, kanker payudara, kanker serviks, kanker prostat, kanker hati, kanker pankreas, kanker hati, kanker empedu, kanker usus, kanker paru-paru, kanker tulang, kanker tulang belakang, dan masih banyak jenis kanker lainnya. Macam Penyakit Kanker bagaimana mengatasi penyakit kanker..? selengkapnya silahkan kunjungi sekarang
Olahraga berjalan juga merupakan salah satu jenis olahraga yang dapat mencegah atau pun menyembuhkan ambeien. Dengan banyak berjalan minimal kita bisa menggerakan badan dan beberapa otot yang dirasa tegang. Lalu, anda juga bisa mengurangi waktu nongkrong di WC yang biasanya dilakukan sehari-hari. Karena hal tersebut merupakan salah satu pemicu terjadinya ambeien dan agar penderita bisa menghindari akibat ambeien yang mungkin berbahaya.
Cara Mengobati Ambeien Saat Menyusui
tentang penyakit ambeien secara detail silahkan
kunjungi blog kami
Dampak ringan yang ditimbulkan dari penyakit ini berupa munculnya bau tidak sedap pada area vagina. Kondisi yang terparah adalah dapat menyebabkan kemandulan bahkan berimbas pada kematian. Ini dikarenakan penyebab dari infeksi HPV berisiko tinggi menyebabkan kanker leher rahim. Bagi ibu hamil, persalinan dengan kondiloma akan berdampak fatal pada ibu maupun janin. Nyawa keduanya bisa melayang akibat perdarahan yang sangat hebat, karena kondiloma mudah sekali berdarah. salep menghilangkan kutil apa itu kutil kelamin..? penjelasan selengkapnya tentang penyakit kutil kelamin silahkan baca selengkapnya
Jika kebiasaan buruk tersebut ditinggalkan dengan menyertakan konsumsi obat untuk penderita wasir secara teratur, wasir anda bisa sembuh dalam jangka waktu yang singkat. Mengobati Sakit Ambeien Tanpa Operasi cara mengobati penyakit ambeien atau wasir yang aman tanpa efek samping silahkan kunjungi blog kami
Untuk itulah sebaiknya anda mengkonsumsi obat untuk penderita ambeien yang sifatnya permanen alias dapat menyembuhkan penyakit ambeien anda hingga ke akar-akarnya. Sebaiknya anda memilih obat untuk penderita ambeien yang komposisinya dari bahan-bahan alami untuk mengurangi efek samping yang mungkin saja kita peroleh saat mengkonsumsinya. Mengobati Wasir Habis Melahirkan untuk anda yang menderita penyakit sipilis dan ingin sembuh silahkan Info selengkapnya
Keenam, penyembuhan hemorrhoid dapat dilakukan juga dengan mengonsumsi pisang klutuk yang dihaluskan dan dicampur dengan gula aren, juga meminum daun salak yang dimasukkan kedalam air dan direbus serta dicampur dengan gula aren setiap harinya. Mengonsumsi pisang klutuk dan meminum air daun salak ini dilakukan pagi dan malam hari. Obat Ambeien Mengeluarkan Darah untuk mengetahui info tentang penyakit ambeien silahkan Cara Mengobati Penyakit Kencing Nanah apa itu kencing nanah..? penjelasan selengkapnya tentang penyakit kencing nanah silahkan lihat penjelasan selengkapnya
Secara lebih spesifik lagi dikatakan bahwa penyakit ini disebabkan oleh penderita yang terlalu lama duduk sehingga menyebabkan ketegangan, atau bisa juga karena wanita yang sedang dalam keadaan hamil sehingga mengakibatkan adanya tekanan dalam rahim yang semakin membesar.
Bagaimana Solusi Mengobati Wasir Yang Sudah Keluar?
untuk mengetahui info tentang penyakit wasir silahkan
kunjungi blog kami
Gejala gonore yang tampak pada perubahan fisik adalah membengkaknya lubang penis dan sehingga menjadi berwarna kemerahan. Hal yang paling mengganggu tersebut merupakan keluhan pada setiap penderita gonore. Apalagi rasa sakit dan perih yang seperti terbakar pada alat kelamin yang sering kali terjadi. Gejala gonore ini harus anda ketahui dan sadari sejak awal terjadi. http://www.herbaldenature.com/2013/08/cari-obat-kelamin-bernanah.html untuk anda yang menderita penyakit kelamin bernanah atau gonore dan ingin sembuh silahkan Info selengkapnya
Penyakit Ambein ini sama halnya dengan penyakit wasir diartikan sebagai kondisi dimana penderita mengalami pembesaran urat pada bagian bawah rektumnya dan anus. Jika sudah begitu maka akan mengakibatkan pembengkakan dan peningkatan tekanan dalam tubuh. Yang biasa menjadi penyebab hal ini terjadi karena penderita yang terlalu lama duduk sehingga menyebabkan ketegangan, atau bisa juga karena wanita yang sedang dalam keadaan hamil sehingga mengakibatkan adanya tekanan dalam rahim yang semakin membesar. obat tradisional ambeien stadium 3 bagaimana mengatasi penyakit Ambeien..? selengkapnya silahkan lihat penjelasan selengkapnya
Beberapa kutil mungkin tampak seperti bercak putih datar tapi ada juga penderita yang mengalami pertumbuhan kutil dengan jumlah yang banyak dan terlihat seperti kembang kol kecil. Untuk mengobati kutil kelamin secara cepat dan mudah maka tidak ada cara yang lebih baik selain menghubungi dokter terdekat anda. Obat Alami Untuk Mengobati Kutil Kelamin cara mengobati penyakit sipilis yang aman tanpa efek samping silahkan http://aytugakdoganodulluseoyarismasi1.blogspot.com/2016/12/obat-alami-untuk-mengobati-kutil-kelamin.html
Wasir terbentuk karena perluasan pembuluh darah di daerah anus. Lama kelamaan pembuluh darah di daerah anus itu akan mengalami peningkatan dalam ukuran. Selain itu, tekanan besar pada rektum juga menyebabkan pembuluh darah yang mengandung darah semakin meluas dan akhirnya menyebabkan pembentukan wasir atau tumpukan. Jika Anda adalah salah satu dari jutaan orang di seluruh dunia yang menderita penyakit ini dan ingin menyingkirkan wasir, maka Anda perlu untuk memperhatikan secara khusus mengenai segala hal yang berhubungan dengan upaya pengobatan wasir dengan obat yang tepat dan dilengkapi dengan obat herbal alami, selain itu tidak boleh dilupakan mengenai upaya adaptasi dengan perubahan gaya hidup baru yang bertujuan supaya penyakit ini tidak berulang kembali. Cara Mengobati Wasir Menahun cara mengobati penyakit ambeien atau wasir yang aman tanpa efek samping silahkan Cek selengkapnya
Kanker adalah salah satu penyakit kronis yang bisa menyerang tubuh manusia dan menimbulkan akibat fatal jika tidak mendapatkan pengbatan dengan segera.. sel kanker bisa berkembang biak dalam tubuh dan menyebar ke bagian yang lebih luas. Kanker bisa disebabkan oleh berbagai faktor seperti asap rokok, minuman beralkohol, zat radikal bebas, paparan sinar radiasi, paparan sinar ultra violet, dan lain sebagainya. Terdapat dua macam pengobatan untuk penyakit kanker yaitu pengobatan secara medis dan pengobatan alternative. Pengobatan secara medis dilakukan dengan tiga cara yaitu kemoterapi, radioterapi, dan pembedahan atau operasi. Namun, sayangnya ketiga pengobatan medis ini seringkali menimbulkan efek samping, misalnya radioterapi dan kemoterapi sering menimbulkan efek samping berupa mual yang luar biasa. Sedangkan efek samping dari pembedahaan atau operasi biasanya berupa radang atau infeksi. http://obat-kanker-ampuh.com/2017/02/14/pengobatan-kanker-tanpa-operasi/ untuk anda yang menderita penyakit sipilis dan ingin sembuh silahkan lihat penjelasan selengkapnya
Obat herbal ambeien merupakan obat yang aman untuk di konsumsi, karena obat herbal ambeien ini tidak menggunakan bahan kimia sehingga tidak di sertai dengan efek samping. Dan 100 persen bahan dasar yang di gunakan ialah tumbuhan. Obat Ambeien Yang Belum Parah untuk mengetahui info tentang penyakit ambeien silahkan http://affiliates69.blogspot.com/2016/08/level-penyakit-wasir-atau-ambeien.html


















paket

Artikle yang sangat keren, semoga sukses selalu
paket tour karimunjawa
Ingin Liburan dan pergi wisata karimunjawa dengan aman dan nyaman di karimun jawa ? Ingin Paket pariwisata Karimunjawa dan gak murahan? Hubungi Kami "karimunjawa tour travel" biro lokal asli paket wisata Karimunjawa . Untuk Book Paket Karimunjawa dan Tour Karimunjawa murah. Kepuasan Wisata Karimunjawa anda di pulau karimunjawa adalah kebahagia'an dan tujuan kami. dan untuk harga tanah karimunjawa juga sangat terjangkau bagi anda untuk berinvestasi di karimunjawa dan kami juga men jual tanah karimunjawa untuk anda.
Produk Mebel Di Jepara

devidmiller5060

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. mom w gerber

travel

Di jepara juga terkenal Produk Furniture Jepara yang sudah mendunia. dari segi kualitas mebel jepara online juga sangat bagus.di jepara banyak sekali toko furniture anak maupun toko furniture jati jepara. Adapun produknya yaitu jual kursi jati dan aneka tempat tidur. Kami toko mebel jepara online jual mebel jati asli jepara yang termasuk Furniture Jati harga murah. Kami selalu menjaga kualitas produk kami produk produk kami, untuk harga meja makan jati juga sangat terjangkau. Selamat berbelanja.

devidmiller5060

I read this article. I think You put a lot of effort to create this article. I appreciate your work. 買中古車

shiprabrock

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. sleepjunkie product your child is resting on

devidmiller5060

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... מגשי אירוח לאירועים

shiprabrock

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. VCP5-DCV

Craig Rocky

Should there be another persuasive post you can share next time, I’ll be surely waiting for it. MST wheels for sale

devidmiller5060

I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. corso preposto grosseto

shiprabrock

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Optionfair review