More work on thesis report

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2023-01-11 22:41:11 +01:00
parent 1168270444
commit bb50116cbe
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
13 changed files with 179 additions and 131 deletions

View file

@ -1,5 +1,6 @@
\chapter{Preliminaries}
\section{Web Worker}
\label{section:webworkers}
Web Workers are a web API that allows running JavaScript code in background threads in the browser. This way you can run CPU intensive processes without stalling the main thread and locking up the UI.
There's a few limitations with Web Workers. A Web Worker doesn't have access to the \gls{dom}, to the window object and to some web APIs.
@ -35,9 +36,7 @@ Manchester is a simple encoding code for the transmission of binary data. The da
The advantages of manchester encoding is that there are no prolonged high or low signals and the original clock signal can be extracted from the signal, on the other side the bandwidth requirements are doubled as two bits in the signal are needed to encode one bit of the original data \cite{manchesterCode}.
\section{Hall Effect Sensor}
\label{section:hallEffectSensor}
A Hall Effect Sensor is a type of sensor to measure the strength of magnetic fields. This type of magnetometer is found in many smartphones today \cite{hallEffectSensor} and is generally used for compass capabilities and for positioning \cite{smartphoneSensors}.
It utilizes the so-called hall effect to do so. The hall effect is the voltage between two sides of a current-carrying conductor inside a magnetic field \cite{hallEffect} \cite{hallEffect2}.
\section{Magnetic Induction}
// TODO: Write this section

View file

@ -7,4 +7,3 @@ Alice wants to be able to receive a small piece of data over a website, similar
to a QR code, with her smartphone but without other people being able to see the
code over her shoulders. She also wants to be able to receive data to her smartphone while it has connection available e.g. when it's in airplane mode.
// TODO: Document other potential personas

View file

@ -51,6 +51,8 @@ The following describes the steps needed to send a message using our protocol:
\item{Transmit the manchester encoded bitstream of the packet}
\end{enumerate}
// TODO: Detailed description of sending process with pseudocode
\subsection{Receiving}
The following describes the steps needed to receive a message using our protocol:
@ -64,18 +66,14 @@ The following describes the steps needed to receive a message using our protocol
\item{Convert the payload ASCII bitstream to text}
\end{enumerate}
// TODO: Detailed description of decoding process
1. Get samples from sensor
Show graphic
2. Determine if sample is a high or low signal
// TODO: Detailed description of decoding process with pseudocode
\newpage
\section{Website}
The website provides the user with an interface to transmit text over our protocol.
When the user opens the website he is greeted by a simple interface. It contains an input field for entering text and two buttons. The first button will send the entered text, and the second one will start the calibration process.
When the user opens the website they are greeted by a simple interface. It contains an input field for entering text and two buttons. The first button will send the entered text, and the second one will start the calibration process.
\begin{figure}[H]
\fbox{\includegraphics[width=1\textwidth]{mockups/website/home_v1.png}}

View file

@ -2,8 +2,6 @@
\section{Devices}
The following devices were used for the development and testing of MagSend. While theoretically MagSend should work on other Laptops and Smartphones I have only tested in on specified devices. For each device the most important specifications are listed.
// TOOD: Explain problem of testing over video calls
\subsection{Laptop}
The laptop was used as the sending device for MagSend. The Website was run using the Firefox browser and the laptop was always plugged in to the power grid to ensure that CPU doesn't throttle.
@ -196,7 +194,7 @@ The following test cases are all structured in the same way. The table lists the
\item{The user can enter any text between 0 and 16 characters}
\end{enumerate} \\
Actual Result &
The user can enter any character in the input he wants but he is not able to enter more than 16 characters (see \autoref{figure:t07}).
The user can enter any character in the input they want but they are not able to enter more than 16 characters (see \autoref{figure:t07}).
\\
\end{reqTblr}
\caption{Test Case 07}
@ -223,9 +221,9 @@ The following test cases are all structured in the same way. The table lists the
\item{When the user hasn't entered any text or the text contains non-ASCII characters a fitting message is displayed and the sending process is not started.}
\end{enumerate} \\
Actual Result &
When the user attempts to start sending when he hasn't entered any text, a message is displayed (see \autoref{figure:t08}).
When the user attempts to start sending when they haven't entered any text, a message is displayed (see \autoref{figure:t08}).
When the user attempts to start sending when he has entered any non-ASCII characters, a message is diplayed. (see \autoref{figure:t08_2}).
When the user attempts to start sending when they have entered any non-ASCII characters, a message is diplayed. (see \autoref{figure:t08_2}).
In both cases the sending process is not started.
\\
@ -319,7 +317,7 @@ The following test cases are all structured in the same way. The table lists the
\item{The app will start the receive process and will indicate if the preamble was detected, the length of the received payload, and if the checksum is valid. The received text is also displayed.}
\end{enumerate} \\
Actual Result &
When the users starts the receiving process he is informed about the current process of the receive status. He is informed whether the preamble was detected, the length of the payload and if the checksum is valid. He can also see the currently received text at all times (see \autoref{figure:t11}).
When the users starts the receiving process they are informed about the current process of the receive status. They are informed whether the preamble was detected, the length of the payload and if the checksum is valid. They can also see the currently received text at all times (see \autoref{figure:t11}).
When the checksum is invalid the user is informed about it (see \autoref{figure:t11_2}).
\\
@ -427,4 +425,4 @@ The following test cases are all structured in the same way. The table lists the
\caption{Test Case 15}
\end{table}
// TODO: Fix up layout of images
// TODO: Fix up sizing of images

View file

@ -7,126 +7,83 @@ The following benchmark test are structured in the same way. I run each test 5 t
The message used in the test transmissions is "\textbf{Test}".
\section{25\% CPU Load}
\section{Idle CPU Load}
The following benchmarks were run during idle CPU Load, which was about 1-5\% utilization.
\subsection{\SI{0.5}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Yes & 4 bytes & No & Vêÿ\\
2 & Yes & 4 bytes & Yes & Test \\
3 & Yes & 4 bytes & Yes & Test\\
4 & Yes & 4 bytes & Yes & Test \\
5 & Yes & 4 bytes & No & {\textunderscore}
\end{bfhTabular}
\caption{Benchmark - Idle CPU Load - \SI{0.5}{\bit\per\second}}
\end{table}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
1 & Yes & 4 bytes & Yes & Test\\
2 & Yes & 4 & No & Test\\
3 & Yes & 4 & Yes & Test\\
4 & Yes & 4 & Yes & Test\\
5 & Yes & 4 & No & TÊæé
\end{bfhTabular}
\caption{Benchmark - Idle CPU Load - \SI{1}{\bit\per\second}}
\end{table}
\section{25\% CPU Load}
The following benchmarks were run with 25\% CPU utilization. The tool \texttt{stress} was used to put a load on the CPU \cite{stress}.
\subsection{\SI{0.5}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Yes & - & - & -\\
2 & Yes & \SI{4}{\byte} & - & -\\
3 & No & - & - & -\\
4 & No & - & - & -\\
5 & No & - & - & -\\
\end{bfhTabular}
\caption{Benchmark - 25\% CPU Load - \SI{0.5}{\bit\per\second}}
\end{table}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & No & - & - & -\\
2 & Yes & - & - & -\\
3 & No & - & - & -\\
4 & No & - & - & -\\
5 & No & - & - & -
\end{bfhTabular}
\caption{Benchmark - 25\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}
\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 25\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}
\subsection{Results}
As one can see in the benchmarks, the most successful configuration was running MagSend with \SI{1}{\bit\per\second} at with an idle CPU followed by \SI{0.5}{\bit\per\second} at an idle CPU.
\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 25\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}
The benchmarks with 25\% CPU load were mostly failing, with some few ones being able to detect the preamble and one even being able to receive the payload length from the message. There might be a few reasons why the results are like this. The first one is thermal throttling. CPUs produce a lot of heat when under load and thus they get hotter. When they get to hot, they throttle by reducing clock speeds. This process is designed to protect the CPU from overheating \cite{thermalThrottling}.
\section{50\% CPU Load}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 50\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}
The laptop that was used for running the benchmarks, already reaches CPU temperatures of over \SI{90}{\celsius} when only running at around 25\% CPU load (see \autoref{figure:cpu_temperatures}).
\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 50\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}
\begin{figure}[H]
\fbox{\includegraphics[width=1\textwidth]{benchmarking/cpu_temperatures.png}}
\caption{CPU temperatures under 25\% CPU load}
\label{figure:cpu_temperatures}
\end{figure}
\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 50\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}
When MagSend then attempts to sent data by putting even more stress on the CPU, the CPU begins to throttle and the resulting CPU loads gets dampened (see \autoref{figure:throttle}). While longer spikes like the preamble at the start of the packet are still visible, the rest of the message is only noise and really be received.
\section{75\% CPU Load}
\subsection{\SI{1}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 75\% CPU Load - \SI{1}{\bit\per\second}}
\end{table}
\begin{figure}[H]
\fbox{\includegraphics[width=1\textwidth]{benchmarking/1bps_25.png}}
\caption{CPU temperatures under 25\% CPU load}
\label{figure:throttle}
\end{figure}
\subsection{\SI{2}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 75\% CPU Load - \SI{2}{\bit\per\second}}
\end{table}
\subsection{\SI{4}{\bit\per\second}}
\begin{table}[H]
\begin{bfhTabular}{l l l l l}
Run & Preamble Detected & Payload Length & Is CRC Valid & Received Message \\
1 & Preamble Detected & Payload Length & CRC Valid & Test\\
2 & Preamble Detected & Payload Length & CRC Valid & Test\\
3 & Preamble Detected & Payload Length & CRC Valid & Test\\
4 & Preamble Detected & Payload Length & CRC Valid & Test\\
5 & Preamble Detected & Payload Length & CRC Valid & Test
\end{bfhTabular}
\caption{Benchmark - 75\% CPU Load - \SI{4}{\bit\per\second}}
\end{table}
// TODO: Add graphs to each benchmark
// TODO: Power Supply
The other problem with the failing benchmarks is on the receiving side. The interval at which the sensor provides data to the application is not guaranteed and thus introduces some jitter \cite{androidSensorMonitor}.

View file

@ -1,5 +1,8 @@
\chapter{Materials \& Methods}
* Laptop with Web-Browser capable of Web Workers
* Smartphone with Magnetometer
To develop, test and benchmark MagSend the following devices and software are needed:
// CPU of Laptop and Magnetometer of Smartphone
A laptop, which acts as the sender. This laptop needs to be able to run a modern web browser which supports the Web Workers API (see \autoref{section:webworkers}). The operating system is irrelevant as MagSend is web based.
An Android smartphone, which acts as the receiver. This phone should run at least Android version 10 to be able to run the MagSend client application. Furthermore it is required that the phone has a magnetometer. Most modern smartphones should have a hall effect sensor for that purpose (see \autoref{section:hallEffectSensor}).
For developing, the official IDE for Android development, Android Studio \cite{androidStudio} was used. While this is not strictly required to run MagSend, it should be the most convenient way to do so.

View file

@ -1,3 +1,6 @@
\chapter{Future Work}
The goal of this thesis was to research and develop a communication method which uses magnetic induction, while using standard components and devices.
// TODO: Improve robustness, speed, ui and ux, what I'd like to change
The result was a working prototype that allows non-technical users to transmit a message from their laptop to their smartphone wirelessly over with the help of magnetic induction, called MagSend.
For future improvements surrounding MagSend, the most important one is to enhance the robustness of the system. While the system generally works, there any many cases where the message doesn't get received, the preamble doesn't get detected or the received message is incorrect. Furthermore when the systems gets more robust it might also be possible to increase the transfer speed of MagSend. In the end the user experience and user interface applications can also be improved by giving more feedback and guidance to the user on how to use MagSend.

View file

@ -1,5 +1,57 @@
\chapter{Project Management}
\section{Project Plan}
\subsection{Initial Plan}
\begin{sidewaysfigure}
\begin{ganttchart}[
vgrid,
hgrid,
x unit=0.9cm,
y unit chart=0.6cm,
y unit title=0.6cm, % height of title line and gap
title height=1 % use full height for title, leaving no gap
]{1}{18}
\gantttitle{Project Plan}{18}
\\
\gantttitlelist{1,...,18}{1}
\\
\gantttitle{September}{2}
\gantttitle{October}{4}
\gantttitle{November}{5}
\gantttitle{December}{4}
\gantttitle{January}{3}
\\
\ganttbar{Prepare Thesis Document}{1}{2} \\
\ganttbar{Create Project Plan}{1}{2} \\
\ganttbar{Research Other Solutions}{1}{2} \\
\ganttbar{Experiment with Hardware}{1}{2} \\
\ganttbar{Write Introduction}{2}{2} \\
\ganttbar{Define Use Cases \& Personas}{3}{3} \\
\ganttbar{Define Requirements}{3}{4} \\
\ganttbar{Plan Solution}{5}{6} \\
\ganttbar{Document Solution}{5}{6} \\
\ganttbar{Define Test Cases}{6}{6} \\
\ganttbar{Prepare Hardware for Prototype}{7}{7} \\
\ganttbar{Create Prototype for Sender}{7}{9} \\
\ganttbar{Create Prototype for Receiver}{8}{10} \\
\ganttbar{Testing}{11}{12} \\
\ganttbar{Benchmarking}{11}{12} \\
\ganttbar{Document Materials \& Methods}{13}{13} \\
\ganttbar{Document Future Work}{13}{13} \\
\ganttbar{Create Abstract}{14}{14} \\
\ganttbar{Create Poster}{14}{15} \\
\ganttbar{Create Movie}{16}{16} \\
\ganttbar{Finish Thesis Report}{16}{17} \\
\ganttbar{Prepare Presentations}{17}{18}
\end{ganttchart}
\caption{Project Plan}
\end{sidewaysfigure}
\subsection{Actual Plan}
\begin{sidewaysfigure}
\begin{ganttchart}[
vgrid,