diff --git a/_posts/2026-08-26-sat-magtag.md b/_posts/2026-08-26-sat-magtag.md new file mode 100644 index 0000000..a987f47 --- /dev/null +++ b/_posts/2026-08-26-sat-magtag.md @@ -0,0 +1,43 @@ +--- +layout: post +title: "MagTag Sketch for Satellite Passes" +date: 2026-08-26 +--- + +This is too cool not to share! + +At this past weekend's RMHAM Summer Swapfest, I acquired a couple of e-ink display gadgets with +ESP32 microcontrollers without knowing exactly what they were. I figured that, at worst, they would +be cheap Chinese Arduino-compatible devices that would be clunky but possible to program. Once I got +them home and was able to research them properly, I discovered they were +[Adafruit MagTags](https://www.adafruit.com/product/4800)! + +Being Adafruit products running CircuitPython, these boards came batteries included (figuratively, +but also literally) with great documentation and support! It was quick and easy to get them loaded +with the baseline bootloader and CircuitPython firmware, and then start experimenting with test +sketches that ping Google and the like. + +With a baseline established, I went searching and found the excellent +[N2YO.com API](https://www.n2yo.com/api/) for AMSAT and other orbital objects. The great thing about +it is that, in addition to providing fresh, raw +[TLEs](https://en.wikipedia.org/wiki/Two-line_element_set), it can also provide pre-crunched pass +information given the observer's location. This is huge because it means I don't have to do orbital +math on a puny microcontroller! I can query each satellite I'm interested in, sort them all by the +Acquisition of Signal (AOS) time, and throw them on the display. + +![Basic MagTag display](/assets/2026-08-26-magtag-basic.jpg) + +I started out simple, having the device wake up once an hour and update the display. Once that was +working, I got a bit fancier and started highlighting current passes and graying out recent passes +closer to real time. This required caching my N2YO queries because I was using up my API quota. As +it turns out, when you're querying six satellites on every run and making code changes that cause +the program to run every few minutes, it's rather easy to blow through 100 queries in an hour and +get rate-limited! I also added a low battery mode to make the display show when the gadget needs to +be recharged instead of just displaying stale data forever. + +![Active MagTag display](/assets/2026-08-26-magtag-active.jpg) +![Recent MagTag display](/assets/2026-08-26-magtag-recent.jpg) + +Overall, I'm quite happy with this very functional new gadget I have to keep me aware of AMSAT +opportunities. Check out the +[MagTag Sketch for Satellite Passes](https://github.com/xylo04/magtag/tree/main/sat-passes). diff --git a/assets/2026-08-26-magtag-active.jpg b/assets/2026-08-26-magtag-active.jpg new file mode 100644 index 0000000..79dd828 Binary files /dev/null and b/assets/2026-08-26-magtag-active.jpg differ diff --git a/assets/2026-08-26-magtag-basic.jpg b/assets/2026-08-26-magtag-basic.jpg new file mode 100644 index 0000000..a6f512e Binary files /dev/null and b/assets/2026-08-26-magtag-basic.jpg differ diff --git a/assets/2026-08-26-magtag-recent.jpg b/assets/2026-08-26-magtag-recent.jpg new file mode 100644 index 0000000..b4365c0 Binary files /dev/null and b/assets/2026-08-26-magtag-recent.jpg differ diff --git a/resize-images.sh b/resize-images.sh index d7cdc8c..f9a84a0 100755 --- a/resize-images.sh +++ b/resize-images.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash + +if ! command -v convert >/dev/null 2>&1; then + echo "Error: 'convert' is required. Install ImageMagick and try again." >&2 + exit 1 +fi + max_dimension=1024 images=$(find assets/ -iname "*.gif" -o -iname "*.png" -o -iname "*.jpg" -o -iname "*.webp" | sort) for i in $images; do