Better to find out you have a faulty OLED before it’s soldered to a PCB, right?
All of ours passed testing. These are the things you fill your time with to ease anxiety while waiting for the boards to show up from across the sea.
Ordering ESD bags. Designing custom lanyards. Making sure you have enough header connectors. Testing components. Ordering battery holders or LIPOs. Figuring out battery logistics. Can you take the batteries you chose on the plane?
Packing materials. Did you know you can get free flat-rate shipping boxes from USPS?
Stickers. It’s always cool to throw some stickers in there for good measure.
So this year DC540 decided to go through the exercise of creating a badge for Def Con 29. None of us had ever done this before. The most any of us had done was design a very simple minibadge with just one LED and one resistor. But a bunch of us are #badgelife addicts.
We had started with the idea of a simple door-based badge design with an embedded game/challenge for our first badge. But ambition got the best of us, and honestly, we needed something to set our badge apart from every other badge out there. Something to make it unique. Go big or go home, right? And after a few iterations, and a planning meeting or three, an epiphany came. I realized that our challenge, which involved unlocking different “levels,” seemed to overlap nicely with the tree of life (Kabbalah) concept, and the Kabbalah provides a rich visual canvas on which to project our gameplay progress.
Additionally, for those who study Kaballah, because we based our badge on the Raspberry Pi Pico, the badge provides a platform for writing your own application. Perhaps something to reinforce the correspondences between Kaballah, Tarot, astrology, I Ching, colors, hebrew letters, gematria, etc. If Kabbalah is your thing, then you’re probably well aware of what I’m talking about.
If you’re not aware, the origin of Kabbalah is beyond the scope of this description. Very briefly, I’ll summarize what it is and isn’t. It isn’t devil worship. Kabbalah, as Jewish mysticism, dates back at least to the late 1100s in Europe. Modern Kabbalah can be seen as a framework for interpretation of physical and spiritual reality. The version we chose to implement is the version used by Aleister Crowley.
The badge consists of two PCBs — the surface PCB has solder mask cutouts to allow the light to shine through from below, and also houses an OLED, six tactile switches (buttons) and a Shitty Add-On (SAO) connector. The bottom PCB houses the Pico (surface-mounted, thanks to its castellated edges! sorry, we’re not worthy of surface-mounting picos, holy crap!), 32 RGB LEDs and a wireless transceiver. The two PCBs are connected by a pair of 1×8 connectors, and a pair of M3 screws for stability. A lanyard will be included. The final badge will use black solder mask instead of green. Because black is the most magickal color.
We’re going to go ahead and offer preorders through Shopify. We expect to have them in hand prior to Defcon, and we will bring some out for those who want to buy them in person, but if you’re NOT going this year, and you’d like it shipped to you, that means we have less to carry to Vegas with us. :). The link should be in the sidebar.
Update 2021-07-10: What you’ll get: You’ll get a fully assembled badge, a battery holder and two AA batteries, and a custom lanyard.
Expectations: I 100% expect the LEDs to be fully functional, they were successful on prototype #2. This is our first badge, and by far the most complicated thing I’ve ever designed for fabrication. I got the 1×8 headers lined up right, yay! The M3 screwholes are sufficient, when populated with a long enough M3 screw, to keep the side-to-side wobble in check. I’m 95% certain the OLED will work. I fubar’d the prototype by orientating the 1×8 headers backwards on the top board. That screwed up my testing capabilities for the OLED. Expectations for the wireless transceiver (NRF24L01+) are a bit lower. We haven’t even nailed down exactly what we expect it to do, and I think I ran a trace too close to a pad, causing a short. So unable to test that either. They work fine on the breadboard, though, so we’ll continuing developing and testing with the aim of it working. Be honest, though. You’re buying this for the blinkyshit, or your a dirty occultist who’s up to no good, in which case you can use your magickal wizard powers to make it work (or just cut traces and fix it if it’s wrong in prod).
Mounting the Pico as SMD using the castellated edges was something I wanted to do from the getgo. It means more surface space for artwork, and less annoying thru-holes. It does add a layer of complication, though. Or a challenge. Hell, let’s call it a probletunity. It’s forcing me to up my hot air game. It’s harder, I will say. It’s hard to know when the paste is melted enough underneath to avoid shorts, and I really found myself looking closely in the thru-holes to see the paste bubble up and turn from gray to silver. I also worried that I’d fry nearby electronics, but I think my technique is sound, and I’m using low temp paste. I may try baking one in the T-962 at some point, once I figure out how to add new bake profiles to it. Nope. Too hard. Back to thru-hole for the Pico.
I can’t guarantee we’ll have them in hand for Defcon, as I’m relying on outside entities. But they’ve been great so far, knock on wood. So that’s our goal.
I gave a silly little “Intro to KiCad” presentation at our meetup last night, before the weather came and insisted we not congregate outdoors.
I shit you not, it happened almost too fast to document. “Oh look, the sky is threatening. Oh wow, the wind is picking up. Better get the electronics inside. Oh, there go the beer cans and a dessert plate. Holy shit.
Then everyone scattered home, and it really came down. We actually had hail. It was the first time hearing hail in our house. People were concerned. The cat was concerned.
Anyhow, I wanted to relay a problem/solution I ran across yesterday, because I hadn’t come across this particular solution to the problem in my Googling, and maybe this will help someone.
PROBLEM: When trying to do a 3D view, you get the dreaded “Cannot determine board outline” message and it will not properly render your board shape.
VARIANT 1: KiCad provides coordinates to look at. In most cases, this is because your board edges aren’t properly connected and locked together. Go around the perimeter, zoom in very close, and click both lines, observing where the square marking the end of the segment appears. If they are in the exact same point, they are locked together, move on to the next one. If you need to move one, move it until a circle with a square inside appears, that’s the locked/connected indicator while moving the line.
VARIANT 2: KiCad provides no further information, just the subject error message. This one took me a few minutes. I walked the perimeter and everything was fine/locked. I turned off all other layers’ visibility except for Edge Cuts and could see no stray segments. I was confused. So I went old school. Knowing that all of these files are just text files with information, I grepped the .kicad_pcb file for “Edge” and was treated with the following:
My first clue was that my board shape was a rectangle and there were five segments described. The second clue is that fifth segment was too short. Ridiculously short. Invisibly short. So I zoomed in at those coordinates, and sure enough, there was a stray dot of edge cut sitting there that couldn’t be seen without the zoom. I removed it, then everything was fine.
Documenting here in case it helps others. But if you don’t move your board outlines much, and don’t accidentally draw on the edge cut layer and forget it, this probably won’t happen to you.
It occurs to me that this happens frequently with other layers, I often end up with an extra dot of something that I discover later when zoomed in. It might be useful to have a routine or view that just highlights every sub-millimeter unnecessary portion of wire, mask, edge or silkscreen that was probably left there by accident. 🙂
So this thing we’re working on, you know. This is the second or third iteration of an idea, and it finally got enough momentum to, you know, be something. Or become something.
Originally, we were going to do it on maybe an ESP8266. Then maybe an ESP32. Then the Pico came out, and we’re like, fuck it, let’s ride the wave of momentum of this new awesome microcontroller and see what we can do with it.
Well, it’s amazing, and awesome, and wonderful, BUT it lacks wireless communication.
And we started looking into what it would take.
And found a couple of articles that piggyback an ESP32 to handle the comms.
Meh. Nah. Number 1, if we wanted an ESP32, we’d just use an ESP32. Number 2, we don’t need, or even want, full wifi. We just want communication between units. For this thing of ours.
Then I saw that I can get this model of the NRF24L01+ for just a buck a piece.
Like the Pico, it has those glorious edges that can either be thru-hole (albeit half pitch) or surface-mount. I love that, you all know I love that. I love that you can mount it on a board and the other side of the board can be virtually unmolested.
So I picked up a few for testing.
And dang, they’re small.
And this half-pitch bullshit presents a problem for traditional breadboarding.
Fortunately, I have some SMD breakout boards that fit this perfectly. Let’s put a couple together for testing.
OK, now that I can breadboard this, let’s find some software for it.
and connect the appropriate pins on your Pico to the correct pins on the NRF24L01+:
So I did all this, and fixed the connections so that I wasn’t getting hardware failures. I did it twice, because the example code has a master function and a slave function. Yes, I know, these are now outdated terms. Maybe someone should tell them to update it.
Anyhow, nrf24l01test.master() broadcasts a packet with the milliseconds, and wait 250ms for a response. nrf24l01test.slave() will listen for those packets, and if one is received, send a response. I ran it, excitedly — one pico/nrf24l01 assembly running nrf24l01test.slave() and another running nrf24l01test.master()… and…
Nothing. Response timeout. Consistently. So I googled a bit, and found that with some devices, a capacitor is needed “to smooth the current.” Some docs say 10uf, others say 100uf. I found that 10uf cut the failures to about half, and 100uf eliminated the failures. With a 100uf capacitor between VDD and GND on the transceiver, responses come back steadily, even if I take the sender into another room, 30 feet away, even to a different floor of the house, with walls in between. I’m impressed.
Interesting info: I had so much trouble finding a KiCad symbol and footprint for this device that I started to build my own. But then I found one by accident in the mysensors repo. Important note: Pay attention to the symbol on this one. The symbol as provided in mysensors has VCC on pin 2 and GND on pin 1, but the units I received have VCC on pin 1 and GND on pin 2. I suspect that’s the reason for one review of the unit I ordered stating that the pinout was nonstandard. I don’t know what’s official and standard, but the pinout on the units I received match the photo above, so maybe mysensors is wrong, or maybe there is no standard. Just be aware so that you don’t smoke your transceivers.
Update: LOL. I take it back about the pin 1 vs 2 confusion. Look what they did in the footprint!
OK, Actually it will be Hybrid. We want to be inclusive to those who can’t make it out. We’ll be talking about badge planning, and I’ll give a demo of PCB design and how to build a badge in KiCad, from a blank slate to fabrication. You can put your filthy grubby hands on the early prototypes of the badge we hope to release at “summer camp” this year.
Weather looks good for a backyard meetup. I’ll see if I can bring a large-ish screen out to the table so everybody doesn’t have to crowd around my laptop. And I’ll stream the screen in the Discord so everyone can see it.
So here we are, it’s 2021, Def Con is hybrid this year, and we procrastinated long enough. We wanted to put together a badge for last year, but with the con being fully virtual, we lost motivation. There’s something about the idea of being in person for our first badge presentation that appeals to all of us.
Except Kevin, who hates crowds. And I get it.
So we were still on the fence until the org made the announcement and we decided to push forward. Then it became, “oh shit, do we have enough time to put a badge together?”
The answer became “fuck yeah.” Despite the fact that none of us has ever created a badge before. We’re just a bunch of nerds with a #badgelife fetish and some audacity.
The badge is based on the Raspberry Pi Pico. It will likely be released as a locked UF2 firmware compiled from MicroPython with some secrets and challenges in it. The artwork is shaping up to be sufficiently attractive to sit proudly in any #badgelife collection. And because the base is the Pico, it will be easy to update firmware, either with future releases from us or with your own cool ideas. I won’t spoil the artwork now, but certain subcultures might be very interested in the design functionality and I suspect some will find their own uses with their own code. I hope when this happens that they feed it back to us through our Github so that it can be shared with the community.
We currently have two needs for the badge:
(1) I would love for someone with #badgelife or other PCB design experience to help design a Lipo charging circuit for the badge. According to the datasheet, it should be able to charge through the existing USB port and power the badge accordingly. If we don’t get this reliably resolved, we’ll use battery holders and 2xAA batteries. Power usage is minimal on the Pico, even with neopixels and an SSD1306 OLED display. I just started testing powering the circuit by battery today, and at this moment I’m at nearly 7 hours of runtime, and that’s before we optimize power usage. For this test, the screen is always displaying or scrolling something, and 10 LEDs are cycling.
(2) Looking for someone with graphic design experience to come up with a lanyard design which fits the theme of the badge. Without spoiling the badge, there is a bit of an occult theme to the badge artwork, it would be great if that theme translates to the lanyard as well.
Sorry, no spoilers until the final boards arrive. First prototype should arrive this week.
So thanks to Kyle, I’ve got a 2019 SAINTCON Enigma Badge to play with for a while.
I’ve been mildly frustrated by the fact that I haven’t gotten anything to decrypt on it yet using the 2019 instructions, sample messages and code sheet. I had just gotten comfortable with that fact when the Hackers Challenge CTF came up during this year’s SAINTCON. I lost quite a bit of time to trying to solve an ENIGMA challenge, because I HAVE the badge right here in front of me but still had a knowledge block that was preventing decryption. Had I learned before the CTF, I would have gotten another 300 to 400 points.
So now, even though the challenge is over, I was even more determined to see this through.
Here are the 2019 instructions, with my commentary following:
Okay. Instruction 1 says “Apply the daily key from the code sheet to your Enigma machine.” This is a sample of what the Code Sheet looks like. While it is unclear from the instructions AND the Code Sheet, I assumed that “daily key” refers to the “ring settings” or Ringstelling.
What threw me was the plugboard. When I entered settings, there was a PLUGBOARD section on the badge that wouldn’t accept any input. Naively, I assumed that was an unimplemented feature. Boy was I wrong. I wasn’t at SAINTCON last year, so I missed a critical piece — the critical piece is that the plugboard is a PHYSICAL plugboard on the badge, just as it is on the real thing.
Once that Eureka moment came (thanks to atru5 and kfeuz for clueing me in), it was smooth sailing all the way to the finish line. God I want one of these of my own.
Here’s the sample message and the code sheet for that day, followed by the images of the message decoding after setting all the rotors, ringsettings and encrypted message key, and connecting the plugboard up properly with jumper wires:
If you want to play with the Enigma yourself, you can use the simulator on Cyberchef. For the SAINTCON simulations, you will need a custom rotor. When the code calls for rotor IX, use the following: BASHCOMPUKIDZERGYJWLQTFXVN
What an exciting time to be alive. The badge itself will be a really fun platform for collecting minibadges. A minibadge came with it, as well as a coupon for three copies of my own minibadge, which I designed today as part of the Hackers Challenge CTF that’s going on during the con. Strongly recommend y’all get one before they run out. Very affordable for the level of fun and creativity involved.
Just kidding. When I was lining up to buy this year’s SAINTCON badge, I saw they had the board/LED display available super cheap, so I bought one. If I can’t have the full ENIGMA badge, at least I can have a fun replica. Never mind that I have no earthly idea how to connect to it to light it up. All in good time, my friends.
[Update] — OK, I figured out where it connects. That was easy. Just almost too tiny for my poor old man eyes.