PaintSplasher / unifi-voucher-service

Every employee can simple print a voucher for your guests with one click. They do not have to login or see anything from your UniFi Controller or Hotspot Manager.
GNU General Public License v3.0
107 stars 27 forks source link

Unable to print QL-800 web stuck on print #10

Closed nmlpg12 closed 4 years ago

nmlpg12 commented 4 years ago

Hello for some reason i made the changes ql-800 and lsusb id for some reason its just stuck on printing i need help

PaintSplasher commented 4 years ago

Can you please give us some details on what you exactly changed, did you checked your lsusb id twice? Are you on a testprint or did you the rest of the steps?

nmlpg12 commented 4 years ago

1 yea i did the test print and added the --red while test script and it worked. the only part that i haven't don is the unclutter but i didn't want to do it until i tested that it worked. when i added the UniFi setting i created special account for the printer that only has access to the specific site. i named san andress i suspect its that because the script doesn't send the print command because i don't get an error on the printer either

nmlpg12 commented 4 years ago

D67EB407-8550-480D-B7E4-AE5C2097C95F 12AA1A16-2CD8-49E1-95E4-5498056BB3E5 798B8E2D-1713-42EE-BE59-9C9E95C63A7E FEFFACCA-F75D-4A29-AFE8-160A91A3291D A1890C27-4440-41FF-9FC3-B2D144C2879D C0016BCD-7CEB-438D-BFE9-D93F7571E2C6 BA517456-4503-4BAE-BC54-29ABC9911C27 ![Uploading 220DD3D8-4115-4E75-AE97-5BC83771A252.jpeg…]()

nmlpg12 commented 4 years ago

image

It hangs there doesn’t do anything Noticed that my controller https certificate needs renewing

nmlpg12 commented 4 years ago

where can i see the error logs ?

nmlpg12 commented 4 years ago

[Thu Feb 27 20:20:09.727098 2020] [mpm_prefork:notice] [pid 704] AH00169: caught SIGTERM, shutting down [Thu Feb 27 20:20:41.875610 2020] [mpm_prefork:notice] [pid 670] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 20:20:41.877824 2020] [core:notice] [pid 670] AH00094: Command line: '/usr/sbin/apache2' [Thu Feb 27 20:24:16.270961 2020] [php7:error] [pid 725] [client ::1:41774] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:26:21.179602 2020] [php7:error] [pid 1936] [client ::1:41794] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:27:15.059468 2020] [mpm_prefork:notice] [pid 670] AH00169: caught SIGTERM, shutting down [Thu Feb 27 20:27:45.340203 2020] [mpm_prefork:notice] [pid 676] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 20:27:45.356083 2020] [core:notice] [pid 676] AH00094: Command line: '/usr/sbin/apache2' [Thu Feb 27 20:31:44.825808 2020] [php7:error] [pid 729] [client ::1:46946] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:31:51.496085 2020] [php7:warn] [pid 731] [client ::1:46948] PHP Warning: require_once(/usr/src/UniFi-API-client/src/Client.php): failed to open stream: No such file or directory in /var/www/html/unifi-voucher-service/codes/1-day-fastpass.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:31:51.496316 2020] [php7:error] [pid 731] [client ::1:46948] PHP Fatal error: require_once(): Failed opening required '/usr/src/UniFi-API-client/src/Client.php' (include_path='.:/usr/share/php') in /var/www/html/unifi-voucher-service/codes/1-day-fastpass.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:32:37.985894 2020] [mpm_prefork:notice] [pid 676] AH00169: caught SIGTERM, shutting down [Thu Feb 27 20:33:06.844586 2020] [mpm_prefork:notice] [pid 675] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 20:33:06.853293 2020] [core:notice] [pid 675] AH00094: Command line: '/usr/sbin/apache2' [Thu Feb 27 20:34:15.267785 2020] [php7:error] [pid 728] [client ::1:56716] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:35:10.477026 2020] [php7:warn] [pid 729] [client ::1:56728] PHP Warning: require_once(/usr/src/UniFi-API-client/src/Client.php): failed to open stream: No such file or directory in /var/www/html/unifi-voucher-service/codes/1-day-fastpass.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:35:10.477260 2020] [php7:error] [pid 729] [client ::1:56728] PHP Fatal error: require_once(): Failed opening required '/usr/src/UniFi-API-client/src/Client.php' (include_path='.:/usr/share/php') in /var/www/html/unifi-voucher-service/codes/1-day-fastpass.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:36:11.996940 2020] [php7:warn] [pid 730] [client ::1:56746] PHP Warning: require_once(/usr/src/UniFi-API-client/src/Client.php): failed to open stream: No such file or directory in /var/www/html/unifi-voucher-service/codes/1-month-free.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:36:11.997300 2020] [php7:error] [pid 730] [client ::1:56746] PHP Fatal error: require_once(): Failed opening required '/usr/src/UniFi-API-client/src/Client.php' (include_path='.:/usr/share/php') in /var/www/html/unifi-voucher-service/codes/1-month-free.php on line 13, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 20:43:25.164956 2020] [php7:error] [pid 734] [client ::1:56760] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 21:17:40.631704 2020] [mpm_prefork:notice] [pid 573] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 21:17:40.638646 2020] [core:notice] [pid 573] AH00094: Command line: '/usr/sbin/apache2' [Thu Feb 27 21:17:28.121339 2020] [mpm_prefork:notice] [pid 666] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 21:17:28.123761 2020] [core:notice] [pid 666] AH00094: Command line: '/usr/sbin/apache2' [Thu Feb 27 21:38:02.082940 2020] [php7:error] [pid 720] [client ::1:53988] PHP Parse error: syntax error, unexpected '"/var/www/html/"' (T_CONSTANT_ENCAPSED_STRING), expecting '[' in /var/www/html/unifi-voucher-service/codes/1-day-free.php on line 31, referer: http://localhost/unifi-voucher-service/index.php [Thu Feb 27 21:41:10.268518 2020] [mpm_prefork:notice] [pid 666] AH00169: caught SIGTERM, shutting down [Thu Feb 27 21:41:34.561463 2020] [mpm_prefork:notice] [pid 722] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations [Thu Feb 27 21:41:34.574888 2020] [core:notice] [pid 722] AH00094: Command line: '/usr/sbin/apache2'

PaintSplasher commented 4 years ago

You must have missed a step, your apache can't find the correct files "No such file or directory" and because of "PHP Parse error: syntax error, unexpected" on 31 you maybay edited a file you shouldn't have to edit. Or you changed the uvs_folder name or added a wrong character to it.

nmlpg12 commented 4 years ago
nmlpg12 commented 4 years ago

i fixed that problem it wasn't a file that i shouldn't have edited it was a problem where a the UniFi-API-service folder had one lowercase letter UniFi

nmlpg12 commented 4 years ago
nmlpg12 commented 4 years ago
nmlpg12 commented 4 years ago

i no longer have php errors but i still can't get it to work ..

nmlpg12 commented 4 years ago

Fixed php error and it was due to lowercase in a folder and fixed it ; now the problem 401 error with the controller Expire in 200 ms for 4 (transfer 0x1a6fd10)

nmlpg12 commented 4 years ago

the controller has multiple sites , but the account i assigned to printer has only access to that site specifically do i have to add something extra to make it work

nmlpg12 commented 4 years ago

rying 149.28.49.108...

nmlpg12 commented 4 years ago

ok finally got that fixed the problem was that i needed to add few lines of code (add site id) now its generating vouchers now i need the proper syntax to produce the following code sudo brother_ql -p usb://04f9:209b -m QL-800 print -l 62 voucher_final.png --red it has to send the command in that order to work.

shell_exec("sudo brother_ql -p usb://" . $uvs_usbid . " -m " . $uvs_printer . " print -l " . $uvs_labelsize . " /var/www/html/" . $uvs_folder . "/codeimage/voucher_final.png"). " --red";

nmlpg12 commented 4 years ago

just to let you know that i finally fixed everything. it prints now and yea i had to add few lines of code to the config.php stating the siteid (cloud controller hostifi and managing several sites myself)

and to make the brother ql 800 the solution given was the following shell_exec("sudo brother_ql -p usb://" . $uvs_usbid . " -m " . $uvs_printer . " print -l " . $uvs_labelsize . " /var/www/html/" . $uvs_folder . "/codeimage/voucher_final.png". " --red") ;

or manualy set hell_exec("sudo brother_ql -p usb://" . $uvs_usbid . " -m QL-800 print -l 62" ." /var/www/html/" . $uvs_folder . "/codeimage/voucher_final.png". " --red");