Skip to content

feat: support for additional devices (e.g. Kindle)#27

Merged
bnussbau merged 2 commits into
mainfrom
feat/support-kindle
May 13, 2025
Merged

feat: support for additional devices (e.g. Kindle)#27
bnussbau merged 2 commits into
mainfrom
feat/support-kindle

Conversation

@bnussbau
Copy link
Copy Markdown
Collaborator

This PR adds more flexibility in terms of device dimensions, rotation and image format to support more devices (like trmnl-kindle).

Tested working with Kindle 10th Gen and these Device Settings:

  • Width (px): 1400
  • Height (px): 1100
  • Rotate (°): 90
  • Image Format: PNG 8-bit Grayscale Gray 256c

Instructions to modify the Kindle: https://github.com/usetrmnl/trmnl-kindle

Note: BYOS Laravel requires a mac adress in the header when calling the api/display port. Be sure to adapt the curl command like this

# 2) Fetch JSON metadata
  RESPONSE="$(
    curl -s \
      -H "access-token: $API_KEY" \
      -H "id: $MAC_ADDRESS" \                  # add a Mac Address (can be fake or real)
      -H "battery-voltage: $BATTERY_VOLTAGE" \
      -H "rssi: $RSSI" \
      -A "$USER_AGENT" \
      "${BASE_URL}/api/display"
  )"

@bnussbau bnussbau changed the title feat: support additional devices (e.g. Kindle) feat: support for additional devices (e.g. Kindle) May 13, 2025
@bnussbau bnussbau marked this pull request as ready for review May 13, 2025 17:24
@bnussbau bnussbau merged commit d75d099 into main May 13, 2025
1 check passed
@bnussbau bnussbau deleted the feat/support-kindle branch May 13, 2025 17:29
@maxforasteiro
Copy link
Copy Markdown

note from the future: laravel image_url returns as http:\/\/byos.local:4567\/storage\/images\/setup-logo.bmp so you might want to change line https://github.com/usetrmnl/trmnl-kindle/blob/main/zip_example/TRMNL.sh#L101 to ... | sed 's/\\//g'

-  IMAGE_URL=$(echo "$RESPONSE" | sed -n 's/.*"image_url":"\([^"]*\)".*/\1/p' | sed 's/\\u0026/\&/g')
+  IMAGE_URL=$(echo "$RESPONSE" | sed -n 's/.*"image_url":"\([^"]*\)".*/\1/p' | sed 's/\\u0026/\&/g') | sed 's/\\//g')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants