maxbbraun / accent

Accent Smart Picture Frame
https://accent.ink
MIT License
199 stars 16 forks source link

Client only retrieves certain images #41

Open bdaneshgar opened 1 year ago

bdaneshgar commented 1 year ago

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.

maxbbraun commented 1 year ago

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

bdaneshgar commented 10 months ago

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
maxbbraun commented 10 months ago

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.

bdaneshgar commented 10 months ago

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"
    }
  ]
}
maxbbraun commented 10 months ago

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.

bdaneshgar commented 10 months ago

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.

maxbbraun commented 10 months ago

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.