HackerBox 0119: Geopositioning
by HackerBoxes in Circuits > Microcontrollers
2067 Views, 4 Favorites, 0 Comments
HackerBox 0119: Geopositioning
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
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)
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
This project works with the ESP-WROOM-32 Development Board.
Let's test out the Development Board on its own prior doing any soldering.
- Attach the ESP32 Dev Board to a computer using a USB-C cable
- A solid red light will illuminate
- Install the Arduino IDE (if you don't already have it)
- In the IDE, use the Boards Manager to search for ESP32 (by Espressif Systems)
- Select that board package and hit install
- From the top menu, select Tools > Board > esp32 > ESP32 Dev Module
- Select Tools > Port (COM port that appears when the ESP32 is connected and turned on)
- Open the sketch File > Examples > Basics > Blink
- Add the line #define LED_BUILTIN 2 at the top of the sketch
- 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
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:
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:
The TYL also routes these I/O and power nets to a twelve pin expansion header:
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.
- 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.
- Solder the pads of the GPS Module. If you are new to soldering castellated modules, review this SparkFun tutorial.
- Solder the two display module headers (14 pin and 4 pin as discussed above) onto the back of the display module.
- 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.
- 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
You'll need three files attached to this Step.
- Arduino sketch: TYL_GPS_Map.ino
- US.bmp (right click and save the image above)
- 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...
- Find the map you want to add - a good source is the Export feature on OpenStreetMap
- Use a photo editor (e.g. Gimp) to scale/crop an image of the map to 320x240 pixels
- Save that image as a 24bit BMP file
- Copy the file onto the SD card
- In the sketch, find where the array maps[] of structs mapData is initialized
- Add another structure initialization line with the bmp filename and four numbers
- The four numbers are the bounding latitudes and longitudes of the map
- 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
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:
- Head over to the CYM WEBFLASHER
- Plug in the TYL
- Hit Connect
- In the pop-up, select the TYL USB port
- 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
- Repeat as necessary, the timing can be tricky
- Under SELECT BOARD, select CYD Single USB (with GPS)
- Under VERSION, select Current
- Wait for the "Flashing..." progress bar to complete
- Hit the reset button on the ESP32
Hacker Movie Stickers
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
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
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
#DIV/0!
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.