How to Build a Smartwatch

2 hours ago 1

Thanks to everyone for posting pics of their new Pebble 2 Duos!

Thanks to everyone for posting pics of their new Pebble 2 Duos!

This blog post is MUCH longer than I intended. It’s way too long. I can’t imagine that anyone will finish it. How about this - if you have any questions about what’s written here - post a comment below and I will try to do a follow-up Tick Talk episode soon answering these questions and generally summarizing the whole post.

Quick update on Pebble 2 Duo (P2D) shipping status#

We’ve sent an email to everyone who pre-ordered a P2D to confirm their address and order information. Search your email/spam for [email protected]. If you haven’t received it, please email us and we’ll help get your watch shipped out asap! We’ve now manufactured all the P2Ds that will ever be made, and sent them to our fulfillment warehouse.

P2D shipping stats:

  • 50% - delivered
  • 30% - in transit
  • 20% - will be shipped over next 2 weeks (we ran out of stock of orange straps, more are arriving at warehouse on Wednesday)

Honestly, the last 2 months have been pretty stressful. Getting P2D through production was a major pain (which is normal for hardware products - luckily I had repressed all my memories of this or else I would have never begun doing hardware again 😂). We’ll finish shipping out batch two about 2 months behind my initial August estimate - which is simultaneously good (could have been longer!) and bad (gosh, I should have known better than to ever have put a date down).

Pebble 2 Duo is sold out! We are not making more. If you want a Pebble, I recommend pre-ordering a Pebble Time 2 soon.

Setting expectations#

Guess what? Shipping out thousands of brand new watches is not actually our finish line - it’s the start of the real software saga. Now y’all are actually using it and finding all kinds of interesting little bugs and features that aren’t working yet (as I explicitly mentioned in March, not all features would be ready at launch).

Keep in mind, during the first era Pebble Tech Co had 180 full time employees. We currently have 5 full-time people including myself. Why not hire a bunch more people? Well, that’s one of the reasons why the original company doesn’t exist anymore. This time around, the name of the game is sustainability. I want organization to be sustainable. That means optimizing everything for the org continue to be profitable (ie so it can continue to exist). I want to keep selling cool watches, building more software, maintaining the Pebble appstore and providing support long into the future.

This is a relatively long blog post, it’s up to you if you want to read it all! I’d recommend just reading the following section if you’re pressed for time and/or bored already.

Compared to before, this path requires trade-offs and setting expectations, especially when it comes to software development, customer support and bug fixing. Here’s how we’re thinking about that:

  • Core features (telling time, receiving notifications, controlling music, step/sleep tracking, installing apps/faces, long battery life) should always work well
  • Customize your Pebble (with apps, watchfaces, a myriad of settings, alternative mobile apps) but recognize that there will be rough edges, bugs, old apps that don’t work correctly, etc.
  • Things that once worked may stop working! Hopefully they will start working again (sometime).
  • You might have to occasionally tap something 2-3 times to make it work. Getting something to work 100% in all situations is actually very hard. If we made this a goal it would occupy all our time, and we’d never find time to build new things.
  • That having been said, we’re staying focused and not trying to add a ton of new features (each feature makes the system more complex, more ways that the whole system can break, more testing that needs to be done).
  • Customer support is provided my brave colleague Claudio and me. We’ll provide basic support but we’re not going to be able to walk you through how to use your watch via email.
  • This is a just fun smartwatch. Remember to breathe. You literally couldn’t buy a new Pebble for last 9 years. Now you can.
  • If you see a bug, we’d love if you could report it to us in the Pebble mobile app (Settings → New Bug Report).
  • But even better, since PebbleOS is now open source, if you have the technical ability to do so, try to fix the bug and submit a PR!

Near-term software roadmap#

Here’s our 100% subject to change software roadmap, in roughly prioritized order:

  • Get PebbleOS ready for Pebble Time 2
  • Increase Pebble 2 Duo average battery life from 17 days (current) to 30 days
  • Add language and character set packs into Pebble app (though you can use them now)
  • Little quality of life improvements (feel free to suggest them to us! Pebble app → Settings → New Bug Report)
  • PebbleKit Android - enabling companion apps like MusicBoss (no plans to get PebbleKit iOS working, sorry)
  • Make watch settings adjustable from mobile app (enables more customization without overloading the watch interface)
  • Notifications - this is going to be a huge focus for us. Think: custom vibe patterns per app/person, view chat message history (will probably require Beeper 😉), filtering out ads.
  • Developer SDK - big stuff in works! Improvements to Pebble Cloud, a new way to write Pebble apps/faces in JavaScript (in addition to C), new APIs for touchscreen and speaker
  • Adding a voice assistant - set alarms/timers, create reminders, add notes, send messages (will require Beeper), ask simple questions (what’s the weather forecast, when’s the next Caltrain, open XXX app)
  • Pebble Canvas/watchface generator - my colleague Steve (the creator of Pebble Canvas) has some ideas…

Know how to code and want to help out? Here are some project ideas, but really I recommend just starting to build a feature you personally want!

  • Adding barometer driver to PebbleOS (for P2D)
  • Supporting RtL languages (think Elbbep but built into PebbleOS)
  • Adding full timeline support or mess around with (Android) notification support to libpebble3
  • Helping out with Micropebble
  • Building cool watchfaces and apps using the SDK!
  • Helping with an eventual migration from FreeRTOS to Zephyr

How to build a smartwatch - software!#

Continuing my theme of ‘how to build a smartwatch’ (see last post: picking a chip), let’s talk software. A smartwatch requires 4 main pieces of software:

1. Operating system, sometimes called the firmware that runs on the watch 2. Companion iPhone/Android mobile app 3. Software Development Kit (SDK) for developing apps/faces 4. Cloud software for an appstore and other services

Everyone says ‘hardware is hard’. This is correct, but not for the reason most people think! I think building good embedded software is actually the hardest, most expensive and most unpredictable part of creating a consumer hardware product like a smartwatch. Ironic, I know.

One important lesson I’ve learned regarding embedded software is that you can actually ‘be done’. During our heyday, we released PebbleOS updates every month or two for 4 years straight. Then, after December 2016, those updates stopped. And guess what? My Pebble kept working. I still got notifications reliably, I could control music on my phone, I got a buzz from my calendar before my next meeting. Unlike web or mobile software, there’s no bitrot, no dependencies that disappear (cough left-pad), no requirement for more and more RAM to run the same software.

Pebble Software History

Firmware started on inPulse as a while() loop and evolved from there. When PebbleOS development began in earnest in 2012, there weren’t not too many options for open source embedded OSes. We ended up using FreeRTOS as the kernel. Zephyr didn’t exist at the time. For 4 years, we had on average 20 firmware engineers working full-time on PebbleOS. Overall, we probably invested $15m+ developing it.

Roughly 10 days after the Kickstarter launch in 2012, the team hastily assembled to figure out how tf we were going to actually do it

Roughly 10 days after the Kickstarter launch in 2012, the team hastily assembled to figure out how tf we were going to actually do it

On the companion app side, we looked at cross platform libraries like Cordova, but decided to make separate iOS and Android companion apps. The Pebble appstore was written as a webapp, and displayed inside an embedded webview.

For 3rd party developers, we put TONS of effort into our software development kit (SDK) which encompasses all the tools that developers used to write software for Pebble. I’m extremely proud of our SDK - it was a huge investment for us and I think it really paid off! Over 10,000 apps/faces were published on the appstore. More importantly, we spent a lot of time with the people behind the apps. Many told us that they actually learned to code for the first time with Pebble! Someone even wrote a book about it. My favourite part were the developer retreats, where we flew in 50+ Pebble developers to our office to hang out, try our new SDK and give us feedback. So many great things were created in the community like httpebble, Cloudpebble, watchface-generator.de. At first our SDK was entirely based on C, later we added the ability to write watchfaces in JavaScript with Rocky.js.

Back in 2012, we refused to call it ‘the cloud’ so instead we called our web services the ‘Sky Castle’. That evolved into the Pebble appstore, voice-to-text, and the over-the-air firmware update system. Before Pebble assets were acquired in 2016 by Fitbit, we negotiated and built a backdoor in the Pebble iOS and Android mobile apps which enabled these apps to be used with alternative cloud services.

Immediately after, a group of community members (and later joined by some of my Pebble colleagues) started Rebble. They backed up a copy of all the apps/faces on the Pebble appstore and built open source replacement web services (watch the presentation on how it works!). Rebble also started building an open source companion app (Cobble) and funded hackathons to encourage developers to continue writing apps/faces. The community is alive and well, thanks to Rebble for keeping everyone engaged with a product that hasn’t been on sale since 2016!

In January 2025, Google (which had purchased Fitbit) open sourced the source code for PebbleOS. Now a new era of Pebble has begun!

What makes PebbleOS special

PebbleOS running on Pebble Time in 2015. Credit

Constraints breed creativity. And oh boy, was Pebble full of constraints. The original Pebble had a 144x168 pixel black and white e-paper display that updated at 30fps. It was powered by an STM32F microcontroller with 128K of RAM and 1MB of flash memory. We had 10 people on the team (total). We had to do a lot with a little, which really helped us focus on the core features that we wanted Pebble to deliver. There was no time or energy for fluff, distractions or features that we ourselves wouldn’t use. We turned to black and white graphical tricks that were used on the original Mac. The initial result was fun, quirky and efficient.

Later in 2013, we hired a full product design team, led by Itai and Liron, supported by Heiko and our amazing engineering team. That unlocked the next phase of even MORE quirkiness, beautiful animations, fun little easter eggs and more that launched with Pebble Time and its 64 colour e-paper screen.

Pebble felt retro when it launched because it didn’t have an OLED screen and used buttons instead of touch. These constraints and retro feel made it simpler for third-party developers to build beautiful watchfaces and apps, which spurned thousands of people to learn how to code and launch apps on the Pebble Appstore.

Here’s a random grab bag of other things that made PebbleOS special:

  • All Pebbles ran the same version of PebbleOS, rather than forking the OS for each new device. We took great pains to make new PebbleOS improvements backwards compatible to older Pebbles, eg 2.x on OG Pebble took 10+ engineers many months to build.
  • At the time, it was practically unheard of for an RTOS to support running dynamically loaded 3rd party apps safely in sandbox.
  • Pebble Protocol - an efficient extensible protocol that enabled us to switch pretty seamlessly from Bluetooth Classic to BLE.
  • Great SDK developer experience - get started in <5 mins. There’s even a remote developer connection that lets you hit build on your computer and within seconds see your compiled watchface running on your wrist.
  • It didn't try to replace your phone. It complemented your phone by acting as an accessory when it was needed and getting out of the way when it wasn't.

What else do you love about PebbleOS? Share it in the comments below!

Core Plans

Generally, we like how PebbleOS looks and feels right now. We’re not planning to make major changes to PebbleOS UI/UX. Since it was designed for a black/white display, it was ‘retro’ tech before that was cool! If the design of it annoys you, get an Apple watch or something. We’re going to keep things as great as they were before.

We’ve preserved backwards compatibility as much as possible. This means that our new watches can run existing Pebble apps and watchfaces. Communication between the watch and companion app will be stock Pebble Protocol - meaning existing open source apps like Cobble and Gadgetbridge work great. But we're not going to make backwards compatibility something that blocks forward progress. Pebble Tech Co had 180 employees. We currently have 5. As I mentioned before, the name of the game is sustainability. We can’t do everything.

Pebble mobile app#

It’s alive! Download it at rePebble.com/app.

Even if Google had open sourced the source code for the original Pebble iOS and Android apps, we wouldn’t have used it. Unlike PebbleOS, which is self-contained embedded C code, the old mobile apps contained dependencies and UI frameworks that have changed dramatically in the last decade.

Instead, we’ve built a new open source library called libpebble3. This library is ‘batteries included’ - designed to provide everything you need to build a Pebble companion app except for the UI. It’s a single cross platform (iOS, Android and desktop) codebase written in Kotlin Multi Platform (KMP). We’ve licensed libpebble3 under AGPL-3 with an optional commercial exemption for integration into a proprietary codebase. Learn about this strategy.

Our new companion app uses libpebble3 under the hood. Good news for those who have old generation Pebbles - new new app supports those devices too!

One major improvement that we’ve made is adding a local speech-to-text (STT) model into the mobile app. Previously, we relied on a cloud service like Google STT to transcribe voice input to text. This cost money and required uploading voice samples to a cloud service. With the help of Cactus Compute, we now offer a local on-device STT option. We still offer a high quality cloud STT option from Wispr Flow (AMAZING desktop app btw) for free, but we might need to put this behind a paywall because it costs real money.

While the new Pebble app is not currently open source, we’re happy that open source projects like Micropebble and Gadgetbridge are compatible with our new watches.

Why is our new Pebble app not open source? Two reasons:

  1. we’re planning to use it as a companion app for other devices so it’s not strictly a watch-only app anymore
  2. if PebbleOS, mobile app and watch hardware designs were ALL open source, it would be very easy for other commercial entities to leech off our work without contributing back. I decided to open source libpebble3 as a compromise. Here’s the explanation of that strategy.

Roadmap-wise, here are some of the new mobile app features we’re considering:

  • Adding Language packs and settings
  • Find my phone
  • Native appstore UI rather than ancient webview
  • Being able to connect 2+ Pebbles to one phone seamlessly, letting you easily switch between them without needing to disconnect/reconnect
  • Connecting Pebble health data to iOS and Android health APIs (if possible)
  • Major improvements to notifications (as discussed above)
  • Sending messages on Beeper from the watch (ie by voice or Send Text app). Probably Android-only
  • Pebble Canvas or Watchface-Generator-like functionality to create custom watchfaces right inside the mobile app

PebbleOS firmware plan#

Over the last year since PebbleOS source code was released by Google, our ~2 person firmware team has been working to add support for 2 new microcontrollers to the codebase (nRF52840 and SiFli, discussed more in this post). This rapid progress was greatly helped by hexxeh’s contribution - he integrated nimBLE stack, and the SiFli team who added a board support package (BSP).

You can check out the PebbleOS codebase and compile it yourself.

Each Pebble ships from the factory with the Pebble Recovery Firmware (PRF) which has 3 uses: a) test functionality in factory before final assembly, b) first thing a user sees when they turn on a new watch, and c) fallback emergency system in case of a bad over-the-air update or critical bug.

After getting PRF to work with the new watches, we shifted gears to focus on stability, reducing power consumption and making sure that all existing features of PebbleOS work correctly on P2D. We had to tweak the step and sleep tracking algorithms for the new IMU and writing new drivers for new components.

In parallel, the core Core team also worked with SiFli and our manufacturing partners on Pebble Time 2 stuff. We’re reusing and benefitting greatly from the 2016 work on the original Pebble Time 2 (we’re repurposing the old Emery platform name for apps targeting PT2) and most system apps already support the larger 200x228 pixel display. We still have to do some work to update other internal apps and figure out basic touchscreen integration.

One other major task this year has been integration of the Moddable Javascript runtime into PebbleOS. Huge shoutouts to the talented and friendly Moddable team who have done all the heavy lifting. Back in 2016, we supported basic JS watchfaces with Rocky.js but never really finished the project. Now Moddable runtime has replaced Rocky.js+Jerryscript with a full-featured runtime and SDK. You can even write apps that blend C and JS. Expect to hear a lot more about this in the near future.

We covered the near-term roadmap at the top of this post.

In general, we will tune PebbleOS to have great default settings and characteristics that match what I want out of my smartwatch. Where possible we will offer ways for you to customize (ie switches/toggles/controls) these settings to your liking.

Another background task is modernizing PebbleOS architecture and making it easier to port to other devices. Here are my colleague Gerard’s thoughts: it is fundamental to invest in modernizing PebbleOS or consider switching to another platform (eg Zephyr). There are quite a few aspects of the OS that are painful to work with, specially the foundations (low level, driver abstractions, WAF build system, etc.) Adding a 2nd platform (SiFli) is already showing that another one would start making things difficult enough to maintain.

Core Devices has contributed all our improvements to PebbleOS as open source code on GitHub, but our firmware development process is not being run as an open governance project. I am the benevolent dictator. Why? Open governance is just not my area of expertise and I’m personally more interested in building cool gadgets than learning about how to do it well.

Gerard has served on the Zephyr working group for a while - his advice is that we could look into moving management of the fundamental operating system (drivers, architecture, SDK, compatibility layers) to the umbrella of a group like Linux Foundation or Apache Software Foundation, which have a lot of experience in open source project management. He’s also pushing for us to migrate to Zephyr instead of FreeRTOS as the foundation. This seems like a pretty reasonable goal, though it will be a pretty big software lift. Good news is that our bootloader for Pebble Time 2 is already built with Zephr.

Do you have any dream features you would like to see added to PebbleOS? No promises, but maybe if they sound cool and we think we’d use them as well, we’ll try to build it! Feel free to drop them in the comment section below.

Want to develop features or fix bugs in PebbleOS? We hang at #firmware-dev on the Rebble discord. You can also post issues, send PRs and follow the progress on GitHub. We can’t guarantee that we'll accept all PRs, but the good news is that it's quite easy to load your own custom-built firmware onto your Pebble. I expect in the future that there probably will be many versions of firmware for Pebble 2 Duos that offer a variety of different features and experiences. That’s the beautiful and complexity of open source!

Pebble SDK and developer experience#

TLDR: check out the developer.rePebble.com and try out the SDK (local or cloud)!

As I mentioned, the easy and (dare I say) fun experience of developing an app for PebbleOS is one of the most amazing benefits of PebbleOS. We want to preserve and invest time and energy in making it even better. When I think of a ‘target market’ for the SDK, I visualize a hacker who knows how to code (but not necessarily C), has a Pebble and wants to play around with the SDK on a lazy Sunday afternoon.

My priority is that a person completely new to Pebble development can go from zero to having a fun watchface compiled and installed on their watch in <5 mins. No install/compatibility/library issues. Everything should be self-explanatory (no tutorial needed). Great examples. From there, hopefully you have been sufficiently nerdsniped into building fun things for yourself. Maybe you will even share what you build with the broader Pebble community 😉

Most of this was already in place back in 2016. Developers wrote 10,000+ Pebble apps/faces in C and published them to the appstore. Our new watches will support all these existing apps!

Over the summer, our hyper productive intern Griffin made huge strides in modernizing the Pebble SDK and developer tools. He ported Pebble tool (and pkjs) to Python3 and wrote a VSCode extension.

Many of you probably remember CloudPebble - a web-based IDE, with a remote compile environment and emulator that enabled people to develop for Pebble without the complexity of installing the SDK on their computer. This was hugely helpful for people new to Pebble and new to coding in general. CloudPebble was developed as an open source project primarily by Katharine Berry. We looked at upgrading it and getting it to work again, but it would have been a huge effort.

Instead, we’ve begun working on Pebble Cloud SDK - a web-based IDE powered using Github Codespaces that let’s you develop and test Pebble apps/faces right in your browser. Highly encourage you to try it out today - it takes under 1 minute to get started! We’re planning to improve this, add more examples and make it even easier to use. It doesn't have as many features as CloudPebble and definitely isn't as user-friendly, but it's a good place to start.

Next up, we’ll be working on the following SDK related tasks:

  • Creating new code examples and documentation, especially for new Moddable JS apps
  • Improving developer.rePebble.com docs
  • Making it easier to use tools like Claude Code and Cursor to develop apps and faces
  • Create APIs for new hardware features on the new watches, like speaker and touch screen
  • Providing weather data as a system API, so each watchface does not have to include it’s own weather-retrieval code
  • Improving the Pebble Cloud SDK experience (it’s all open source, feel free to tweak it if you’d like and please submit PRs to the VSCode extension!)
  • Making it really easy to submit your apps to the appstore directly from pebble tool

One of the long-running ideas we're toying with is creating a complications API to enable watch faces to dynamically show widgets or data feeds from other apps or services. It's one of the rare things that I think Apple Watch does better than Pebble. Nothing concrete yet, but as soon as we have some ideas on paper we’ll share them and gather feedback. If you've got any ideas wrt complications, it would be great to hear them as well.

Appstore and cloud services#

The final piece of the software puzzle is the Pebble Appstore and various cloud services. I wrote about relaunching the appstore already. There many improvements we'd like to make to it like:

  • making it easier to discover fun and interesting apps and watch faces
  • filtering out apps/faces that no longer work, ie that use dead web APIs for weather
  • highlighting newer apps/faces, especially those that support PT2
  • better recommendations

Another big idea that’s in the back of my mind is creating a Humble Bundle-like pay-what-you-want donation subscription built into the Pebble app that funnels money towards developers, rather than devs needing to spin up their own payment service. If you’re a dev and interested in chatting about this, please send me a note!

We also use Memfault - founded by a bunch of Ex-Pebblers. This service manages over-the-air (OTA) PebbleOS updates, a cohorts system for managing deploying PebbleOS to alpha testers, and collects watch analytics to help us track down annoying battery-life and other bugs.

Next up is:

  • Bringing back weather and sunset/sunrise pins
  • Timeline support for 3rd party apps

Phew! This turned out much longer than I expected. I think I need an editor! But I’m really glad to get all this shared out. If you have any feedback or questions, please feel free to drop them in the comments below!

Read Entire Article