HackerBox 0119: Geopositioning

by HackerBoxes in Circuits > Microcontrollers

2067 Views, 4 Favorites, 0 Comments

HackerBox 0119: Geopositioning

HB0119 Whole Box.png

Welcome to HackerBox 0119. Explore satellite positioning and geolocation. Configure the Arduino IDE to target the ESP32 wireless system-on-chip. Assemble the exclusive Thrifty Yeti Locator (TYL) platform - a CYD compatible GPS receiver featuring a full-color touch screen. Populate a flash memory SD Card with local map images to visualize mobile GPS positioning. Experiment with the Marauder security research tool. Catch a couple DEF CON 33 recap videos. Discover how to get a free DEF CON 33 Mini Badge. Boggle over entries from The International Obfuscated C Code Contest (IOCCC). Leverage reverse engineering techniques to examine highly obfuscated program code. Explore applying some interesting reverse engineering approaches to hardware hacking.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.

Supplies

This Instructable contains information for getting started with HackerBox 0119. The full box contents are listed on the product page for HackerBox 0119 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month, you can subscribe at HackerBoxes.com and join the party. Subscription members save at least $15 every month and automatically receive each new HackerBox shipped immediately off the production line.

A soldering iron, solder, and basic assembly tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for tools and supplies along with a wide array of introductory activities and experiments.

The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

WEAR SAFETY GLASSES WHEN SOLDERING, WHEN TRIMMING WIRE LEADS, OR WHEN CUTTING, DRILLING, ETC.

Ten Years of Tinning

Tin.png

The first HackerBox was #0000, making #0119 the 120th HackerBox.

Yes, this month marks one full decade of HackerBoxes and tin is the traditional ten year anniversary gift.

Tin has the chemical symbol Sn (from Latin stannum) and the atomic number 50. A metallic-gray metal, tin is soft enough to be cut or bent with little force. Tin is used in many alloys, most notably tin-lead solder, which is typically 60% or more tin. Accordingly, applying a coat of solder to a wire, terminal, or soldering iron tip is commonly called tinning. (Wikipedia)

Global Navigation Satellite Systems (GNSS)

How GPS Works 🛰️ What is GPS

The Global Positioning System (GPS) is a satellite-based navigation system owned by the United States Space Force. It is one of the global navigation satellite systems (GNSS) that provide geolocation and time information to a GPS receiver anywhere on or near the Earth. It does not require the user to transmit any data, and operates independently of any telephone or Internet reception, though these technologies can enhance the usefulness of the GPS positioning information. It provides critical positioning capabilities to military, civil, and commercial users around the world. Although the United States government created, controls, and maintains the GPS system, it is freely accessible to anyone with a GPS receiver. In addition to GPS, there are three other GNSS systems: Russia's Global Navigation Satellite System (GLONASS), China's BeiDou Navigation Satellite System (BDS), and the European Union's Galileo System. (Wikipedia)

ESP-WROOM-32 Development Board

espWROOM32 DevBrd.png

This project works with the ESP-WROOM-32 Development Board.

Let's test out the Development Board on its own prior doing any soldering.

  1. Attach the ESP32 Dev Board to a computer using a USB-C cable
  2. A solid red light will illuminate
  3. Install the Arduino IDE (if you don't already have it)
  4. In the IDE, use the Boards Manager to search for ESP32 (by Espressif Systems)
  5. Select that board package and hit install
  6. From the top menu, select Tools > Board > esp32 > ESP32 Dev Module
  7. Select Tools > Port (COM port that appears when the ESP32 is connected and turned on)
  8. Open the sketch File > Examples > Basics > Blink
  9. Add the line #define LED_BUILTIN 2 at the top of the sketch
  10. Compile an upload the sketch to the Dev Board

If everything is in order, the sketch will cause the blue LED that is connected to I/O pin 2 to begin blinking. Modify the sketch by changing the values in the delay() calls to see how they impact the blinking of the LED. The passed parameter is provided in milliseconds, so delay(1000) waits for one second.

Thrifty Yeti Locator

TYL assm.png

If you like the CYD (as featured in HackerBox 0099), you might just love the TYL. Much like the Cheap Yellow Display, the Thrifty Yeti Locator includes an ESP32, color touch display, and an SD card slot. Unlike the CYD, the TYL also includes a GPS module - useful for locating Yetis, Swamp Apes, Bigfoot, Sasquatch, Wookiees, Skunk Apes, and much, much more!

To maximize compatibility, the TYL uses the same 240x320 pixel display, ILI9341 display driver chip, and XPT2046 resistive touch controller as the ESP32-2432S028R CYD, which was the CYD version featured in HackerBox 0099. The TYL also uses the same I/O pin mappings as the CYD, which are listed here:

TFT_MISO 12
TFT_MOSI 13
TFT_SCLK 14
TFT_CS 15
TFT_DC 2
TFT_RST -1 (tied to 3.3V on TYL)
TFT_BL 21
TOUCH_IRQ 36
TOUCH_MOSI (DIN) 32
TOUCH_MISO (DOUT) 39
TOUCH_CLK 25
TOUCH_CS 33
SD_MISO 19
SD_MOSI 23
SD_SCK 18
SD_CS 5

Accordingly, CYD projects should run on the TYL without modification.

The additional GPS module on the TYL is mapped to the following ESP32 I/O pins:

GPS_RX 1
GPS_TX 3

The TYL also routes these I/O and power nets to a twelve pin expansion header:

3V3, GND, 22, 34, 35, 26, 17, 27, 16, 4, 0, 5V

Assembling the TYL

Start by identifying the header pins. There is a 14 pin header in the plastic box with the TFT Display. Do not snap this header. It goes to the longer (14 pin) connector of the display module. There is a 16+ pin header in the zipper bag with the GPS module and SD Card adapter. Snap 4 pins from one end of this header for use in the smaller (4 pin) connector of the display module. The remainder of this header may optionally be populated into the expansion connection on the edge of the TYL PCB.

  1. Match the small WHITE ARROW on the back side of the L80-R GPS Module to the pad with the SMALL BLACK arrow on the TYL PCB. This should result in the GPS module being oriented as shown in the image above.
  2. Solder the pads of the GPS Module. If you are new to soldering castellated modules, review this SparkFun tutorial.
  3. Solder the two display module headers (14 pin and 4 pin as discussed above) onto the back of the display module.
  4. Position the display module onto the TYL PCB. Attempt to keep the red PCB and the white PCB as parallel as possible. Solder the 14+4 display module pins onto the white TYL PCB.
  5. Pop the ESP-WROOM-32 Development Board onto the TYL PCB with orientation as indicated. Solder the pins of the ESP32 module onto the white TYL PCB.

GPS Test Firmware

Grab the attached TYL_GPS_Test.ino sketch file.

Open the sketch in the Arduino IDE.

Follow the note at the top of the sketch about three libraries to load into the Arduino IDE. These can be searched and installed used the IDE's Library Manager.

Compile and upload the sketch to the TYL.

"Acquiring Satellites..." will take a few minutes. Positioning the TYL close to a window or outside helps.

Once the birds are locked on, the GPS Location (latitude and longitude) will be displayed on TFT Display.

You can type these values into Google Maps to verify that the GPS module knows where it is.

Downloads

TYL Mapping

Mapping.png
GulfGate.bmp
US.bmp

You'll need three files attached to this Step.

  1. Arduino sketch: TYL_GPS_Map.ino
  2. US.bmp (right click and save the image above)
  3. GulfGate.bmp (right click and save the image above)

Format an SD Card with FAT32 and copy the two map files onto the root of the card. At least copy the US.bmp map file. GulfGate is a village area not far from HackerBoxes HQ where we often go for lunch, so we wanted to test this firmware there. The GulfGate.bmp file map will never open unless you happen to be driving through Sarasota, FL, so it is probably safe to ignore it.

Open the TYL_GPS_Map.ino sketch in the Arduino IDE.

Follow the note at the top of the sketch about the additional library to load into the Arduino IDE - Adafruit ImageReader Library (with dependancies). It can be searched and installed used the IDE's Library Manager.

Compile and upload the sketch to the TYL.

Once the GPS Satellites are Acquired, the TYL will display a map of the US with a blinking red dot on your location.

This assumes, of course, that you are located in the mainland US.

If you are not in the US, or if you want to add some street level maps in your area, it's pretty simple...

  1. Find the map you want to add - a good source is the Export feature on OpenStreetMap
  2. Use a photo editor (e.g. Gimp) to scale/crop an image of the map to 320x240 pixels
  3. Save that image as a 24bit BMP file
  4. Copy the file onto the SD card
  5. In the sketch, find where the array maps[] of structs mapData is initialized
  6. Add another structure initialization line with the bmp filename and four numbers
  7. The four numbers are the bounding latitudes and longitudes of the map
  8. Update the definition of NUM_MAPS to reflect the number of maps in the array

Reviewing the sketch code, you may appreciate that it is exceedingly simple for what it does. The current latitude and longitude is read from the GPS module. The maps[] array is iterated to find a map bounding the coordinates received from the GPS module. If more than one map image meets that criteria, the tightest (most zoomed) map is selected. This bestMap is then displayed with a small red circle (dot) drawn at the measured coordinates. As the GPS sensor moves into and out of map bounds, the displayed map will automatically change to the new bestMap.

There are some more complicated examples of this type of system, such as ESP32_GPS and IceNav, written for the ESP32 and leveraging TFT displays. Should you wish to dive deeper, and maybe even take on a porting challenge, please consider sharing your results here and with the CYD Community.

Downloads

ESP32 Marauder

THE Definitive Guide to JustCallMeKoKo's ESP32 Marauder!! From The Stand-Alone to the Flipper Zero!!

Check out this Definitive Guide to the ESP32 Marauder video from The Talking Sasquatch

Because the TYL is sort of a CYD, Fr4nkFletcher's Marauder CYD Port is good to go:

  1. Head over to the CYM WEBFLASHER
  2. Plug in the TYL
  3. Hit Connect
  4. In the pop-up, select the TYL USB port
  5. Before hitting Connect in the pop-up, hold down IO0 (bootstrap), hit EN (reset), and keep IO0 pressed until you hit Connect and then see "Try Hard Reset" - then release the button
  6. Repeat as necessary, the timing can be tricky
  7. Under SELECT BOARD, select CYD Single USB (with GPS)
  8. Under VERSION, select Current
  9. Wait for the "Flashing..." progress bar to complete
  10. Hit the reset button on the ESP32

Hacker Movie Stickers

Sass Stickers.png

Speaking of The Talking Sasquatch, check out his DEF CON 33 Recap Video.

He made some very cool Hacker Movie Stickers to share at DEF CON and was nice enough to provide us with the artwork so that we could print some for you. You might have noticed that there are eight different stickers shown here and three of them are included on the sticker sheet in HackerBox 0119.

SPOILER ALERT... Keep an eye out for the other five to pop up in the near future.

Perfect timing given that September 2025 is the actual 30 Year Anniversary of the Hackers Movie.

So... WTF Happened?

Free DEF CON 33 Mini Badge

Free Badge.png

How about another DEF CON 33 Recap Video? This longer, meandering chat between Jamie from Jamie's Hack Shack and Joe from HackerBoxes touches on a number of topics.

If you somehow are not yet familiar with Jamie's YouTube channel, you need to take a look. He has created a number of very nice "unbox and build" videos for recent HackerBoxes!

His HackerBox videos usually include a giveaway of the subject box. For the recap chat video, we decided to release, effectively for FREE, the remaining Mini Badges that we made for DEF CON 33. Grab yours HERE, while supplies last.

Obfuscate, Halt, Reverse

This C code should be ILLEGAL. It's also fantastic.

ob·fus·cate (v): render obscure, unclear, or unintelligible.

The International Obfuscated C Code Contest (IOCCC) has been consistently breaking human minds since 1984.

In the video above, LaurieWired attempts to decipher some severely obfuscated code using reverse engineering tools.

She also made a Reverse Engineering 101 overview.

Various additional interesting videos:

Reverse Engineering Embedded Hardware

Reverse Engineering IoT Devices

Reverse Engineering Ecovacs Robots

Reverse Engineering PCB Layers

Code Reverse Engineering Demo

#DIV/0!

Trippy Psychedelic Visuals to Mesmerize & Amaze 🎞️ Human Made Visual Art [No Repeat]

We hope you are enjoying this month's HackerBox adventures into electronics, computer technology, and hacker culture. We aim to curate a challenging and rewarding experience of learning through experimentation and exploration. Thank you for joining us on this journey.

Reach out and share your success in the comments below. Email support@hackerboxes.com anytime with questions or whenever you need some help.

Hungry for more? Surf over to HackerBoxes.com and join us as a monthly HackerBox subscription member. You'll get a cool box of hackable gear delivered right to your mailbox every month and you'll enjoy a generous member discount.

Please consider sharing this free Instructable with others who may be interested in learning about these subjects. Word of mouth advertising is the greatest compliment that we can receive. We sincerely appreciate your support.