Skip to content
Snippets Groups Projects
Commit 0f1c6817 authored by Joan Paulette Vazquez Matute's avatar Joan Paulette Vazquez Matute
Browse files

Add new gpio image reference

parent d3d24a98
No related branches found
No related tags found
No related merge requests found
figures/rpiZ-GPIO.png

106 KiB

No preview for this file type
...@@ -182,7 +182,7 @@ Smallworld is a python script that establishes and monitors wireless connections ...@@ -182,7 +182,7 @@ Smallworld is a python script that establishes and monitors wireless connections
\subsection{Design} \subsection{Design}
The current design comprises a Raspberry Pi Zero W with two push buttons, two 220 Ohm resistors and two LEDs connected to its GPIOs. \autoref{fig:electricalSchema} illustrates the electrical schema of the connected components, you can also refer to the picture \ref{fig:raspberry} of the assembled Raspberry. The buttons control the device and the LEDs give feedback on its current connection status. The AP button is connected to GPIO 13, and the LED giving feedback for the AP is connected to GPIO 19. The WPS button is connected to GPIO 6. The LED on GPIO 26 gives feedback on the connection status of the device in both host and client mode. The current design comprises a Raspberry Pi Zero W with two push buttons, two 220 Ohm resistors and two LEDs connected to its GPIOs. \autoref{fig:electricalSchema} illustrates the electrical schema of the connected components, you can also refer to the picture \autoref{fig:raspberry} of the assembled Raspberry. If you want to see the pin numbering in more detail you can refer to \autoref{fig:raspberry-gpio}. The buttons control the device and the LEDs give feedback on its current connection status. The AP button is connected to GPIO 13, and the LED giving feedback for the AP is connected to GPIO 19. The WPS button is connected to GPIO 6. The LED on GPIO 26 gives feedback on the connection status of the device in both host and client mode.
\begin{figure} \begin{figure}
\includegraphics[width=\linewidth]{figures/electricalSchema.pdf} \includegraphics[width=\linewidth]{figures/electricalSchema.pdf}
\caption{Electrical schema of the final device} \caption{Electrical schema of the final device}
...@@ -195,6 +195,13 @@ The current design comprises a Raspberry Pi Zero W with two push buttons, two 22 ...@@ -195,6 +195,13 @@ The current design comprises a Raspberry Pi Zero W with two push buttons, two 22
\label{fig:raspberry} \label{fig:raspberry}
\end{figure} \end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{figures/rpiZ-GPIO.png}
\caption{Raspberry PI Zero W - GPIO pin numbering}
\label{fig:raspberry-gpio}
\end{figure}
\autoref{fig:stateMachine} illustrates the complete behavior of the daemon. When the RPi starts, the \emph{Access Point} (AP) is disabled. The device eventually connects to known Wi-Fi networks listed in the \verb|wpa_noAP.conf| file if any is available. When the user presses the WPS push-button, the RPi tries to connect to an existing Wi-Fi network. The \emph{Connection State} LED blinks until it finds an available Wi-Fi to connect to then stays on if the connection is successful. If it does not find a Wi-Fi waiting for a WPS connection, it stops searching and times out after two minutes. When pressing on the AP button, the device starts its own Wi-Fi network (and turn on the AP LED). Any Wi-Fi device can connect to this AP the same way they connect to a home network as long as the passphrase is known. If the other device implements a WPS push-button, it can also be connected by starting a WPS search on both devices. When the AP is enabled the \emph{Connection State} LED stays on as long as there is at least one device connected to the network, and always blinks during WPS discovery. \autoref{fig:stateMachine} illustrates the complete behavior of the daemon. When the RPi starts, the \emph{Access Point} (AP) is disabled. The device eventually connects to known Wi-Fi networks listed in the \verb|wpa_noAP.conf| file if any is available. When the user presses the WPS push-button, the RPi tries to connect to an existing Wi-Fi network. The \emph{Connection State} LED blinks until it finds an available Wi-Fi to connect to then stays on if the connection is successful. If it does not find a Wi-Fi waiting for a WPS connection, it stops searching and times out after two minutes. When pressing on the AP button, the device starts its own Wi-Fi network (and turn on the AP LED). Any Wi-Fi device can connect to this AP the same way they connect to a home network as long as the passphrase is known. If the other device implements a WPS push-button, it can also be connected by starting a WPS search on both devices. When the AP is enabled the \emph{Connection State} LED stays on as long as there is at least one device connected to the network, and always blinks during WPS discovery.
\begin{figure} \begin{figure}
\includegraphics[width=\linewidth]{figures/stateMachine.pdf} \includegraphics[width=\linewidth]{figures/stateMachine.pdf}
...@@ -458,8 +465,7 @@ Initially, the RPi and the other device do not follow each other. To have them f ...@@ -458,8 +465,7 @@ Initially, the RPi and the other device do not follow each other. To have them f
Additionally, to get situations like \autoref{fig:multiplePeers}, we use a script written for the project called \emph{ssbAutoFollow}\footnote{Also accessible on the smallworld repository: \url{https://github.com/rkuenzi-epfl/smallworld}}. This script makes the RPi follow any other device active on the same local network, using the fact that all ssb-server announce their identity on the local network by broadcasting UDP packets at regular intervals. Additionally, to get situations like \autoref{fig:multiplePeers}, we use a script written for the project called \emph{ssbAutoFollow}\footnote{Also accessible on the smallworld repository: \url{https://github.com/rkuenzi-epfl/smallworld}}. This script makes the RPi follow any other device active on the same local network, using the fact that all ssb-server announce their identity on the local network by broadcasting UDP packets at regular intervals.
Finally, \autoref{conf:ssb_service} and \autoref{conf:follow_service} can be copied to \verb|/lib/systemd/system/| to have the ssb-server and the ssbAutoFollow script start on boot. The \verb|systemctl enable <service>| command also needs to be run for both services. Finally, \autoref{conf:ssb_service} and \autoref{conf:follow_service} can be copied to \verb|/lib/systemd/system/| and ssbAutoFollow script can be copied to ssb-server folder, to have the ssb-server and the ssbAutoFollow script start on boot\foonote{You can find those files on the smallworld repository, inside the SSBHelper folder as ssb-service.service and ssbAutoFollow.service respectively.}. The \verb|systemctl enable <service>| command also needs to be run for both services.
\begin{figure} \begin{figure}
\begin{lstlisting}[language=bash, label=conf:ssb_service, caption=Service file for ssb-server, numbers=left] \begin{lstlisting}[language=bash, label=conf:ssb_service, caption=Service file for ssb-server, numbers=left]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment