Skip to content

get_image.php

jdeananderson edited this page Nov 28, 2018 · 6 revisions

Manually check the operation of the get_image.php script

Check the "Base URL" in the Admin mode on the wall-ink device to verify the device is accessing the correct server and URL. Try accessing the "full URL" from a standard web browser and see if it is able to download the "wink" file.

To check the operation of the get_image.php script, pass a full URL with parameters to it. If the server is working properly, it should return a <mac_address>.wink file in return, where <mac_address> is the MAC address specified in the full URL passed to get_image.php. Download the wink file and check it's contents. It should be binary data with no text found in it. If there are uncaught php errors, get_image.php may prepend these text errors at the beginning of the wink file. This text added at the beginning of the file will not allow the wall-ink device to display the image because the formatting is incorrect.

In the example below, the wink file was generated omitting two required parameters to get_image.php, width and height. These php errors from get_image.php litterally show up in the downloaded Wink file if server debugging is turned on. This text will cause the wall-ink device to throw the error: "Time data or password failed verification test". This is because the wall-ink device is expecting a wink file header and got text instead. The second wink file below in Notepad++ shows just binary data and will display properly on a wall-ink device.

If no wink file is offered to download, try verifying that the plugin is working. Check the web server logs, and turn on wall-ink-server debug mode.

Base URL

The base URL is the location on the wall-ink server where the get_image.php script is located. It is stored in the EEPROM of the wall-ink device. It is set in the Admin mode console of the device, and will also be set by flashing the device IF the EEPROM has been cleared prior to flashing. The base URL should be in the following format:

http://my.server.com/get_image.php

http://

The esp8266 does not handle secure https, so there is no need to include https in the URL. Http:// is all that is necessary.

my.server.com

This is the name of the web server that is running the wall-ink-server software.

get_image.php

Get_image.php is the script that runs the plugins and returns a "wink" file for the wall-ink device to display. By default, it is located in the root of the web space on the wall-ink-server.

Full server URL with parameters

The full server URL should be the "Base URL" as specified in the Admin mode console, followed by the necessary parameters in the following format:

http://my.server.com/get_image.php?mac_address=ABCDE1234567&firmware=9.9&error=0&voltage=3.12&width=640&height=384

mac_address

The mac_address is passed to the get_image.php script so the wall-ink-server knows which device is checking in and requesting an image to display.

firmware

The firmware parameter is passed from the wall-ink device to the server. This is used in the device manager to keep track of which devices are running various version of the firmware. Each time a wall-ink device checks in, if the firmware version has changed, it will be updated in the device manager. It may be useful when manually checking the full server URL of a real device from a web browser for testing purposes to use a "fake" firmware number to help identify that it is your browser contacting the server and not a device. The Nagios script that verifies operation of the get_image.php script uses the firmware version "nagios".

error

If a wall-ink device experiences an error, it stores the error code in its RTC memory. The next time the device checks in successfully with the server, it passes the error code to the wall-ink-server. This error code will appear in the wall-ink-server logs. The error code will also appear on the screen of the device in the URL it tried to reach unsuccessfully.

voltage

This is the voltage of the wall-ink device as reported by the esp8266. The voltage from the URL is updated in the device manager database each time the device checks in.

width and height

Each wall-ink device has the width and height of it's screen stored in it's firmware. Width and height is measured in pixels. Some plugins are able to dynamically resize images based on these parameters passed in. These parameters are updated in the device manager database each time a device checks in.

Clone this wiki locally