accent icon indicating copy to clipboard operation
accent copied to clipboard

Client only retrieves certain images

Open bdaneshgar opened this issue 2 years ago • 7 comments

Client will display pages calendar, artwork, wittgenstein, and city, but fails to show content and displays a settings_response for commute and everyone. Any idea how this could be happening? The server is creating the image just fine.

bdaneshgar avatar Aug 16 '23 16:08 bdaneshgar

What does the serial console output of the client look like when this issue happens? Are you using your own server or accent.ink?

maxbbraun avatar Aug 21 '23 13:08 maxbbraun

I am using my own server. Here is the terminal from the client:

_PowerOn : 134997
Busy Timeout!
_Update_Full : 20001053
_PowerOff : 157000
Read 768 bytes (96000 total)
Download complete
Suspending display
_PowerOff : 40000
Scheduling sleep
Requesting URL: https://accent-393823.wl.r.appspot.com/next
Status code: 200
Sleep server response: 24262361
Sleeping for 24262361000 us

bdaneshgar avatar Oct 31 '23 18:10 bdaneshgar

Do you see any error logs on the server? This client log looks fine, but it also only shows the request and response for /next and not for /epd, which should be just before it. If both are status 200, then I'd expect the error to be server-side.

maxbbraun avatar Nov 02 '23 00:11 maxbbraun

I'm getting the following. I'm using a waveshare 7.5", 800x480 display:

  "textPayload": "ERROR:root:Failed to create Schedule content: Requested a 800x480 map but got 640x480. Try this: https://developers.google.com/maps/documentation/maps-static/start#Largerimagesizes",
  "insertId": "6543d721000194d63da926f1",
  "resource": {
    "type": "gae_app",
    "labels": {
      "module_id": "default",
      "version_id": "20230726t204946",
      "zone": "us-west2-2",
      "project_id": "accent-393823"
    }
  },
  "timestamp": "2023-11-02T17:06:41.103638Z",
  "labels": {
    "clone_id": "0037d6d5d376b858968d6299719bd5842919fa4263d2ece4aa0be475e49ef2a3c70944e8a7c7ff3634e0728b8a85f50fef53971b9523afd72475b084676cf6908f"
  },
  "logName": "projects/accent-393823/logs/stderr",
  "receiveTimestamp": "2023-11-02T17:06:41.356828278Z"
}
{
  "textPayload": "Traceback (most recent call last):\n  File \"/srv/commute.py\", line 59, in image\n    image = self._google_maps.map_image(width, height, variant,\n  File \"/srv/google_maps.py\", line 154, in map_image\n    raise DataError('Requested a %dx%d map but got %dx%d. Try this: ht'\nfirestore.DataError: Requested a 800x480 map but got 640x480. Try this: https://developers.google.com/maps/documentation/maps-static/start#Largerimagesizes",
  "insertId": "6543d721000194f0f6995feb",
  "resource": {
    "type": "gae_app",
    "labels": {
      "zone": "us-west2-2",
      "version_id": "20230726t204946",
      "module_id": "default",
      "project_id": "accent-393823"
    }
  },
  "timestamp": "2023-11-02T17:06:41.103664Z",
  "severity": "ERROR",
  "labels": {
    "clone_id": "0037d6d5d376b858968d6299719bd5842919fa4263d2ece4aa0be475e49ef2a3c70944e8a7c7ff3634e0728b8a85f50fef53971b9523afd72475b084676cf6908f"
  },
  "logName": "projects/accent-393823/logs/stderr",
  "receiveTimestamp": "2023-11-02T17:06:41.356828278Z",
  "errorGroups": [
    {
      "id": "CM-fi8rVrO2PBQ"
    }
  ]
}
{
  "textPayload": "During handling of the above exception, another exception occurred:",
  "insertId": "6543d721000194f91d0612de",
  "resource": {
    "type": "gae_app",
    "labels": {
      "zone": "us-west2-2",
      "module_id": "default",
      "version_id": "20230726t204946",
      "project_id": "accent-393823"
    }
  },
  "timestamp": "2023-11-02T17:06:41.103673Z",
  "labels": {
    "clone_id": "0037d6d5d376b858968d6299719bd5842919fa4263d2ece4aa0be475e49ef2a3c70944e8a7c7ff3634e0728b8a85f50fef53971b9523afd72475b084676cf6908f"
  },
  "logName": "projects/accent-393823/logs/stderr",
  "receiveTimestamp": "2023-11-02T17:06:41.356828278Z"
}
{
  "textPayload": "Traceback (most recent call last):\n  File \"/srv/response.py\", line 96, in content_response\n    image = content.image(user, width, height, variant)\n  File \"/srv/schedule.py\", line 142, in image\n    image = self._image(latest_entry['image'], user, width, height,\n  File \"/srv/schedule.py\", line 110, in _image\n    return content.image(user, width, height, variant)\n  File \"/srv/commute.py\", line 62, in image\n    raise ContentError(e)\ncontent.ContentError: Requested a 800x480 map but got 640x480. Try this: https://developers.google.com/maps/documentation/maps-static/start#Largerimagesizes",
  "insertId": "6543d7210001950594c4c255",
  "resource": {
    "type": "gae_app",
    "labels": {
      "project_id": "accent-393823",
      "zone": "us-west2-2",
      "module_id": "default",
      "version_id": "20230726t204946"
    }
  },
  "timestamp": "2023-11-02T17:06:41.103685Z",
  "severity": "ERROR",
  "labels": {
    "clone_id": "0037d6d5d376b858968d6299719bd5842919fa4263d2ece4aa0be475e49ef2a3c70944e8a7c7ff3634e0728b8a85f50fef53971b9523afd72475b084676cf6908f"
  },
  "logName": "projects/accent-393823/logs/stderr",
  "receiveTimestamp": "2023-11-02T17:06:41.356828278Z",
  "errorGroups": [
    {
      "id": "COiBvcjWneT1kgE"
    }
  ]
}

bdaneshgar avatar Nov 02 '23 17:11 bdaneshgar

The first error message explains what's going on:

Failed to create Schedule content: Requested a 800x480 map but got 640x480. Try this: https://developers.google.com/maps/documentation/maps-static/start#Largerimagesizes

You can follow the link for more info and ways to fix it.

maxbbraun avatar Nov 03 '23 02:11 maxbbraun

Unfortunately, I got this response from Google Cloud Support:

Hi,Unfortunately your request has been rejected by the engineering team since it is for personal use and low usage , please use the default maximum imagery size. if your usage increases you can try to apply again later.

Additionally, epd.py has default display sizes set to 640x384. I am having trouble finding out how the larger sizes are being requested in the first place.

i will try to dig deeper and report back. In the meantime, if you are able to figure out how to lower the size of the request (or give me guidance as to how many requests I would need to satisfy Google), I would appreciate the help.

bdaneshgar avatar Nov 06 '23 23:11 bdaneshgar

Additionally, epd.py has default display sizes set to 640x384. I am having trouble finding out how the larger sizes are being requested in the first place.

The default values for the display size (and variant) are only used when the request doesn't specify any size. See here. This is mainly a fallback for compatibility with older clients. So in your case, the client is requesting an 800x480 image. If your display is 640x384 instead, you should change the client configuration here.

maxbbraun avatar Nov 07 '23 01:11 maxbbraun