Start Building with Web Bluetooth and Progressive Web Apps

A Short Introduction Web Bluetooth is a a new technology that connects the Web with the Internet of Things. Web Bluetooth is so new, it’s still being built and prototyped! But of course, that doesn’t mean we can’t play with it… Essentially, Web Bluetooth lets you control any Bluetooth Low Energy device (smart home appliances, health accessories like heart rate or glucose monitors, temperature sensors, etc.) directly from your PC or smart phone, without having to install an app first. Web Bluetooth will eventually enable developers to build one solution that will work on all platforms, including both mobile and desktop, which means lower development costs, more open source control interfaces for various physical products, and more innovation. Evenings are best spent with fine wine, fine company, and Web Bluetooth In this post I will explain the basics of Web Bluetooth by building a demo web app that controls the smart bulb that I reversed engineered in the previous post. In addition, I’ll explore how you can extend this app to become a Progressive Web App, which is an exciting new approach that we’ll go into later in the post. I will assume for this tutorial you have basic familiarity with Read more…

Pagefind: Search in a static website

Adding a good search to a website is hard in any case, but with static website good options are few and far between. Pagefind is a game-changer and makes this very simple! It already has been added to this site, so for a quick demo click the search icon in the navbar at the top of this page. If you are interested in adding a similar search to a website yourself, keep on reading. The idea behind Pagefind is remarkably simple. You include a bit of CSS and javascript provided on their site and generate it per usual. Before uploading however you run Pagefind, which will crawl over your generated pages and create an index that the bit of javascript code you need to include will use to find relevant pages base on the provided search terms. The static pages, along with the index Pagefind created need to be deployed, and you are good to go. Installing Pagefind and getting started There are a few options available which can be found in the Pagefind documentation. On my system (Windows 10) running it through [npx] didn鈥檛 work, so I opted to go with the binary version. For this website, the release Read more…

Integrate BusyBoard into HomeAssistant

Let’s take the little app created in the previous post up to the next level and integrate it into a home automation platform Home Assistant (HA). That way if you change your status on the BusyBoard, Home Assistant can pick this up and trigger an automation. Here we’ll add an API to BusyBoard which can be read easily from Home Assistant so we can turn a smart light on (and switch the color to red). While the BusyBoard was a nifty solution to indicate to your household when you are busy with work and should not be interrupted, this does require everyone to check the BusyBoard regularly. Not the most user-friendly experience! It would be far more convenient if we can somehow indicate thi in the real world … similar to an “On Air” sign in radio- and tv-studios. As I’ve already got a few smart lights linked up with HA this can fairly easily be done, but we’ll need an API in BusyBoard we can read from Home Assistant, so let’s implement this. Adding an API to BusyBoard If you are developing a larger application an you need an API, have a look at packages like Flask-Restful or even Read more…

The History of Bluetooth: From Concept to Ubiquity

In the 1990s, the world was on the cusp of a wireless revolution. The rise of mobile phones, laptops, and personal digital assistants (PDAs) had created a demand for a technology that could connect these devices without the need for cables. This was the genesis of Bluetooth, a wireless personal area network (PAN) technology that has since become ubiquitous in modern life. The Conceptual Phase (1994-1997) In 1994, a team of engineers at Intel, led by Dr. Jaap Haartsen, began exploring the concept of a wireless technology that could connect devices over short distances. They were joined by engineers from IBM, Toshiba, and Nokia, and together they formed the Bluetooth Special Interest Group (SIG). The name “Bluetooth” was chosen in honor of a 10th-century Danish king, Harald Blåtand, who united warring factions in Denmark – a fitting moniker for a technology that aimed to unite disparate devices. The First Specification (1998) In 1998, the Bluetooth SIG released the first public specification, version 1.0. This initial release defined the core principles of Bluetooth, including the use of radio frequency (RF) signals to transmit data between devices, and the concept of device discovery and pairing. The specification also outlined the various profiles, Read more…

SE and 7816 Protocol: The Core of Smart Card Technology

Smart cards have become an indispensable part of our daily lives, used in various applications such as finance, transportation, and identity verification. At the heart of smart card technology lies the Secure Element (SE) and the 7816 protocol, which together form the foundation of security and reliability. In this blog post, we will delve into the history, application scenarios, technical details, and implementation methods of SE and 7816 protocol. Secure Element (SE) Definition A Secure Element (SE) is a microprocessor chip specifically designed for security applications, used in smart cards, mobile devices, and other electronic devices. The primary function of an SE is to provide secure storage, computation, and encryption services, protecting sensitive user information from unauthorized access or leakage. History The history of SE dates back to the 1980s, when smart cards were first emerging, and there was a need for a secure microprocessor to protect user information. As smart card technology advanced, SEs evolved to become more secure, faster, and reliable. Application Scenarios The application scenarios of SEs are diverse and widespread, including: Smart cards: SEs are the core component of smart cards, responsible for storing and processing user information.Mobile devices: SEs are used to protect user information Read more…

PyScript: Python in the browser!

At PyCon 2022, PyScript was announced as a way to run Python in the browser and it has made waves in the community since. While there are some really cool demos included in the project, the project is still in early stages of development and the documentation is lagging a bit behind. So let’s have a look at some common things JavaScript is used for, and how to do the, in PyScript. All code from this post can be found on GitHub. To see the code in action, head over to http://4dcu.be/PyScript-Basics/. Getting started We’ll create three files, index.html, style.css and main.py, the former two will be the html page with a css file for some styling while the latter contains our custom code that will run through PyScript. Let’s start with index.html, we’ll define the bare minimum here to load PyScript, our css and Python code. PyScript Test rel=”stylesheet” href=”./style.css”> rel=”stylesheet” href=”https://pyscript.net/alpha/pyscript.css” /> src=”https://pyscript.net/alpha/pyscript.js”> PyScript status: id=”pyscript_status”>Not Loaded id=”clicks” pys-onClick=”increase_counter” class=”btn”>Count 0 id=”toggle” pys-onClick=”toggle_text” class=”btn”>Show Text id=”toggle_text” class=”hidden”>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus cursus mauris mauris, vel fermentum risus hendrerit tincidunt. Aliquam pulvinar tellus et iaculis vestibulum. In pharetra diam eu lectus dignissim tristique. Phasellus laoreet Read more…