diff --git a/documentation/thesis/content/02_preliminaries.tex b/documentation/thesis/content/02_preliminaries.tex index ffb7d67..ec07132 100644 --- a/documentation/thesis/content/02_preliminaries.tex +++ b/documentation/thesis/content/02_preliminaries.tex @@ -1 +1,13 @@ \chapter{Preliminaries} +\section{Web Worker} +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 DOM, the window object and some web APIs. + +The main thread and Web Workers can communicate together using messages. They can send their messages using a postMessage method and the other side receives a message event it can act upon. \cite{WebWorkers} + +Web Workers are used in this project to put a load on the CPU to modify the magnetic field without locking up the website itself. + +\section{Manchester Code} + +\section{Hall Sensor} diff --git a/documentation/thesis/content/03_personas.tex b/documentation/thesis/content/03_personas.tex index c5e6782..c28a9d3 100644 --- a/documentation/thesis/content/03_personas.tex +++ b/documentation/thesis/content/03_personas.tex @@ -1,15 +1,8 @@ \chapter{Personas} -This chapter describes the personas with their goals and problems that they want -to have solved. These personas are later used in the use cases and requirements -in \autoref{chapter:requirements}. +This chapter describes the personas with their motivations, goals and problems that they want +to have solved. These motivations are then later used to create and describe the requirements in \autoref{chapter:requirements}. -\section{Alice} +\textbf{Alice} \\ 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. - -\section{Eve} -Eve wants to be able to transmit data from a secure system (e.g. a server) to -her smartphone in an otherwise airgapped system (no internet or other -connectivity methods available) in a limited amount of available time (e.g. 30 -minutes). +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. diff --git a/documentation/thesis/content/04_requirements.tex b/documentation/thesis/content/04_requirements.tex index 5493e6d..9997071 100644 --- a/documentation/thesis/content/04_requirements.tex +++ b/documentation/thesis/content/04_requirements.tex @@ -2,43 +2,73 @@ \label{chapter:requirements} \section{Functional Requirements} -\begin{table}[ht] - \begin{reqTblr}{lll} +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} ID & F01 \\ - Title & Website Transmits Data using MI \\ - Persona & Persona 1, Persona 2 \\ - Description & Description here... + Title & Calibration on Website \\ + Application & Website \\ + Description & Alice visits the website and starts the calibration mode on the website. While in calibration mode the the website continously puts load on the CPU. \end{reqTblr} \caption{Functional Requirement 01} \end{table} -\begin{table}[ht] - \begin{reqTblr}{lll} +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} ID & F02 \\ - Title & Smartphone Receives the Data \\ - Persona & Persona 1, Persona 2 \\ - Description & Description here... + Title & Calibration on App \\ + Application & Smartphone App \\ + Description & In the app Alice can start the calibration process. By putting her smartphone on different location on her laptop the app will tell her the current strength of the magnetic field. The point with the strongest magnetic field is the optimal place for data transmission. \end{reqTblr} \caption{Functional Requirement 02} \end{table} -\begin{table}[ht] - \begin{reqTblr}{lll} +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} ID & F03 \\ - Title & Smartphone Displays the Data \\ - Persona & Persona 1, Persona 2 \\ - Description & Description here... + Title & Text Entry \\ + Application & Website \\ + Description & The website contains a text input field. Alice can enter any ASCII string in this text input. \end{reqTblr} \caption{Functional Requirement 03} \end{table} -\section{Non Functional Requirements} -\begin{table}[ht] - \begin{reqTblr}{lll} - ID & N01 \\ - Title & Smartphone Requires No Connectivity \\ - Persona & Persona 1, Persona 2 \\ - Description & Description here... +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} + ID & F04 \\ + Title & Sending Data \\ + Application & Website \\ + Description & Alice visits the website, enter a text and then clicks on the send send button. The website will attempt to send the string in the input field using MI. The data will be sent continously until Alice stops the sending by clicking on the stop button. \end{reqTblr} - \caption{Non Functional Requirement 01} + \caption{Functional Requirement 04} +\end{table} + +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} + ID & F05 \\ + Title & Receiving Data \\ + Application & Smartphone App \\ + Description & Alice can start the receiving mode in the app. By putting her smartphone on the laptop she can receive the data that is sent by the website. The app displays the received text on the screen. + \end{reqTblr} + \caption{Functional Requirement 05} +\end{table} + + +\newpage +\section{Non Functional Requirements} +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} + ID & N01 \\ + Title & Working in Airplane Mode \\ + Description & Alice can receive data using the app on her smartphone even if she has put her phone in airplane mode. + \end{reqTblr} + \caption{Non Functional Requirement 01} +\end{table} + +\begin{table}[H] + \begin{reqTblr}{l p{11.8cm}} + ID & N02 \\ + Title & Transfer Rate \\ + Description & The transfer speed between the laptop and smartphone should at least be \SI{2}{\bit\per\second} + \end{reqTblr} + \caption{Non Functional Requirement 02} \end{table} diff --git a/documentation/thesis/content/05_solution.tex b/documentation/thesis/content/05_solution.tex index f3a07f1..5d94759 100644 --- a/documentation/thesis/content/05_solution.tex +++ b/documentation/thesis/content/05_solution.tex @@ -1 +1,29 @@ \chapter{Solution} +The solution consists of two separate applications: a website used for transmitting data and a smartphone application used for receiving data. Transmission between the two application happens using a simple protocol on top of magnetic induction. + +\section{Protocol} +The main communication protocol works over magnetic induction. By putting load on a CPU the resulting magnetic field can be changed. Using a magnetometer in a smartphone these changes can be measured and interpreted. + +For simplification purposes the protocol in this project is used to transmit ASCII text but in reality any bit stream can be transmitted. + +To indicate the start of a message in the transmission a preamble is used. The preamble used in this protocol is 3 high signals, followed by 1 low signal, followed by 3 high signals. + +\subsection{Sending} +\begin{enumerate} + \item{Convert the text to an ASCII encoded bit stream} + \item{Encode the ASCII bit stream using manchester encoding} + \item{Start the transmission by sending the preamble} + \item{Transmit the manchester encoded bit stream} + \item{Repeat from step 3 until transmission is stopped} +\end{enumerate} + +\subsection{Receiving} +\begin{enumerate} + \item{Detect the preamble} + \item{Decode the received manchester encoded bit stream} + \item{Convert the ASCII bit stream to text} +\end{enumerate} + +\section{Website} + +\section{App} diff --git a/documentation/thesis/thesis.tex b/documentation/thesis/thesis.tex index 473c72c..70bc9d8 100644 --- a/documentation/thesis/thesis.tex +++ b/documentation/thesis/thesis.tex @@ -30,6 +30,11 @@ \usepackage{pgfgantt} \usepackage{rotating} +\usepackage{siunitx} +\sisetup{per-mode=symbol} + +\usepackage{float} + % https://tex.stackexchange.com/a/24827 \makeatletter \def\input@path{{documentation/thesis/content}} @@ -75,6 +80,9 @@ \bibliographystyle{plainurl} \bibliography{thesis} +\listoffigures +\listoftables + \appendix \chapter{First appendix Chapter} \end{document} diff --git a/notes/2022-10-13_meeting.md b/notes/2022-10-13_meeting.md index 92eaa3a..f913fa9 100644 --- a/notes/2022-10-13_meeting.md +++ b/notes/2022-10-13_meeting.md @@ -13,3 +13,4 @@ ## Next Steps - Test different worker amounts - Finish personas, use cases and requirements +- Plan protocol and signal diff --git a/notes/2022-10-27_meeting.md b/notes/2022-10-27_meeting.md new file mode 100644 index 0000000..8628235 --- /dev/null +++ b/notes/2022-10-27_meeting.md @@ -0,0 +1,17 @@ +# Meeting 2022-10-27 +## Attendees +* Severin Kaderli +* Reto König + +## Progress +* Requirements +* Solution +* Mockups + +## Topics + + +## Next Steps +- Postamble +- Consider other protocols (checksums, preamble, postamble) +- Risks of transmission failure diff --git a/notes/time_report.md b/notes/time_report.md index 442e5ae..e57c6cd 100644 --- a/notes/time_report.md +++ b/notes/time_report.md @@ -14,7 +14,7 @@ # 2022-09-25 * Another test with a speaker - * No change measurable in magnetmeter even if I can see the coil vibrate + * No change measurable in magnetometer even if I can see the coil vibrate * I assume the change in the magnetic field is too small to be measured * Finish project plan @@ -80,3 +80,23 @@ * Eve * Wants to transmit data in an airgapped system * eg. + +# 2022-10-25 +* Flesh out requirements +* Signal + * Preamble + * 3 Hi + * 1 Low + * 3 Hi +* Protocol + * Manchester Encoded Bits + * Clock of 250ms + +# 2022-10-26 +* Start documenting solution +* Start documenting some preliminaries +* Update requirements and personas +* Create mockups for app and website + +# 2022-10-27 +* Prepare meeting notes diff --git a/src/web-worker-stress/index.html b/src/web-worker-stress/index.html index e21af01..b1dd11c 100644 --- a/src/web-worker-stress/index.html +++ b/src/web-worker-stress/index.html @@ -9,20 +9,21 @@ Hello World! diff --git a/thesis.bib b/thesis.bib index 9a5527e..6e53450 100644 --- a/thesis.bib +++ b/thesis.bib @@ -32,3 +32,11 @@ year = "2012", title = "Near field magnetic induction Communication in Body Area Network", } + +@online{WebWorkers, + author = "MDN contributors", + title = "Web Workers API", + year = "2022", + url = "https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API", + urldate = "2022-10-26" +}