KarimGeiger/HKAPI

Not working with AVR 270

Opened this issue · 2 comments

I Just tried to use it on local pi zero2 with a lighttpd webserver with php 7.4.
But I only get a 500 when I open the example or simpler versions.

The webserver and php works for me. So the question is, did I miss anything else?
$hk = new \HKAPI\API('192.168.178.7', 10025, new \HKAPI\Devices\AVR());

I don't get any response after this call. Only the 500. Also if I put an echo() afterwards. The server just gives the 500 back. If I put the echo before the call the echo will be shown.

A 500 error is a generic PHP error. You may want to increase the PHP log level or take a look at the error log to see the exact error message. Without a message, this could be anything, from a missing PHP extension, missing autoloader/dependencies or a version compatibility problem.

Thanks for your reply. You are right, my mistake. I just tried it on my local machine and it works. I did not know composer so that is definitely one reason that it did not work.

Strange thing is that the lightppd server has issues with serving these php files. I would not expect that extensions might be a reason for it. Do you know of something specific which is required? Then I would try to install it.

As I am using lightppd for pihole I am not in the mood to switch to nginx for compatibility reasons.

You did not create a docker image out of curiosity? Idea could be the following:

  • URL Parameterize the api calls index.php?command=powerOn -> Afterwards nobody needs to create additional files
  • Create a docker image
    • Set minimal base image with webserver and php support
    • Clone the project to folder
    • Set ENV variable for IP, Internal PORT, TYPE

FYI, if you want to add it to the list, AVR 270/2700 seams to be compatible. For the heart-alive call I get this back:
string(157) "heart-alive����>"

Additional .ini files parsed: /etc/php/7.4/fpm/conf.d/10-opcache.ini, /etc/php/7.4/fpm/conf.d/10-pdo.ini, /etc/php/7.4/fpm/conf.d/15-xml.ini, /etc/php/7.4/fpm/conf.d/20-apcu.ini, /etc/php/7.4/fpm/conf.d/20-calendar.ini, /etc/php/7.4/fpm/conf.d/20-ctype.ini, /etc/php/7.4/fpm/conf.d/20-curl.ini, /etc/php/7.4/fpm/conf.d/20-dom.ini, /etc/php/7.4/fpm/conf.d/20-exif.ini, /etc/php/7.4/fpm/conf.d/20-ffi.ini, /etc/php/7.4/fpm/conf.d/20-fileinfo.ini, /etc/php/7.4/fpm/conf.d/20-ftp.ini, /etc/php/7.4/fpm/conf.d/20-gd.ini, /etc/php/7.4/fpm/conf.d/20-gettext.ini, /etc/php/7.4/fpm/conf.d/20-iconv.ini, /etc/php/7.4/fpm/conf.d/20-intl.ini, /etc/php/7.4/fpm/conf.d/20-json.ini, /etc/php/7.4/fpm/conf.d/20-mbstring.ini, /etc/php/7.4/fpm/conf.d/20-pdo_sqlite.ini, /etc/php/7.4/fpm/conf.d/20-phar.ini, /etc/php/7.4/fpm/conf.d/20-posix.ini, /etc/php/7.4/fpm/conf.d/20-readline.ini, /etc/php/7.4/fpm/conf.d/20-shmop.ini, /etc/php/7.4/fpm/conf.d/20-simplexml.ini, /etc/php/7.4/fpm/conf.d/20-sockets.ini, /etc/php/7.4/fpm/conf.d/20-sqlite3.ini, /etc/php/7.4/fpm/conf.d/20-sysvmsg.ini, /etc/php/7.4/fpm/conf.d/20-sysvsem.ini, /etc/php/7.4/fpm/conf.d/20-sysvshm.ini, /etc/php/7.4/fpm/conf.d/20-tokenizer.ini, /etc/php/7.4/fpm/conf.d/20-xmlreader.ini, /etc/php/7.4/fpm/conf.d/20-xmlwriter.ini, /etc/php/7.4/fpm/conf.d/20-xsl.ini, /etc/php/7.4/fpm/conf.d/20-zip.ini, /etc/php/7.4/fpm/conf.d/97-dietpi.ini