博文

Problem and solving

图片
 Problem one: Microbit Bluetooth signal problem When testing the BLE based mesh data transfer, the Bluetooth signal tend to be very weak compare to other devices in the room. To solve the problem, I have tested the signal strength and the result is shown below.  Figure 1: Bluetooth signal strength test result This situation also occurs in the connection between the pi and microbit. The connection could be very unstable and may easily disconnect when using. 

Item checking

图片
 To make sure all the components are ready to use, it is important to use the demo codes to check every function is good on the micro bits v2. Accelerometer Thermometer  

Bluetooth related coding

图片
 To enable codes on Micro bits: v2, it is important to enable some Bluetooth related packages. The first package is called BlockyBLE, which is used to create a response when receiving some given data from another Bluetooth node.

Building BLE Environment

图片
 To begin with, as BlueZ is used as the Bluetooth stack of the raspberry pi 4, some services have to be enabled so that the mesh network could be generated.  Firstly, to enable the construction of a mesh network, service meshctl have to be installed. BlueZ is a preinstalled Bluetooth stack of all Linux systems. However, meshctl is not in the default package, so the first step is to install the latest BlueZ version.  Way to install BlueZ 1. Update the system 2. Install the dependents 3. Install the json-c 4.Install the ell 5.Install the BlueZ 5.50 6. Start meshctl menu Then, the environment should include the key part, zephyr project, which is specially designed to be used in Linux system. According to the guides on Zephyr Project, the recommended Linux system includes Ubuntu, Fedora, Clear Linux and Arch Linux. It is to say, Raspbian is not recommended in the project. This might cause unexpected problem in the programming and mesh construction. Here, we have two compile t...

System preparations and environment building

图片
 In the project, we decided to use a raspberry pi as the home-assistant server. In the raspberry pi, I have pre-installed the latest version official operation system Raspbian.  Detailed installing procedures are as followed. 1. Install the dependence and update the system with the following command.      $ sudo apt-get install python3 python3-venv python3-pip      $ sudo apt-get update      $ sudo apt-get upgrade –y 2. Create homeassistant account and set the password      $ sudo useradd -rm homeassistant -G dialout,gpio      $ sudo passwd homeassistant 3. Create the homeassistant working index      $ cd /srv      $ sudo mkdir homeassistant      $ sudo chown homeassistant:homeassistant homeassistant      $ sudo -u homeassistant -H –S 4. Create the environment for Python 3      $ cd /srv/homeassistant      $ python...

Basic Introduction

图片
 In most of the countries around the world, it has been a huge problem that many old people tend to live alone in a flat or a house without he company of their grownup children or a nurse. To make sure there is no unexpected accident such as heart attack or sudden falling down, there can be some kind of device to monitor the unusual behavior of the elderly without the invasion of their privacy. Basing on this idea, the project aims  to design a system consists of a raspberry and several Bluetooth based sensors. To make sure all the sensors could work together, the system will use mesh technology provided by the Zephyr Project. The official description of the project is  ‘ In the UK many elderly people live in homes by themselves and at some distance from their relatives. This project aims to develop a monitoring system that will record when people move around the home for example what time they get up, what time they go to bed etc. For privacy reasons only simple sensors ...