Closed nmlpg12 closed 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?
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
![Uploading 220DD3D8-4115-4E75-AE97-5BC83771A252.jpeg…]()
It hangs there doesn’t do anything Noticed that my controller https certificate needs renewing
where can i see the error logs ?
[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'
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.
Trying 149.28.49.108...
TCP_NODELAY set
Expire in 200 ms for 4 (transfer 0x6346f8)
Connected to wifi.haciendasanandres.mx (149.28.49.108) port 8443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: none CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server did not agree to a protocol
Server certificate:
subject: CN=wifi.haciendasanandres.mx
start date: Dec 29 22:00:47 2019 GMT
expire date: Mar 28 22:00:47 2020 GMT
issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
SSL certificate verify ok.
POST /api/s/default/cmd/hotspot HTTP/1.1 Host: wifi.haciendasanandres.mx:8443 Accept: / Cookie: unifises=4lW3sxWGu5OtMZAmNu3sW5Wp5yjZ1PD8;csrf_token=qRW2Yrj7RmiA8YhKwaWjqux923eUiCPo Content-Type: application/json;charset=UTF-8 Content-Length: 93
upload completely sent off: 93 out of 93 bytes < HTTP/1.1 401 < vary: Origin < Access-Control-Allow-Credentials: true < Access-Control-Expose-Headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials < X-Frame-Options: DENY < Content-Type: application/json;charset=UTF-8 < Content-Length: 63 < Date: Thu, 27 Feb 2020 23:00:35 GMT <
Connection #0 to host wifi.haciendasanandres.mx left intact
Expire in 0 ms for 6 (transfer 0x6346f8)
Expire in 10000 ms for 2 (transfer 0x6346f8)
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
Expire in 1 ms for 1 (transfer 0[Thu Feb 27 23:12:00.641250 2020] [php7:notice] [pid 2449] [client ::1:47168] cURL debug: needed to reconnect to UniFi controller, referer: http://localhost/unifi-voucher-service/index.php x634b60)
Expire in 2 ms for 1 (transfer 0x634b60)
Expire in 1 ms for 1 (transfer 0x634b60)
Expire in 1 ms for 1 (transfer 0x634b60)
Expire in 1 ms for 1 (transfer 0x634b60)
Trying 149.28.49.108...
TCP_NODELAY set
Expire in 200 ms for 4 (transfer 0x634b60)
Connected to wifi.haciendasanandres.mx (149.28.49.108) port 8443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: none CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server did not agree to a protocol
Server certificate:
subject: CN=wifi.haciendasanandres.mx
start date: Dec 29 22:00:47 2019 GMT
expire date: Mar 28 22:00:47 2020 GMT
issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
SSL certificate verify ok.
POST /api/s/default/cmd/hotspot HTTP/1.1 Host: wifi.haciendasanandres.mx:8443 Accept: / Cookie: unifises=Dvmdd2hzTpxkf3XGzHcpvNukeEK0Gn6I;csrf_token=mhTIMY9mZpoYgM6GCIw6Kk6dXXxWaRNz Content-Type: application/json;charset=UTF-8 Content-Length: 98
upload completely sent off: 98 out of 98 bytes < HTTP/1.1 401 < vary: Origin < Access-Control-Allow-Credentials: true < Access-Control-Expose-Headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials < X-Frame-Options: DENY < Content-Type: application/json;charset=UTF-8 < Content-Length: 63 < Date: Thu, 27 Feb 2020 23:12:00 GMT <
Connection #0 to host wifi.haciendasanandres.mx left intact
i no longer have php errors but i still can't get it to work ..
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)
Connected to wifi.haciendasanandres.mx (149.28.49.108) port 8443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: none CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server did not agree to a protocol
Server certificate:
subject: CN=wifi.haciendasanandres.mx
start date: Dec 29 22:00:47 2019 GMT
expire date: Mar 28 22:00:47 2020 GMT
issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
SSL certificate verify ok.
POST /api/s/default/cmd/hotspot HTTP/1.1 Host: wifi.haciendasanandres.mx:8443 Accept: / Cookie: unifises=0UhyWGjNbGAMa1lGHOf00sQTp54Ibxd0;csrf_token=sTWMu2ja1t7ykXYJNfMvMW1xD3e7naOU Content-Type: application/json;charset=UTF-8 Content-Length: 93
upload completely sent off: 93 out of 93 bytes < HTTP/1.1 401 < vary: Origin < Access-Control-Allow-Credentials: true < Access-Control-Expose-Headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials < X-Frame-Options: DENY < Content-Type: application/json;charset=UTF-8 < Content-Length: 63 < Date: Fri, 28 Feb 2020 01:04:11 GMT <
Connection #0 to host wifi.haciendasanandres.mx left intact
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
rying 149.28.49.108...
TCP_NODELAY set
Expire in 200 [Fri Feb 28 01:41:15.680425 2020] [php7:notice] [pid 13659] [client ::1:46638] cURL debug: needed to reconnect to UniFi controller, referer: http://localhost/unifi-voucher-service/index.php ms for 4 (transfer 0x1a781a8)
Connected to wifi.haciendasanandres.mx (149.28.49.108) port 8443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: none CApath: /etc/ssl/certs
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server did not agree to a protocol
Server certificate:
subject: CN=wifi.haciendasanandres.mx
start date: Dec 29 22:00:47 2019 GMT
expire date: Mar 28 22:00:47 2020 GMT
issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
SSL certificate verify ok.
POST /api/s/default/cmd/hotspot HTTP/1.1 Host: wifi.haciendasanandres.mx:8443 Accept: / Cookie: unifises=VAfhOli9pJdn6G1X4RcoAc0DvGtA3oJv;csrf_token=eFcW2ojDF0KJ36rlLyyoSP93jQ88Xy1c Content-Type: application/json;charset=UTF-8 Content-Length: 93
upload completely sent off: 93 out of 93 bytes < HTTP/1.1 401 < vary: Origin < Access-Control-Allow-Credentials: true < Access-Control-Expose-Headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials < X-Frame-Options: DENY < Content-Type: application/json;charset=UTF-8 < Content-Length: 63 < Date: Fri, 28 Feb 2020 01:41:15 GMT <
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";
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");
Hello for some reason i made the changes ql-800 and lsusb id for some reason its just stuck on printing i need help