Can't get INKY_MESSAGE variable working for inkyshot project

Hi balena team,

I am trying to put together a (last minute) Christmas gift for my daughter.

This is my first project, so I’m pretty green. I got the inkyshot up and running for the most part by following the instructions here: https://www.balena.io/blog/send-personal-messages-and-inspirational-quotes-with-this-e-ink-display-project/, but I cannot seem to get the INKY_MESSAGE variable to work for me.

I looked at the log and I think this is the section that relates to the problem, but I don’t understand what the issue is. My message is “hello”

23.12.20 10:02:13 (-0500) INFO:root:Display type: InkyPHAT_SSD1608
23.12.20 10:02:13 (-0500) INFO:root:Display dimensions: W 250 x H 122
23.12.20 10:02:15 (-0500) Traceback (most recent call last):
23.12.20 10:02:15 (-0500) File “/usr/app/update-display.py”, line 348, in
23.12.20 10:02:15 (-0500) message = data[‘contents’][‘quotes’][0][‘quote’]
23.12.20 10:02:15 (-0500) KeyError: ‘contents’

Can you please tell me what I am doing wrong?

Not sure if this is pertinent, but I am also alternating between a quote and weather. That seems to work fine. The custom message didn’t work for me even when I wasn’t displaying weather.

Thank you.

<EDIT: While in alternating weather/quote mode, I removed the INKY_MESSAGE variable, and now it is stuck on the weather and does not revert back to the inspirational quote.>

Hi Brian

I have a couple of questions, as I think you have mentioned a couple of scenarios.

  • You said you are alternating between quote and weather mode - which would mean you have the QOD_CATEGORY, MODE as well as the weather related environment variables set. Is that right?
  • You setup the above, and then you setup the INKY_MESSAGE env var - but it failed to show up. Did I get that right?
  • Can you send a screenshot of your environment variables?
  • Based on your logs, what I think happened is that the device tried to fetch the latest quote from quotes.rest API, but it failed (line 348 is this). It received a response, but it wasn’t the right one. This is most likely an error with the API that we use for quotes, or perhaps an Internet issue? It could even be an issue with the configured category variable. Your screenshot of env variables will help us recreate the API call

Hi Anuj,

I have sent the variables by DM to you.

Thanks

Hi @andro55, thank you for reporting this issue. I just made a new release fixing this. Can you please upload the latest application code to the device and try it?

Hope your daughter enjoys the gift :smiley:

Hi @gelbal,

Thank you so much. It works and my daughter loves it.
Happy new year.

1 Like