HP Printer Hack - mpalitto/HomeHacks GitHub Wiki

HomeHacks

Collection of little projects used at my home...

HP Printer Hack

HP Printer (HP Color LaserJet MFP M281fdw) did not work when using the Scan to email feature, no matter the settings.

I was able to go around this issue with the following strategy:

  1. I have used the Little 10 EURO OrangePi Linux Server for getting a SAMBA Network-drive.
  2. Scan to network-drive from printer
  3. Linux Server check for new file in Network-drive and send to email using the FREE smtp gmail server.

Look into the HP-Printer-Hack folder for the Sever bash code

Install required scripts

copy sendScanned.sh file to the Linux Serverroot directory

edit the file and fill with your info the following 2 lines of the script

LinuxUserName="your-linux-username" #Linux Server user name whom network folder belongs to
sendTo="[email protected]" #The email address to whom the email with PDF attached is going to be sent to

make the script executable by using the following command-line:

chmod +x /root/sendScanned.sh

To the server /etc/rc.local file, add the following line

nohup /root/sendScanned.sh &

make sure the server has the following packages installed:

apt install ssmtp

apt install mailutils

Set your gmail account to be used by script for sending emails

from your gmail --> Select "Manage your Google Account" --> Security --> turn ON 2 steps verification --> generate password for APP email (take note the generated password)

Configure the SSMTP to use smtp.gmail.com server

from the Linux Server edit /etc/ssmtp/ssmtp.conf by adding the following lines

mailhub=smtp.gmail.com:587
AuthUser=your-gmail-address(e.g. [email protected])
AuthPass=the-gmail-generated-APP-password
UseTLS=YES
UseSTARTTLS=YES

Configure Network-drive

On the Linux Server install SAMBA

apt install samba

At the end of /etc/samba/smb.conf append the following lines

[scannerDrive]
path = /path/to/scannerDrive (e.g. /home/your-linux-username/scannerDrive)
valid users = your-linux-username (e.g. pincopallo)
read only = no

set samba password for linux-user your-linux-username (samba password and linux user password are not the same)

smbpasswd -a your-linux-username

Set HP printer Scan to network-drive

  1. From WEB browser enter HP Printer IP Address into the address bar
  2. Select Scan Tab
  3. Configure a new network-folder 3.1. Display name: scannerDrive@LinuxServerIPaddress (e.g. [email protected]) 3.2 Network path: \\LinuxServerIPaddress\scannerDrive (e.g. \192.168.1.123\scannerDrive ) 3.3 Username: your-linux-username (e.g. pincopallo) 3.4. Password: your-samba-password

you can save and test