Expanding Zigbee Range with Ikea Tradfri Repeaters

My brand new Aqara Sensors were on the very edge of my Zigbee range, resulting in unwanted disconnects every few days. Fortunately Sweden’s largest contemporary designer has a cheap solution … though getting it to run with Home Assistant was a bit of a challenge. The temperature, humidity and pressure sensors linked to Home Assistant in a previous post were working great … until they stopped, requiring a reset. Which would solve the problem for a day or two before reoccurring… these sensors were too far away from the Raspberry Pi with the Zigbee receiver to have a stable connection, so a repeater was required to extend the range. I noticed Ikea actually has a few Zigbee devices, and the repeater I needed, maybe … as it was not clear if this would work with my Aqara Sensors and Home Assistant, though given these are only 10 bucks I picked one up and started experimenting… Switching to HomeAssistant OS Initially I was running Home Assistant Core from a Python virtual environment and using Supervisor to make sure it was initiated on boot and restarted upon failure. This allowed me to run a few other applications on the same Raspberry Pi, Read more…

BusyBoard: no more interruptions during meetings

Working from home has become the norm since the start of the COVID-19 pandemic for me, and it doesn’t look like this will change in the near future. As working from home goes hand in hand with online meetings it can come in handy to be able to notify members of your household that you are busy and prefer not to be interrupted. While there are low-tech solutions available (e.g. putting a rubber band on the door knob …) I decided to make a web app to do this. During tech job interviews it seems to be common practise to ask applicants to develop a small piece of software during a rather limited amount of time. Only having worked in academia this concept is foreign to me! To check how I would hold up during such an interview, I decided to set a time limit for myself of four hours (half a working day) and see how far I would get. Picking the right tools To do this efficiently it is imperative to pick the right tools for the job. As this is a webapp, using Flask is for me a given as this is the framework I’m most comfortable Read more…

Publication Survey: Security Considerations For Bluetooth Smart Devices

Bluetooth Smart is an emerging short range wireless technology aimed for low power devices. Bluetooth 4.2 core specification provides various methods to secure the communication between devices and establish trusted connections. This paper describes the design considerations to secure the Bluetooth smart devices. 1. Introduction Bluetooth smart (also known as Bluetooth low energy or BLE) is introduced in the legacy Bluetooth 4.0 specification by Bluetooth special interest group. Bluetooth smart is primarily designed for low power embedded devices with limited computation capabilities. With expeditious growth in the IoT technology, Bluetooth Low Energy Module has become substantiate criterion for the smart devices. Bluetooth specification supports the asymmetrical architecture of the LE devices. Memory and processing power requirements of peripheral devices are much lower than the central. This will be a great advantage in case of single mode – peripheral only devices. Device that acts always as peripheral can be designed with low memory, longer battery life and low power consumption. Low power smart wearable devices available in market such as Bluetooth heart rate monitors, blood pressure monitors, fitness kit, smart watches etc. run on a small coin cell battery for years. 2. Low energy, Low security Like any other wireless technology, Read more…

Continuous improvement with PDCA

As a QA an important part of your tasks consists of continuous improvement of your Test and delivery process. Being a key member of your organisation you will have to participate in different workshops, meetings and trainings in order to figure out the best balance you and your team can achieve within the classic challenges of Cost Time and Scope What is PDCA ? SQA ? According to Wikipedia : PDCA (plan–do–check–act or plan–do–check–adjust) is an iterative four-step management method used in business for the control and continual improvement of processes and products. It is also known as the Deming circle/cycle/wheel, control circle/cycle, or plan–do–study–act (PDSA). Software quality assurance (SQA) consists of a means of monitoring the software engineering processes and methods used to ensure quality.[citation needed] The methods by which this is accomplished are many and varied, and may include ensuring conformance to one or more standards, such as ISO 9000 or a model such as CMMI. Based on the definitions above it is obvious that the PDCA method is — regardless of your organisation strategy — a good fit for your overall quality assurance approach to improve the delivered products. PDCA Cycles Below each cycle Plan — Do Read more…

Clustering the Palmer Station penguin data, using PyMC3

This post will be all about trying to infer the species various observations originated from, without actually having access to the labels. This might sound like a far-fetched example, but it happens more often than you might expect in biology! When studying large animals you can usually find clear differences between species, but when studying nematodes (tiny worms) in a soil sample those differences might be very hard to spot! You can also have a sub-population that slightly differs from the main community, for instance polyploid plants (with extra copies of their genome) might grow in the same field as plants with normal ploidy. These are considered the same species and are similar in most ways, except a bit bigger or stronger or more tolerant, so while making initial measurements these might not stand out. Or indirect measurements, some animals are rare and live in remote places, so biologists might use footprints to study those animals. If multiple species leave similar prints … they might have to resort to using their size, distance between them, … to estimate which exact species a set of prints belongs to. So the solution is to measure as many subjects as possible and (hopefully) Read more…

Improving blogs with custom Jekyll Plugins

This blog is built using Jekyll, which can be used to generate a static website based on a set of templates (for the layout) and markdown files (for the content). The main advantage is that GitHub pages can be leveraged to host those static pages for free. However, while there are plenty of great themes available, some features I really wanted are usually not included. Fortunately, Jekyll supports plugins to fill those gaps, here you’ll read about some plugins I made for this blog and Beyond the Known (a travel blog). Getting started For both blogs I’m involved in, the Centrarium theme was used as a starting point. This theme already included many bits and pieces I wanted. There really isn’t any need to re-invent the wheel for every project. I did make a number of changes to the theme, for instance I removed support for HighlightJS in favor for default code highlighter present in Jekyll. I also prefer LightGallery over Lightbox, so I swapped that out as well. These changes are pure html, js and css, you just need to pinpoint where the relevant code in the _sass, _includes or _layouts folder and make the change. However, I wanted Read more…

BLE pairing vs. bonding

Just a quick writeup on the difference between pairing and bonding, since these terms get used interchangeably. I think this has to do with the usage of ‘pairing’ in Bluetooth Classic, or BR/EDR. As far as Bluetooth LE is concerned, pairing and bonding are two very distinct things. The short explanations are that pairing is the exchange of security features each device has, and creating temporary encryption. Bonding is the exchange of long term keys AFTER PAIRING HAS OCCURRED, and STORING THOSE KEYS FOR LATER USE. Pairing is not the creation of permanent security between devices, that is called bonding. Pairing is the mechanism that allows bonding to occur. Pairing Pairing is the exchange of security features. This includes things like i/o capabilities, requirement for man-in-the-middle protection, etc. The client side begins this exchange. The client essentially says ‘hey, i’d like it if you had these features’. The server replies, ‘yeah, well, this is what I can do’. Once this exchange is made, the security that will be used has been determed. For example, if a server supports just noInput/noOutput for i/o capabilities, the Just Works pairing mechanism is going to be used. Once the pairing feature exchange is complete, Read more…

Genetic Art Algorithm

Genetic algorithms are fun, they require a different way of thinking. Here I’ll guide you through my process of building an algorithm that evolves 150 random triangles into a famous piece of art. The work I picked to re-draw: Van Gogh’s The Starry Night. The original and the version the algorithm created after 5000 generations are shown below. The code for this post can be found on GitHub here Update 25/03/20201: There was a change in the Evol API in version 0.5.2 where the function apply() has been renamed to callback(), the code here and in the repository has been updated. Genetic algorithms Before we start, a quick word about genetic algorithms. There is a rather lengthy description on WikiPedia, but here we’ll keep it short and simple. These algorithms are heavily based on biological principles of inheritance, breeding and evolution. You have a number of solutions, called the population. Each individual solution having a list of items, values, … called the chromosome. There is a fitness function to assess how good a certain solution is for our problem. Within this population, individuals can be removed (the ones with the worst fitness), they can breed (combine their chromosomes into a Read more…

Can ChatGPT write a Python GUI app for me?

Imagine being able to create a fully functioning Python GUI application with just providing instructions. No need to spend hours writing and debugging code, you’d just let AI do the heavy lifting for you. In this post, we’ll explore the capabilities of ChatGPT in developing a Python GUI app and discover just how easy it can be to bring your ideas to life. In this post, we will be creating a simple yet powerful Python GUI application that helps users generate captions for images quickly and efficiently. The app will display an image and provide a user interface for the user to write a caption for that image, which will then be saved in a corresponding text file. This can greatly speed up the process of creating captions for images, which is an essential step in training other AI systems like Stable Diffusion. When working on larger projects with an AI like ChatGPT, it’s essential to take a step-by-step approach. This allows the AI to improve on relatively small parts of the project in each iteration, rather than trying to tackle the entire project at once. By breaking the project down into smaller, manageable tasks, you can ensure that the Read more…

PCA Plots with Loadings in Python

Like the previous Code Nugget, this bit of code will add some often needed features to PCA plots done with Python. Here the loadings and variance explained will be added to the plot, this is something that is included by default in R biplot(), but in Python there is more too it. Like the last plot, the code isn鈥檛 difficult, but to get it to work it does require a fair bit of digging in the documentation to find out how to add this in. First, the Iris dataset is loaded, some example data is required for these bits of code and as this dataset is readily available it is a very good choice. A few lines of code are added to turn the dataset into a Pandas dataframe. from sklearn.datasets import load_iris import pandas as pd import seaborn as sns import matplotlib.pyplot as plt iris_obj = load_iris() iris_df = pd.DataFrame(iris_obj.data, columns=iris_obj.feature_names) iris_df[“species”] = [iris_obj.target_names[s] for s in iris_obj.target] iris_df.head() 聽 sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) species 0 5.1 3.5 1.4 0.2 setosa 1 4.9 3.0 1.4 0.2 setosa 2 4.7 3.2 1.3 0.2 setosa 3 4.6 3.1 1.5 0.2 setosa 4 5.0 Read more…