<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.elab.tecnico.ulisboa.pt/wwwelab/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ist176128</id>
	<title>wwwelab - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.elab.tecnico.ulisboa.pt/wwwelab/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ist176128"/>
	<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Special:Contributions/Ist176128"/>
	<updated>2026-05-09T09:55:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=4111</id>
		<title>List of UDP ports for streaming</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=4111"/>
		<updated>2021-05-26T02:46:03Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following table list the information needed to setup video streaming for the partner pendulums. '''''Each partner pendulum must be set up to use the indicated ports.''''' Any deviation from this settings will result in conflicts that will disrupt video streaming on the affected pendulums.&lt;br /&gt;
&lt;br /&gt;
It also shows the names the corresponding SDP files are expected to have. These must also be followed, otherwise the client application won't be able to play the videos as the expected filenames will be missing. The ''xx'' as to be replaced by the confidential designated two digits.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Video Streaming Settings&lt;br /&gt;
|-&lt;br /&gt;
  | Pendulum Location&lt;br /&gt;
  | Experiment Name&lt;br /&gt;
  | Port&lt;br /&gt;
  | SDP Name&lt;br /&gt;
|-&lt;br /&gt;
  | Prague - CTU&lt;br /&gt;
  | WP_PRG&lt;br /&gt;
  | xx72&lt;br /&gt;
  | wp_prg.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Barcelona - UPC&lt;br /&gt;
  | WP_BCN&lt;br /&gt;
  | xx66&lt;br /&gt;
  | wp_bcn.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Marseille - ECM&lt;br /&gt;
  | WP_MRS&lt;br /&gt;
  | xx94&lt;br /&gt;
  | wp_mrs.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Brasilia - UnB&lt;br /&gt;
  | WP_UNB_BSB&lt;br /&gt;
  | xx90&lt;br /&gt;
  | wp_unb_bsb.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Ilheus - UESC&lt;br /&gt;
  | WP_UESC_IOS&lt;br /&gt;
  | xx22&lt;br /&gt;
  | wp_uesc_ios.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Rio de Janeiro - PUC&lt;br /&gt;
  | WP_PUC_RIO&lt;br /&gt;
  | xx46&lt;br /&gt;
  | wp_puc_rio.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Santiago - UChile&lt;br /&gt;
  | WP_UCHILE_SCL&lt;br /&gt;
  | xx76&lt;br /&gt;
  | wp_uc_scl.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Valparaíso - UTFSM&lt;br /&gt;
  | WP_UTFSM_VAP&lt;br /&gt;
  | xx78&lt;br /&gt;
  | wp_utfsm_vap.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UniAndes&lt;br /&gt;
  | WP_UNIANDES_BOG&lt;br /&gt;
  | xx80&lt;br /&gt;
  | wp_uniandes_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UNAD&lt;br /&gt;
  | WP_UNAD_BOG&lt;br /&gt;
  | xx82&lt;br /&gt;
  | wp_unad_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - UTP&lt;br /&gt;
  | WP_UTP_PTY&lt;br /&gt;
  | xx84&lt;br /&gt;
  | wp_utp_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - USMA&lt;br /&gt;
  | WP_USMA_PTY&lt;br /&gt;
  | xx86&lt;br /&gt;
  | wp_usma_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Praia - UniCV&lt;br /&gt;
  | WP_UNICV_RAI&lt;br /&gt;
  | xx74&lt;br /&gt;
  | wp_unicv_rai.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Punta Arenas - UMAG&lt;br /&gt;
  | WP_UMAG_PUQ&lt;br /&gt;
  | xx88&lt;br /&gt;
  | wp_umag_puq.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Lisboa - IST&lt;br /&gt;
  | WP_IST_LIS&lt;br /&gt;
  | xx68&lt;br /&gt;
  | wp_ist_lis.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | São Tomé - EPSTP&lt;br /&gt;
  | WP_SAOTOME&lt;br /&gt;
  | xx96&lt;br /&gt;
  | wp_saotome.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Faro - CCVAlg&lt;br /&gt;
  | ELAB_WORLD_PENDULUM_CCVALG&lt;br /&gt;
  | xx20&lt;br /&gt;
  | worldpendulum_ccvalg.sdp&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3766</id>
		<title>Painel Fotovoltaico</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3766"/>
		<updated>2020-08-31T19:32:19Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Descrição da experiência =&lt;br /&gt;
[[File:Pv panel photo.jpg||thumb|Fig. 1 - Aparato experimental utilizado composto pelo painel de leds tricolores, painel fotovoltaico amorfo e controlador. |right|border|300px]]&lt;br /&gt;
&lt;br /&gt;
A energia solar fotovoltaica é uma fonte de energia limpa e renovável, em rápido crescimento. Os painéis fotovoltaicos usam radiação solar para produzir eletricidade, que pode ser usada localmente ou injectada na rede elétrica.&lt;br /&gt;
&lt;br /&gt;
A presente experiência pretende estudar vários factores que afetam a característica, a eficiência e a potência produzida por um painel fotovoltaico. Para tal, um painel de LEDs fixo, contendo vários LEDs RGB, é usado como fonte de radiação para um painel fotovoltaico. Este painel fotovoltaico pode rodar e, consequentemente, variar o ângulo que faz com o painel de LEDs. Além disso, a resistência de carga conectada ao painel fotovoltaico também pode ser variada, permitindo estudar os impactos desta quantidade na tensão, corrente e potência produzidas pelo painel fotovoltaico.&lt;br /&gt;
&lt;br /&gt;
Este aparato experimental permite a simulação e análise dos fatores mais relevantes que afetam o uso de painéis fotovoltaicos em ambientes reais, contribuindo para a compreensão dos desafios e detalhes relacionados com tal uso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:320px&amp;quot;&amp;gt;&lt;br /&gt;
'''Links'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/fotovoltaico.sdp&lt;br /&gt;
*Laboratório: Básico no [http://elab.tecnico.ulisboa.pt elab]&lt;br /&gt;
*Sala de controlo: Fotovoltaico&lt;br /&gt;
*Nível: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Aparato Experimental =&lt;br /&gt;
&lt;br /&gt;
== Descrição ==&lt;br /&gt;
[[File:Pv_panel.jpg||thumb|Fig. 2 - Representação esquemática da experiência onde o painel de leds está fixo e o painel fotovoltaico pode rodar em torno dum eixo, variando deste modo o ângulo de incidência dos raios luminosos. |right|border|250px]]&lt;br /&gt;
&lt;br /&gt;
O aparato experimental utilizado é composto por três componentes principais:&lt;br /&gt;
;Painel de LEDs:&lt;br /&gt;
: um painel fixo contendo 162 LEDs RGB, modelo SMD5050, organizados numa grelha 18 x 9. Cada um destes LEDs RGB é composto internamente por 3 LEDs (vermelho, verde e azul) que podem ser controlados independentemente, permitindo a seleção da cor a ser emitida. Deste modo os resultados permitem determinar também a eficiência do painel para vários comprimentos de onda.&lt;br /&gt;
;Painel fotovoltaico:&lt;br /&gt;
: um painel fotovoltaico montado sobre um eixo rotativo. Este eixo está conectado a um motor servo que permite a rotação do painel e, consequentemente, a variação do ângulo entre os painéis LED e fotovoltaico.&lt;br /&gt;
;Resistência de carga variável:&lt;br /&gt;
: o painel fotovoltaico está conectado a uma resistência de valor variável que atua como carga.&lt;br /&gt;
&lt;br /&gt;
As dimensões dos painéis LED e fotovoltaico encontram-se na tabela seguinte.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Dimensões dos painéis (mm)&lt;br /&gt;
|-&lt;br /&gt;
| LEDs RGB &lt;br /&gt;
|145 x 90&lt;br /&gt;
|-&lt;br /&gt;
| Fotovoltaico &lt;br /&gt;
|150 x 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A figura 2 mostra uma representação esquemática da experiência. É importante notar que a colocação do painel fotovoltaico a 0º corresponde a ter os dois painéis paralelos, ou seja, a radiação colectada pelo painel fotovoltaíco é máxima. O limite oposto corresponde ao painel fotovoltaico a 90º, colocando ambos os painéis perpendiculares.&lt;br /&gt;
&lt;br /&gt;
Por fim, o utilizador deve ter em conta que os três LEDs internos (vermelho, verde e azul) constituinte de cada um dos LEDs RGB emitem com intensidades diferentes devido à tecnologia relativa à produção de cada led. Deste modo cada comprimento de onda em jogo deve atender a essa correção na emissividade. Para referência, a tabela abaixo mostra essa relação para o fluxo luminoso real (intensidade da radiação no visível) emitido pelos LEDs das diferentes cores.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Fluxo luminoso para LEDs RGB&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|(Medido com brilho máximo - nivel 255)&lt;br /&gt;
|-&lt;br /&gt;
|Cor&lt;br /&gt;
|Fluxo luminoso (lux)&lt;br /&gt;
|-&lt;br /&gt;
|Vermelho (R)&lt;br /&gt;
|1080&lt;br /&gt;
|-&lt;br /&gt;
|Verde (G)&lt;br /&gt;
|5780&lt;br /&gt;
|-&lt;br /&gt;
|Azul (B)&lt;br /&gt;
|7320&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuração ==&lt;br /&gt;
&lt;br /&gt;
O utilizador pode definir os seguintes parâmetros experimentais:&lt;br /&gt;
;Intensidade vermelho (R):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente vermelho de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade verde (G):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente verde de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade azul (B):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente azul de acordo com o modelo de cores RGB;&lt;br /&gt;
;Ângulo:&lt;br /&gt;
: De -20º a 100º, é o ângulo entre os painéis LED e fotovoltaico, como mostrado na figura 2;&lt;br /&gt;
;Resistência de carga:&lt;br /&gt;
: De 1 a 100, esta quantidade é proporcional à resistência de carga conectada ao painel fotovoltaico;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mais ainda, a experiência pode ser executada em três modos distintos:&lt;br /&gt;
;Varrimento de ângulo:&lt;br /&gt;
: o painel fotovoltaico é rodado de -20º a 100º em etapas de 1º, mantendo constantes a cor selecionada e a resistência de carga;&lt;br /&gt;
;Varrimento da resistência de carga:&lt;br /&gt;
: o valor da resistência de carga varia de 1 a 100% com as etapas de 1, mantendo constantes a cor e o ângulo selecionados;&lt;br /&gt;
;Encontrar a resistência de carga correspondente à máxima potência:&lt;br /&gt;
: para uma determinada cor e ângulo selecionados, o valor da resistência de carga que maximiza a potência extraída do painel é encontrado automaticamente através de um processo iterativo similar ao utilizado nos ''Maximum Power Point Tracking'' (MPPT);&lt;br /&gt;
&lt;br /&gt;
== Resultados ==&lt;br /&gt;
Após o início da experiência, é retornada uma tabela dinâmica com a data/hora de cada medição, o ângulo entre os painéis, o valor da resistência de carga e os elementos medidos em cada ponto: a tensão e a corrente na resistência de carga permitindo determinar indiretamente a potência total consumida nessa resistência (carga).&lt;br /&gt;
&lt;br /&gt;
Deve ser dada particular atenção à propagação de erros na potência pois quer a corrente quer a tensão variam.&lt;br /&gt;
&lt;br /&gt;
A aplicação permite ainda visualizar em tempo real os dados que vão sendo recolhidos.&lt;br /&gt;
&lt;br /&gt;
= Física =&lt;br /&gt;
== Semicondutores ==&lt;br /&gt;
Os painéis fotovoltaicos baseiam-se em junções p-n de silício. O silício puro é um semicondutor intrínseco com uma resistividade elétrica de cerca de 2500 \(\Omega \cdot m\), indicando que este material não é um condutor nem um isolante. Um semicondutor puro pode ser dopado através da adição de iões de impurezas específicas, criando semicondutores extrínsecos. Considerando que o silício possui 4 electrões de valência, os iões dopantes de impurezas de menor valência tornam-se aceitadores de electrões e as impurezas de maior valência tornam-se dadores de electrões. Para o primeiro caso, se não houver electrões livres, produzem-se estados de carga positiva, conhecidos como buracos, que se movem através do material e actuam como portadores maioritários. No caso dos dadores de electrões, existe um excesso de electrões livres que actuam como portadores maioritários. Para o silício dopado, os valores típicos de resistividade elétrica encontram-se em torno de 10 \(\Omega \cdot cm\).&lt;br /&gt;
&lt;br /&gt;
== Junções P-N ==&lt;br /&gt;
Quando um material do tipo p entra em contacto com um material do tipo n, forma-se uma região de mudança de dopante - a junção p-n. Quando essa junção é criada, o excesso de electrões do material do tipo n (dador) move-se para o material do tipo p (aceitador) e os buracos em excesso do material do tipo p movem-se para o material do tipo n. Esta movimentação de cargas ocorre até que um estado estacionário seja alcançado. Neste estado, o campo elétrico causado pela acumulação de cargas de sinais opostos em cada um dos lados da junção equilibra a difusão decorrente das diferentes concentrações de electrões livres e buracos. Em torno da interface entre os materiais do tipo p e n é criada uma zona sem portadores maioritários - a região de deplecção.&lt;br /&gt;
&lt;br /&gt;
Em tal junção, pares de livres e buracos podem ser espontaneamente gerados a partir de estados ligados, principalmente devido a excitação térmica. Quando tais portadores são gerados ou são capazes de se difundir para a região de deplecção, são puxadas electrostaticamente de acordo com os seus respectivos gradientes de potencial, criando uma corrente de geração constante, \(I_g\). Para manter o equilíbrio geral de corrente na região de deplecção, existe uma corrente de recombinação inversa \(I_r\), que resulta da recombinação de electrões e buracos provenientes dos diferentes lados da junção. Cada evento de recombinação electeão-buraco corresponde ao transporte de uma carga elementar através da junção.&lt;br /&gt;
Se a junção p-n não estiver iluminada e não tiver polarização externa, a corrente total é nula porque \(I_r = I_g\). No entanto, se uma polarização externa positiva for aplicada à junção \(V_b\), a corrente de recombinação é \(I_r = I_g \cdot e ^ {eV_b / k_B T} \), o que resulta numa corrente total no escuro, \(I_D\):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I_D = I_r - I_g = I_g \cdot (e ^ {eV_b / k_B T} -1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Essa expressão é muito semelhante à característica de um diodo. A única diferença é que, num diodo, \(I_g\) é substituído por \(I_0 \), a corrente de saturação.&lt;br /&gt;
&lt;br /&gt;
== Absorção de fotões na junção P-N ==&lt;br /&gt;
Quando uma junção p-n é exposta a radiação eletromagnética, um processo de formação de pares electrão-buraco é responsável pela maior parte da sua absorção. Como anteriormente visto, a formação destes pares resulta na criação de dois portadores de carga. Quando a criação de tais portadores ocorre perto de uma junção p – n, o campo interno na região de deplecção impede a sua recombinação e produz uma corrente, \(I_L \), num circuito conectado externamente. Esta corrente é muito maior do que a corrente resultante da geração térmica de pares electrão-buraco já presente, fazendo com que a junção p-n se comporte como uma fonte de corrente. A corrente total produzida é dada por:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I = I_D - I_L = I_g \cdot (e^{eV_b/k_B T}-1) - I_L &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Figura 3 mostra os diferentes tipos de corrente existentes numa junção p-n iluminada.&lt;br /&gt;
&lt;br /&gt;
[[File:Photon_absor.PNG||thumb|Fig. 3 - Diferentes correntes existentes numa junção p-n iluminada. |center|350px]]&lt;br /&gt;
&lt;br /&gt;
= Estudos experimentais =&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Bibliografia =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
*[[ Photovoltaic panel | Versão em Inglês (English Version)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3764</id>
		<title>Painel Fotovoltaico</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3764"/>
		<updated>2020-08-31T18:47:42Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Descrição da experiência =&lt;br /&gt;
[[File:Pv panel photo.jpg||thumb|Fig. 1 - Aparato experimental utilizado composto pelo painel de leds tricolores, painel fotovoltaico amorfo e controlador. |right|border|300px]]&lt;br /&gt;
&lt;br /&gt;
A energia solar fotovoltaica é uma fonte de energia limpa e renovável, em rápido crescimento. Os painéis fotovoltaicos usam radiação solar para produzir eletricidade, que pode ser usada localmente ou injectada na rede elétrica.&lt;br /&gt;
&lt;br /&gt;
A presente experiência pretende estudar vários factores que afetam a característica, a eficiência e a potência produzida por um painel fotovoltaico. Para tal, um painel de LEDs fixo, contendo vários LEDs RGB, é usado como fonte de radiação para um painel fotovoltaico. Este painel fotovoltaico pode rodar e, consequentemente, variar o ângulo que faz com o painel de LEDs. Além disso, a resistência de carga conectada ao painel fotovoltaico também pode ser variada, permitindo estudar os impactos desta quantidade na tensão, corrente e potência produzidas pelo painel fotovoltaico.&lt;br /&gt;
&lt;br /&gt;
Este aparato experimental permite a simulação e análise dos fatores mais relevantes que afetam o uso de painéis fotovoltaicos em ambientes reais, contribuindo para a compreensão dos desafios e detalhes relacionados com tal uso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:320px&amp;quot;&amp;gt;&lt;br /&gt;
'''Links'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/fotovoltaico.sdp&lt;br /&gt;
*Laboratório: Básico no [http://elab.tecnico.ulisboa.pt elab]&lt;br /&gt;
*Sala de controlo: Fotovoltaico&lt;br /&gt;
*Nível: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Aparato Experimental =&lt;br /&gt;
&lt;br /&gt;
== Descrição ==&lt;br /&gt;
[[File:Pv_panel.jpg||thumb|Fig. 2 - Representação esquemática da experiência onde o painel de leds está fixo e o painel fotovoltaico pode rodar em torno dum eixo, variando deste modo o ângulo de incidência dos raios luminosos. |right|border|250px]]&lt;br /&gt;
&lt;br /&gt;
O aparato experimental utilizado é composto por três componentes principais:&lt;br /&gt;
;Painel de LEDs:&lt;br /&gt;
: um painel fixo contendo 162 LEDs RGB, modelo SMD5050, organizados numa grelha 18 x 9. Cada um destes LEDs RGB é composto internamente por 3 LEDs (vermelho, verde e azul) que podem ser controlados independentemente, permitindo a seleção da cor a ser emitida. Deste modo os resultados permitem determinar também a eficiência do painel para vários comprimentos de onda.&lt;br /&gt;
;Painel fotovoltaico:&lt;br /&gt;
: um painel fotovoltaico montado sobre um eixo rotativo. Este eixo está conectado a um motor servo que permite a rotação do painel e, consequentemente, a variação do ângulo entre os painéis LED e fotovoltaico.&lt;br /&gt;
;Resistência de carga variável:&lt;br /&gt;
: o painel fotovoltaico está conectado a uma resistência de valor variável que atua como carga.&lt;br /&gt;
&lt;br /&gt;
As dimensões dos painéis LED e fotovoltaico encontram-se na tabela seguinte.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Dimensões dos painéis (mm)&lt;br /&gt;
|-&lt;br /&gt;
| LEDs RGB &lt;br /&gt;
|145 x 90&lt;br /&gt;
|-&lt;br /&gt;
| Fotovoltaico &lt;br /&gt;
|150 x 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A figura 2 mostra uma representação esquemática da experiência. É importante notar que a colocação do painel fotovoltaico a 0º corresponde a ter os dois painéis paralelos, ou seja, a radiação colectada pelo painel fotovoltaíco é máxima. O limite oposto corresponde ao painel fotovoltaico a 90º, colocando ambos os painéis perpendiculares.&lt;br /&gt;
&lt;br /&gt;
Por fim, o utilizador deve ter em conta que os três LEDs internos (vermelho, verde e azul) constituinte de cada um dos LEDs RGB emitem com intensidades diferentes devido à tecnologia relativa à produção de cada led. Deste modo cada comprimento de onda em jogo deve atender a essa correção na emissividade. Para referência, a tabela abaixo mostra essa relação para o fluxo luminoso real (intensidade da radiação no visível) emitido pelos LEDs das diferentes cores.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Fluxo luminoso para LEDs RGB&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|(Medido com brilho máximo - nivel 255)&lt;br /&gt;
|-&lt;br /&gt;
|Cor&lt;br /&gt;
|Fluxo luminoso (lux)&lt;br /&gt;
|-&lt;br /&gt;
|Vermelho (R)&lt;br /&gt;
|1080&lt;br /&gt;
|-&lt;br /&gt;
|Verde (G)&lt;br /&gt;
|5780&lt;br /&gt;
|-&lt;br /&gt;
|Azul (B)&lt;br /&gt;
|7320&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuração ==&lt;br /&gt;
&lt;br /&gt;
O utilizador pode definir os seguintes parâmetros experimentais:&lt;br /&gt;
;Intensidade vermelho (R):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente vermelho de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade verde (G):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente verde de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade azul (B):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente azul de acordo com o modelo de cores RGB;&lt;br /&gt;
;Ângulo:&lt;br /&gt;
: De -20º a 100º, é o ângulo entre os painéis LED e fotovoltaico, como mostrado na figura 2;&lt;br /&gt;
;Resistência de carga:&lt;br /&gt;
: De 1 a 100, esta quantidade é proporcional à resistência de carga conectada ao painel fotovoltaico;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mais ainda, a experiência pode ser executada em três modos distintos:&lt;br /&gt;
;Varrimento de ângulo:&lt;br /&gt;
: o painel fotovoltaico é rodado de -20º a 100º em etapas de 1º, mantendo constantes a cor selecionada e a resistência de carga;&lt;br /&gt;
;Varrimento da resistência de carga:&lt;br /&gt;
: o valor da resistência de carga varia de 1 a 100% com as etapas de 1, mantendo constantes a cor e o ângulo selecionados;&lt;br /&gt;
;Encontrar a resistência de carga correspondente à máxima potência:&lt;br /&gt;
: para uma determinada cor e ângulo selecionados, o valor da resistência de carga que maximiza a potência extraída do painel é encontrado automaticamente através de um processo iterativo similar ao utilizado nos ''Maximum Power Point Tracking'' (MPPT);&lt;br /&gt;
&lt;br /&gt;
== Resultados ==&lt;br /&gt;
Após o início da experiência, é retornada uma tabela dinâmica com a data/hora de cada medição, o ângulo entre os painéis, o valor da resistência de carga e os elementos medidos em cada ponto: a tensão e a corrente na resistência de carga permitindo determinar indiretamente a potência total consumida nessa resistência (carga).&lt;br /&gt;
&lt;br /&gt;
Deve ser dada particular atenção à propagação de erros na potência pois quer a corrente quer a tensão variam.&lt;br /&gt;
&lt;br /&gt;
A aplicação permite ainda visualizar em tempo real os dados que vão sendo recolhidos.&lt;br /&gt;
&lt;br /&gt;
= Física =&lt;br /&gt;
== Semicondutores ==&lt;br /&gt;
Os painéis fotovoltaicos baseiam-se em junções p-n de silício. O silício puro é um semicondutor intrínseco com uma condutividade elétrica de cerca de 2500 \(\Omega \cdot m\), indicando que este material não é um condutor nem um isolante. Um semicondutor puro pode ser dopado através da adição de iões de impurezas específicas, criando semicondutores extrínsecos. Considerando que o silício possui 4 electrões de valência, os iões dopantes de impurezas de menor valência tornam-se aceitadores de electrões e as impurezas de maior valência tornam-se dadores de electrões. Para o primeiro caso, se não houver electrões livres, produzem-se estados de carga positiva, conhecidos como buracos, que se movem através do material e actuam como portadores maioritários. No caso dos dadores de electrões, existe um excesso de electrões livres que actuam como portadores maioritários. Para o silício dopado, os valores típicos de condutividade elétrica encontram-se em torno de 10 \(\Omega \cdot cm\).&lt;br /&gt;
&lt;br /&gt;
== Junções P-N ==&lt;br /&gt;
Quando um material do tipo p entra em contacto com um material do tipo n, forma-se uma região de mudança de dopante - a junção p-n. Quando essa junção é criada, o excesso de electrões do material do tipo n (dador) move-se para o material do tipo p (aceitador) e os buracos em excesso do material do tipo p movem-se para o material do tipo n. Esta movimentação de cargas ocorre até que um estado estacionário seja alcançado. Neste estado, o campo elétrico causado pela acumulação de cargas de sinais opostos em cada um dos lados da junção equilibra a difusão decorrente das diferentes concentrações de electrões livres e buracos. Em torno da interface entre os materiais do tipo p e n é criada uma zona sem portadores maioritários - a região de deplecção.&lt;br /&gt;
&lt;br /&gt;
Em tal junção, pares de livres e buracos podem ser espontaneamente gerados a partir de estados ligados, principalmente devido a excitação térmica. Quando tais portadores são gerados ou são capazes de se difundir para a região de deplecção, são puxadas electrostaticamente de acordo com os seus respectivos gradientes de potencial, criando uma corrente de geração constante, \(I_g\). Para manter o equilíbrio geral de corrente na região de deplecção, existe uma corrente de recombinação inversa \(I_r\), que resulta da recombinação de electrões e buracos provenientes dos diferentes lados da junção. Cada evento de recombinação electeão-buraco corresponde ao transporte de uma carga elementar através da junção.&lt;br /&gt;
Se a junção p-n não estiver iluminada e não tiver polarização externa, a corrente total é nula porque \(I_r = I_g\). No entanto, se uma polarização externa positiva for aplicada à junção \(V_b\), a corrente de recombinação é \(I_r = I_g \cdot e ^ {eV_b / k_B T} \), o que resulta numa corrente total no escuro, \(I_D\):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I_D = I_r - I_g = I_g \cdot (e ^ {eV_b / k_B T} -1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Essa expressão é muito semelhante à característica de um diodo. A única diferença é que, num diodo, \(I_g\) é substituído por \(I_0 \), a corrente de saturação.&lt;br /&gt;
&lt;br /&gt;
== Absorção de fotões na junção P-N ==&lt;br /&gt;
Quando uma junção p-n é exposta a radiação eletromagnética, um processo de formação de pares electrão-buraco é responsável pela maior parte da sua absorção. Como anteriormente visto, a formação destes pares resulta na criação de dois portadores de carga. Quando a criação de tais portadores ocorre perto de uma junção p – n, o campo interno na região de deplecção impede a sua recombinação e produz uma corrente, \(I_L \), num circuito conectado externamente. Esta corrente é muito maior do que a corrente resultante da geração térmica de pares electrão-buraco já presente, fazendo com que a junção p-n se comporte como uma fonte de corrente. A corrente total produzida é dada por:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I = I_D - I_L = I_g \cdot (e^{eV_b/k_B T}-1) - I_L &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Figura 3 mostra os diferentes tipos de corrente existentes numa junção p-n iluminada.&lt;br /&gt;
&lt;br /&gt;
[[File:Photon_absor.PNG||thumb|Fig. 3 - Diferentes correntes existentes numa junção p-n iluminada. |center|350px]]&lt;br /&gt;
&lt;br /&gt;
= Estudos experimentais =&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Bibliografia =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
*[[ Photovoltaic panel | Versão em Inglês (English Version)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3762</id>
		<title>Painel Fotovoltaico</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3762"/>
		<updated>2020-08-31T18:24:02Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Descrição da experiência =&lt;br /&gt;
[[File:Pv panel photo.jpg||thumb|Fig. 1 - Aparato experimental utilizado composto pelo painel de leds tricolores, painel fotovoltaico amorfo e controlador. |right|border|300px]]&lt;br /&gt;
&lt;br /&gt;
A energia solar fotovoltaica é uma fonte de energia limpa e renovável, em rápido crescimento. Os painéis fotovoltaicos usam radiação solar para produzir eletricidade, que pode ser usada localmente ou injectada na rede elétrica.&lt;br /&gt;
&lt;br /&gt;
A presente experiência pretende estudar vários factores que afetam a característica, a eficiência e a potência produzida por um painel fotovoltaico. Para tal, um painel de LEDs fixo, contendo vários LEDs RGB, é usado como fonte de radiação para um painel fotovoltaico. Este painel fotovoltaico pode rodar e, consequentemente, variar o ângulo que faz com o painel de LEDs. Além disso, a resistência de carga conectada ao painel fotovoltaico também pode ser variada, permitindo estudar os impactos desta quantidade na tensão, corrente e potência produzidas pelo painel fotovoltaico.&lt;br /&gt;
&lt;br /&gt;
Este aparato experimental permite a simulação e análise dos fatores mais relevantes que afetam o uso de painéis fotovoltaicos em ambientes reais, contribuindo para a compreensão dos desafios e detalhes relacionados com tal uso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:320px&amp;quot;&amp;gt;&lt;br /&gt;
'''Links'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/fotovoltaico.sdp&lt;br /&gt;
*Laboratório: Básico no [http://elab.tecnico.ulisboa.pt elab]&lt;br /&gt;
*Sala de controlo: Fotovoltaico&lt;br /&gt;
*Nível: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Aparato Experimental =&lt;br /&gt;
&lt;br /&gt;
== Descrição ==&lt;br /&gt;
[[File:Pv_panel.jpg||thumb|Fig. 2 - Representação esquemática da experiência onde o painel de leds está fixo e o painel fotovoltaico pode rodar em torno dum eixo, variando deste modo o ângulo de incidência dos raios luminosos. |right|border|250px]]&lt;br /&gt;
&lt;br /&gt;
O aparato experimental utilizado é composto por três componentes principais:&lt;br /&gt;
;Painel de LEDs:&lt;br /&gt;
: um painel fixo contendo 162 LEDs RGB do modelo SMD5050, organizados numa grelha 18 x 9. Cada um destes LEDs RGB é composto internamente por 3 LEDs (vermelho, verde e azul) que podem ser controlados independentemente, permitindo a seleção de qualquer cor desejada. Deste modo os resultados permitem determinar também a eficiência do painel para vários comprimentos de onda.&lt;br /&gt;
;Painel fotovoltaico:&lt;br /&gt;
: um painel fotovoltaico montado sobre um eixo rotativo. Este eixo está conectado a um motor servo que permite a rotação do painel e, consequentemente, a variação do ângulo entre os painéis LED e fotovoltaico.&lt;br /&gt;
;Resistência de carga variável:&lt;br /&gt;
: o painel fotovoltaico está conectado a uma resistência variável que atua como a carga que é alimentada pelo painel. O valor de tal resistência também pode ser variado.&lt;br /&gt;
&lt;br /&gt;
As dimensões dos painéis LED e fotovoltaico encontram-se na tabela seguinte.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Dimensões dos painéis (mm)&lt;br /&gt;
|-&lt;br /&gt;
| LEDs RGB &lt;br /&gt;
|145 x 90&lt;br /&gt;
|-&lt;br /&gt;
| Fotovoltaico &lt;br /&gt;
|150 x 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A figura 2 mostra uma representação esquemática da experiência. É importante notar que a colocação do painel fotovoltaico a 0º corresponde a ter os dois painéis paralelos, ou seja, o máximo de radiação emitida pelo painel LED atinge o painel fotovoltaico. O limite oposto corresponde ao painel fotovoltaico a 90º, colocando ambos os painéis perpendiculares.&lt;br /&gt;
&lt;br /&gt;
Por fim, o utilizador deve ter em conta que os três LEDs internos (vermelho, verde e azul) constituinte de cada um dos LEDs RGB emitem com intensidades diferentes devido à tecnologia relativa à produção de cada led. Deste modo cada comprimento de onda em jogo deve atender a essa correção na emissividade. Para referência, a tabela abaixo mostra essa relação para o fluxo luminoso real (intensidade da radiação no visível) emitido pelos LEDs das diferentes cores.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Fluxo luminoso para LEDs RGB&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|(Medido com brilho máximo - nivel 255)&lt;br /&gt;
|-&lt;br /&gt;
|Cor&lt;br /&gt;
|Fluxo luminoso (lux)&lt;br /&gt;
|-&lt;br /&gt;
|Vermelho (R)&lt;br /&gt;
|1080&lt;br /&gt;
|-&lt;br /&gt;
|Verde (G)&lt;br /&gt;
|5780&lt;br /&gt;
|-&lt;br /&gt;
|Azul (B)&lt;br /&gt;
|7320&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuração ==&lt;br /&gt;
&lt;br /&gt;
O utilizador pode definir os seguintes parâmetros experimentais:&lt;br /&gt;
;Intensidade vermelho (R):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente vermelho de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade verde (G):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente verde de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade azul (B):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente azul de acordo com o modelo de cores RGB;&lt;br /&gt;
;Ângulo:&lt;br /&gt;
: De -20º a 100º, é o ângulo entre os painéis LED e fotovoltaico, como mostrado na figura 2;&lt;br /&gt;
;Resistência de carga:&lt;br /&gt;
: De 1 a 100, esta quantidade é proporcional à resistência de carga conectada ao painel fotovoltaico;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mais ainda, a experiência pode ser executada em três modos distintos:&lt;br /&gt;
;Varrimento de ângulo:&lt;br /&gt;
: o painel fotovoltaico é rodado de -20º a 100º em etapas de 1º, mantendo constantes a cor selecionada e a resistência de carga;&lt;br /&gt;
;Varrimento da resistência de carga:&lt;br /&gt;
: o valor da resistência de carga varia de 1 a 100% com as etapas de 1, mantendo constantes a cor e o ângulo selecionados;&lt;br /&gt;
;Encontrar a resistência de carga correspondente à máxima potência:&lt;br /&gt;
: para uma determinada cor e ângulo selecionados, o valor da resistência de carga que maximiza a potência extraída do painel é encontrado automaticamente através de um processo iterativo similar ao utilizado nos ''Maximum Power Point Tracking'' (MPPT);&lt;br /&gt;
&lt;br /&gt;
== Resultados ==&lt;br /&gt;
Após o início da experiência, é retornada uma tabela dinâmica com a data/hora de cada medição, o ângulo entre os painéis, o valor da resistência de carga e os elementos medidos em cada ponto: a tensão e a corrente na resistência de carga permitindo determinar indiretamente a potência total consumida nessa resistência (carga).&lt;br /&gt;
&lt;br /&gt;
Deve ser dada particular atenção à propagação de erros na potência pois quer a corrente quer a tensão variam.&lt;br /&gt;
&lt;br /&gt;
A aplicação permite ainda visualizar em tempo real os dados que vão sendo recolhidos.&lt;br /&gt;
&lt;br /&gt;
= Física =&lt;br /&gt;
== Semicondutores ==&lt;br /&gt;
Os paineis fotovoltaicos baseam-se em junções p-n de silício. O silício puro é um semicondutor intrínseco com uma condutividade elétrica de cerca de 2500 \(\Omega \cdot m\), indicando que este material não é um condutor nem um isolante. Um semicondutor puro pode ser dopado através da adição de iões de impurezas específicas, criando semicondutores extrínsecos. Considerando que o silício possui 4 electrões de valência, os iões dopantes de impurezas de menor valência tornam-se aceitadores de elctrões e as impurezas de maior valência tornam-se dadores de electrões. Para o primeiro caso, se não houver electrões livres, produzem-se estados de carga positiva, conhecidos como buracos, que se movem através do material e actuam como portadores maioritários. No caso dos dadores de electrões, existe um excesso de electrões livres que actuam como portadores maioritários. Para o silício dopado, os valores típicos de condutividade elétrica encontram-se em torno de 10 \(\Omega \cdot cm\).&lt;br /&gt;
&lt;br /&gt;
== Junções P-N ==&lt;br /&gt;
Quando um material do tipo p entra em contacto com um material do tipo n, forma-se uma região de mudança de dopante - a junção p-n. Quando essa junção é criada, o excesso de electrões do material do tipo n (dador) move-se para o material do tipo p (aceitador) e os buracos em excesso do material do tipo p movem-se para o material do tipo n. Esta movimentação de cargas ocorre até que um estado estacionário seja alcançado. Neste estado, o campo elétrico causado pela acumulação de cargas de sinais opostos em cada um dos lados da junção equilibra a difusão decorrente das diferentes concentrações de electrões livres e buracos. Em torno da interface entre os materiais do tipo p e n é criada uma zona sem portadores maioritários - a região de deplecção.&lt;br /&gt;
&lt;br /&gt;
Em tal junção, pares de livres e buracos podem ser espontaneamente gerados a partir de estados ligados, principalmente devido a excitação térmica. Quando tais portadores são gerados ou são capazes de se difundir para a região de deplecção, são puxadas electrostaticamente de acordo com os seus respectivos gradientes de potencial, criando uma corrente de geração constante, \(I_g\). Para manter o equilíbrio geral de corrente na região de deplecção, existe uma corrente de recombinação inversa \(I_r\), que resulta da recombinação de electrões e buracos provenientes dos diferentes lados da junção. Cada evento de recombinação electeão-buraco corresponde ao transporte de uma carga elementar através da junção.&lt;br /&gt;
Se a junção p-n não estiver iluminada e não tiver polarização externa, a corrente total é nula porque \(I_r = I_g\). No entanto, se uma polarização externa positiva for aplicada à junção \(V_b\), a corrente de recombinação é \(I_r = I_g \cdot e ^ {eV_b / k_B T} \), o que resulta numa corrente total no escuro, \(I_D\):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I_D = I_r - I_g = I_g \cdot (e ^ {eV_b / k_B T} -1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Essa expressão é muito semelhante à característica de um diodo. A única diferença é que, num diodo, \(I_g\) é substituído por \(I_0 \), a corrente de saturação.&lt;br /&gt;
&lt;br /&gt;
== Absorção de fotões na junção P-N ==&lt;br /&gt;
Quando uma junção p-n é exposta a radiação eletromagnética, um processo de formação de pares electrão-buraco é responsável pela maior parte da sua absorção. Como anteriormente visto, a formação destes pares resulta na criação de dois portadores de carga. Quando a criação de tais portadores ocorre perto de uma junção p – n, o campo interno na região de deplecção impede a sua recombinação e produz uma corrente, \(I_L \), num circuito conectado externamente. Esta corrente é muito maior do que a corrente resultante da geração térmica de pares electrão-buraco já presente, fazendo com que a junção p-n se comporte como uma fonte de corrente. A corrente total produzida é dada por:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I = I_D - I_L = I_g \cdot (e^{eV_b/k_B T}-1) - I_L &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Figura 3 mostra os diferentes tipos de corrente existentes numa junção p-n iluminada.&lt;br /&gt;
&lt;br /&gt;
[[File:Photon_absor.PNG||thumb|Fig. 3 - Diferentes correntes existentes numa junção p-n iluminada. |center|350px]]&lt;br /&gt;
&lt;br /&gt;
= Estudos experimentais =&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Bibliografia =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
*[[ Photovoltaic panel | Versão em Inglês (English Version)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3760</id>
		<title>Plano Inclinado</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3760"/>
		<updated>2020-08-22T14:41:20Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Plano Inclinado=&lt;br /&gt;
&lt;br /&gt;
==Descrição da experiência ==&lt;br /&gt;
&lt;br /&gt;
O plano inclinado é uma das seis [https://pt.wikipedia.org/wiki/M%C3%A1quina_simples máquinas simples clássicas]. Os planos inclinados são geralmente utilizados para mover cargas pesadas sobre obstáculos verticais, tais como rampas para mover carga.&lt;br /&gt;
&lt;br /&gt;
Mover um objeto para cima sobre plano inclinado requer menos força do que levantá-lo na vertical, como se desmultiplicássemos a gravidade! Esta vantagem mecânica pelo qual a força é reduzida é igual à razão entre o comprimento da superfície inclinada e a altura do plano.&lt;br /&gt;
&lt;br /&gt;
Nas experiências laboratoriais que recriam esta máquina, na situação em que não é usada uma calha de ar de modo a quase eliminar o atrito de rolamento, o plano tem de ter uma inclinação significativa de forma a que a aceleração gravítica possa ser muito superior ao atrito, impossibilitando que a experiência possa ser realizada num tempo grande, percetível aos sentidos humanos.&lt;br /&gt;
&lt;br /&gt;
Contudo o atrito faz parte integrante da mecânica do problema e esta experiência permite determinar a função de atrito através duma análise multi-variada ajustando uma função que dependa da inclinação da calha. A experiência para o efeito, permite alterar o ângulo de descida e, através deste, separar as forças de atrito da gravítica, obtendo-se um valor muito próximo de 9,8 ms&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:420px&amp;quot;&amp;gt;&lt;br /&gt;
'''Ligações'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/plinc.sdp&lt;br /&gt;
*Laboratory: [http://elab.tecnico.ulisboa.pt Básico]&lt;br /&gt;
*Control room: Plano inclinado&lt;br /&gt;
*Level: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Propositadamente nesta experiência é usado um carro equipado com um pára-vento frontal de modo a exacerbar o efeito do atrito e demonstrar que a sua equação pode ser determinada pela análise multivariada de vários percursos para inclinações diferentes.&lt;br /&gt;
&lt;br /&gt;
==Aparato experimental==&lt;br /&gt;
&lt;br /&gt;
[[File:Pincl_Schematic.png||thumb|Esquema da montagem do plano inclinado, cujo fulcro do balanço é a origem do ângulo.|right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Promenor_Sonar.jpeg||thumb|Vista geral da experiencia com o sonar numa das extremidades, após a mola coletora do embate. |right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
O plano inclinado desta experiência recria essa &amp;quot;desmultiplicação da gravidade&amp;quot;. Consiste num veículo que se desloca numa calha com inclinação regulável e que bascula no seu ponto médio. A altura da calha é medida a 1003 mm do eixo da experiência.&lt;br /&gt;
&lt;br /&gt;
Inicialmente a calha bascula para uma posição com um ângulo negativo de modo a recolher e a parquear o carro na origem, a cerca de 1,3m da mola que irá absorver a energia do seu movimento. Este é imobilizado através dum eletroíman e posteriormente a calha é elevada até à altura pré-selecionada. Quando atinge esse ponto, o eletroíman liberta o carrinho e este desloca-se livremente sobre a calha até embater na mola.&lt;br /&gt;
Um detector ultra-sónico colhe então amostras da posição em função do tempo decorrido, permitindo traçar a trajectória do veículo durante a queda e no seu amortecimento final.&lt;br /&gt;
&lt;br /&gt;
==Protocolo==&lt;br /&gt;
Com base nos dados pré-seleccionados na experiência obtenha um gráfico da posição em função do tempo decorrido. Com base nestes dados determine ainda os gráficos da velocidade e da aceleração. Compare o valor obtido da aceleração com a gravidade.&lt;br /&gt;
&lt;br /&gt;
===Determinação da velocidade em função da distância percorrida===&lt;br /&gt;
Com base nos dados anteriores determine a velocidade em função da distância percorrida, eliminando o tempo nos gráficos anteriores, ou seja, traçando a curva desenhada pelos pares velocidade, distância para cada tempo disponível.&lt;br /&gt;
&lt;br /&gt;
===Determinação da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Em função das várias parábolas obtidas no amortecimento do veículo, determine a perda relativa de energia em cada embate com a mola e determine a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Protocolo avançado==&lt;br /&gt;
Como pode ser inferido rapidamente, o ajuste do modelo parabólico ao movimento produz um desvio só possivel de entender com a inclusão dum termo de fricção. Com efeito o carrinho dispõe duma pala frontal destinada a induzir um certo atrito aerodinâmico. Adaptando as equações de modo a incluir um termo de atrito de rolamento (linear com a velocidade) e aerodinâmico (Cx, dependencia quadrática com a velocidade), pode-se determinar finalmente um valor mais preciso para a aceleração do veículo.&lt;br /&gt;
Normalmente o ''Cx'' só influência significativamente o movimento a partir dos 25 km/h. &lt;br /&gt;
&lt;br /&gt;
O ajuste duma função de atrito para a aceleração na forma ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' permite extrair a aceleração local da gravidade ao serem utilizadas várias séries de dados para ângulos variados.&lt;br /&gt;
&lt;br /&gt;
===Modelo multivariado===&lt;br /&gt;
A análise multivariada utilizada serve para construir um modelo de ajuste numérido para vários ângulos às várias características do movimento obtido. A variação do ângulo permite com efeito distinguir o efeito da gravidade da força de atrito de rolamento já que este é considerado independente do ângulo. Dete modo, ao fazer um ajuste do tipo ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' o parâmetro ''b'' que detém implicitamente a gravidade e o atrito de rolamento (relacionado com a mecânica do veículo) pode ser resolvido separando-o em ''b=g*sin(θ) + b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;''. Os restantes parâmetros resultam dum modelo da dependência do atrito com a velocidade que para valores elevados desta (tipicamente superior a 7-10 ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;) tem uma forte dependência quadrática na velocidade – atrito aerodinâmico – mas que no nosso caso também temos de considerar a dependência de atrito mecânico (''b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;+c*v'') uma vez que o carro parte do repouso.&lt;br /&gt;
&lt;br /&gt;
Ao realizar esta análise multivariada estamos a considerar uma associação independente entre os parâmetros, condição necessária para esses parâmetros fazerem parte de um modelo numérico que se provará correto pelo desfecho do ajuste. Para o efeito deverá ser utilizado um ''solver'' numérico ajustando iterativamente as várias co-variáveis, tal como o do MSExcel.&lt;br /&gt;
&lt;br /&gt;
===Determinação rigorosa da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Uma análise breve permite concluir que a constante de restituição da mola para os vários embates vem ferida dum erro apreciável, tanto maior quanto o percurso percorrido, uma vez que o trabalho realizado pela força de atrito prejudica o cálculo da energia mecânica em cada troço do movimento. No entanto, calculando o trabalho efetuado pela força de atrito com base na equação da força de atrito determinada pelo processo anteriormente descrito, permite inferir corretamente a energia mecânica antes e depois de cada embate, permitindo calcular corretamente a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Inclined plane | This page in English]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3758</id>
		<title>Plano Inclinado</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3758"/>
		<updated>2020-08-22T14:32:24Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Plano Inclinado=&lt;br /&gt;
&lt;br /&gt;
==Descrição da experiência ==&lt;br /&gt;
&lt;br /&gt;
O plano inclinado é uma das seis [https://pt.wikipedia.org/wiki/M%C3%A1quina_simples máquinas simples clássicas]. Os planos inclinados são geralmente utilizados para mover cargas pesadas sobre obstáculos verticais, tais como rampas para mover carga.&lt;br /&gt;
&lt;br /&gt;
Mover um objeto para cima sobre plano inclinado requer menos força do que levantá-lo na vertical, como se desmultiplicássemos a gravidade! Esta vantagem mecânica pelo qual a força é reduzida é igual à razão entre o comprimento da superfície inclinada e a altura da rampa.&lt;br /&gt;
&lt;br /&gt;
Nas experiências laboratoriais que recriam esta máquina, na situação em que não é usada uma calha de ar de modo a quase eliminar o atrito de rolamento, a rampa tem de ter uma inclinação significativa de forma a que a aceleração gravítica possa ser muito superior ao atrito, impossibilitando que a experiência possa ser realizada num tempo grande, percetível aos sentidos humanos.&lt;br /&gt;
&lt;br /&gt;
Contudo o atrito faz parte integrante da mecânica do problema e esta experiência permite determinar a função de atrito através duma análise multi-variada ajustando uma função que dependa da inclinação da calha. A experiência para o efeito, permite alterar o ângulo de descida e, através deste, separar as forças de atrito da gravítica, obtendo-se um valor muito próximo de 9,8 ms&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:420px&amp;quot;&amp;gt;&lt;br /&gt;
'''Ligações'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/plinc.sdp&lt;br /&gt;
*Laboratory: [http://elab.tecnico.ulisboa.pt Básico]&lt;br /&gt;
*Control room: Plano inclinado&lt;br /&gt;
*Level: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Propositadamente nesta experiência é usado um carro equipado com um pára-vento frontal de modo a exarcebar o efeito do atrito e demonstrar que a sua equação pode ser determinada pela anáside multivariada de vários percursos para ângulos váriados.&lt;br /&gt;
&lt;br /&gt;
==Aparato experimental==&lt;br /&gt;
&lt;br /&gt;
[[File:Pincl_Schematic.png||thumb|Esquema da montagem do plano inclinado, cujo fulcro do balanço é a origem do ângulo.|right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Promenor_Sonar.jpeg||thumb|Vista geral da experiencia com o sonar numa das extremidades, após a mola coletora do embate. |right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
O plano inclinado desta experiência recria essa &amp;quot;desmultiplicação da gravidade&amp;quot;. Consiste num veículo que se desloca numa calha com um ângulo regulavel e que bascula no seu ponto médio. A altura da calha é medida a 1003 mm do eixo da experiência.&lt;br /&gt;
&lt;br /&gt;
Inicialmente a calha bascula para uma posição com um ângulo negativo de modo a recolher e a parquear o carro na origem, a cerca de 1,3m da mola que irá absorver a energia do seu movimento. Este é imobilizado através dum eletroímã e posteriormente a calha é elevada até à altura pré-seleccionada. Quando atinge esse ponto, o electroímane liberta o carrinho e este desloca-se livremente sobre a calha até embater na mola.&lt;br /&gt;
Um detector ultra-sónico colhe então amostras da posição em função do tempo decorrido, permitindo traçar a trajectória do veículo durante a queda e no seu amortecimento final.&lt;br /&gt;
&lt;br /&gt;
==Protocolo==&lt;br /&gt;
Com base nos dados pré-seleccionados na experiência obtenha um gráfico da posição em função do tempo decorrido. Com base nestes dados determine ainda os gráficos da velocidade e da aceleração. Compare o valor obtido da aceleração com a gravidade.&lt;br /&gt;
&lt;br /&gt;
===Determinação da velocidade em função da distância percorrida===&lt;br /&gt;
Com base nos dados anteriores determine a velocidade em função da distância percorrida, eliminando o tempo nos gráficos anteriores, ou seja, traçando a curva desenhada pelos pares velocidade, distância para cada tempo disponível.&lt;br /&gt;
&lt;br /&gt;
===Determinação da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Em função das várias parábolas obtidas no amortecimento do veículo, determine a perda relativa de energia em cada embate com a mola e determine a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Protocolo avançado==&lt;br /&gt;
Como pode ser inferido rapidamente, o ajuste do modelo parabólico ao movimento produz um desvio só possivel de entender com a inclusão dum termo de fricção. Com efeito o carrinho dispõe duma pala frontal destinada a induzir um certo atrito aerodinâmico. Adaptando as equações de modo a incluir um termo de atrito de rolamento (linear com a velocidade) e aerodinâmico (Cx, dependencia quadrática com a velocidade), pode-se determinar finalmente um valor mais preciso para a aceleração do veículo.&lt;br /&gt;
Normalmente o ''Cx'' só influência significativamente o movimento a partir dos 25 km/h. &lt;br /&gt;
&lt;br /&gt;
O ajuste duma função de atrito para a aceleração na forma ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' permite extrair a aceleração local da gravidade ao serem utilizadas várias séries de dados para ângulos variados.&lt;br /&gt;
&lt;br /&gt;
===Modelo multivariado===&lt;br /&gt;
A análise multivariada utilizada serve para construir um modelo de ajuste numérido para vários ângulos às várias características do movimento obtido. A variação do ângulo permite com efeito distinguir o efeito da gravidade da força de atrito de rolamento já que este é considerado independente do ângulo. Dete modo, ao fazer um ajuste do tipo ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' o parâmetro ''b'' que detém implicitamente a gravidade e o atrito de rolamento (relacionado com a mecânica do veículo) pode ser resolvido separando-o em ''b=g*sin(θ) + b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;''. Os restantes parâmetros resultam dum modelo da dependência do atrito com a velocidade que para valores elevados desta (tipicamente superior a 7-10 ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;) tem uma forte dependência quadrática na velocidade – atrito aerodinâmico – mas que no nosso caso também temos de considerar a dependência de atrito mecânico (''b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;+c*v'') uma vez que o carro parte do repouso.&lt;br /&gt;
&lt;br /&gt;
Ao realizar esta análise multivariada estamos a considerar uma associação independente entre os parâmetros, condição necessária para esses parâmetros fazerem parte de um modelo numérico que se provará correto pelo desfecho do ajuste. Para o efeito deverá ser utilizado um ''solver'' numérico ajustando iterativamente as várias co-variáveis, tal como o do MSExcel.&lt;br /&gt;
&lt;br /&gt;
===Determinação rigorosa da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Uma análise breve permite concluir que a constante de restituição da mola para os vários embates vem ferida dum erro apreciável, tanto maior quanto o percurso percorrido, uma vez que o trabalho realizado pela força de atrito prejudica o cálculo da energia mecânica em cada troço do movimento. No entanto, calculando o trabalho efetuado pela força de atrito com base na equação da força de atrito determinada pelo processo anteriormente descrito, permite inferir corretamente a energia mecânica antes e depois de cada embate, permitindo calcular corretamente a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Inclined plane | This page in English]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Reposit%C3%B3rio_de_Conte%C3%BAdos&amp;diff=3756</id>
		<title>Repositório de Conteúdos</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Reposit%C3%B3rio_de_Conte%C3%BAdos&amp;diff=3756"/>
		<updated>2020-08-22T14:08:43Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bem-vindo à wiki do e-lab. Aqui serão reunidos artigos com a documentação e textos de apoio às experiências dos laboratórios remotos do IST.&lt;br /&gt;
&lt;br /&gt;
=Introdução=&lt;br /&gt;
O e-lab é um espaço onde podem ser realizadas experiências reais através da Internet.&lt;br /&gt;
&lt;br /&gt;
As experiências estão montadas e instaladas fisicamente num laboratório do [http://www.ist.utl.pt/ Instituto Superior Técnico] ou em escolas e centros de ciência parceiras. A experiencia é controlada pelo seu administrador, que não é mais do que o primeiro membro da lista de espera dos utilizadores interessados em realizá-la. Existe, também, uma lista que permite, por exemplo, que um professor realize a experiência e os seus alunos recebam em simultâneo a imagem e os dados, apesar de poderem estar em locais fisicamente distantes.&lt;br /&gt;
&lt;br /&gt;
Os dados das experiências e a imagem dos acontecimentos (vídeos) são captados por meio de sensores conectados, directa ou indirectamente, a um computador central, de onde são difundidos através da Internet.&lt;br /&gt;
&lt;br /&gt;
Cada '''sala de controlo''', que corresponde a uma determinada experiência, dispõe dum espaço próprio, onde se sugere um protocolo experimental, sugestões de variantes à experiência, bem como as explicações e análises dos dados. Cada sala de controlo dispõe, também, de um chat onde todos podem tecer comentários e trocar informação sobre a experiência e sobre a análise dos dados.&lt;br /&gt;
&lt;br /&gt;
Sala de controlo, aparato experimental, protocolo e montagem experimental são conceitos fundamentais no e-lab:&lt;br /&gt;
&lt;br /&gt;
* '''Sala de controlo:''' ambiente virtual para controlo dum aparato experimental real incluído num determinado laboratório.&lt;br /&gt;
* '''Aparato experimental:''' equipamento que permite realizar determinada experiência.&lt;br /&gt;
* '''Montagem experimental:''' configuração do aparato experimental de acordo com o protocolo a executar.&lt;br /&gt;
* '''Protocolo:''' sequência da execução da experiência com a respectiva selecção e configuração da montagem experimental.&lt;br /&gt;
&lt;br /&gt;
Os utilizadores do portal e-escola podem enviar sugestões ou relatórios das suas experiências para [mailto:wwwelab@ist.utl.pt este endereço].&lt;br /&gt;
&lt;br /&gt;
O IST providencia ainda [[Cursos de Formação]] a docentes do ensino secundário.&lt;br /&gt;
&lt;br /&gt;
Há também uma página de apoio a [[Estudantes Brasileiros]].&lt;br /&gt;
&lt;br /&gt;
O projecto [[Pêndulo Mundial]] é um bom exemplo dos nossos planos para o futuro.&lt;br /&gt;
&lt;br /&gt;
=Experiências=&lt;br /&gt;
&lt;br /&gt;
Antes de tentar iniciar o elab, certifique-se de ter instalado o JAVA e o VLC e todas as permissões de segurança definidas como explicado nas [[Add_e-lab_to_Java's_Security_Exception_Site_List | PERGUNTAS FREQUENTES]]&lt;br /&gt;
&lt;br /&gt;
{{Launch}}&lt;br /&gt;
==Laboratório Básico==&lt;br /&gt;
*[[Queda de Graves (determinação de g)]]&lt;br /&gt;
*[[Conservação do Momento Linear]]&lt;br /&gt;
*[[Variação da Pressão num Líquido com a Profundidade]]&lt;br /&gt;
*[[Estatística de Dados]]&lt;br /&gt;
*[[Lei de Boyle-Mariotte]]&lt;br /&gt;
*[[Lei de Hooke]]&lt;br /&gt;
*[[Determinação da Velocidade do Som]]&lt;br /&gt;
*[[Pêndulo de Haste Rígida]] (em construção)&lt;br /&gt;
*[[Determinação do consumo de água em plantas]](em construção)&lt;br /&gt;
*[[Painel_Fotovoltaico | Painel Fotovoltaico]]&lt;br /&gt;
*[[Plano Inclinado| Plano Inclinado]]&lt;br /&gt;
*[[Pêndulo Mundial]]&lt;br /&gt;
&lt;br /&gt;
==Laboratório Intermédio==&lt;br /&gt;
*[[Determinação da Condutividade Térmica em Metais]]  &lt;br /&gt;
*[[Atenuação da Radiação em Diferentes Materiais]]       &amp;lt;!-- determinação da semi espessura do cobre --&amp;gt;&lt;br /&gt;
*[[Estação Metreológica]]&lt;br /&gt;
*[[Oscilações de um Pêndulo Amortecido | Pendulo Amortecido]]&lt;br /&gt;
*[[Conservação do Momento Angular]]&lt;br /&gt;
*[[Optica de uma Câmara Estenopeica (Pinhole)]]&lt;br /&gt;
*[[Estudos de Óptica num Prisma Semi-cilíndrico]]&lt;br /&gt;
*[[Campo de indução magnético criado por 2 condutores]]&lt;br /&gt;
*[[Polarização da Luz]]&lt;br /&gt;
*[[Determinação da Constante de Planck]]&lt;br /&gt;
&lt;br /&gt;
==Laboratório Avançado==&lt;br /&gt;
*[[Estudo de Estacionárias]]&lt;br /&gt;
*[[Determinação da Constante Adiabática do Ar]]&lt;br /&gt;
*[[Propagação de Solitões num Meio Viscoso]]&lt;br /&gt;
*[[Determinação da Constante Dieléctrica num Condensador Cilíndrico]]&lt;br /&gt;
*[[Sonda de Langmuir]]&lt;br /&gt;
*[[Curva de Paschen]]&lt;br /&gt;
&lt;br /&gt;
=Mais Informações=&lt;br /&gt;
&amp;lt;!--[[Personalidades]] (em construção): NAO FAZ SENTIDO --&amp;gt;&lt;br /&gt;
*[[Publications | Publicações]]&lt;br /&gt;
&lt;br /&gt;
*[[Hall of fame | Colaboradores do e-lab]]&lt;br /&gt;
&lt;br /&gt;
*[[Como instalar o Java]]&lt;br /&gt;
&lt;br /&gt;
*[[Executar o e-lab a partir da command prompt]]&lt;br /&gt;
&lt;br /&gt;
*[[Adicionar o e-lab às excepções de segurança do Java]]&lt;br /&gt;
&lt;br /&gt;
*[[Training | Programas de formação]]&lt;br /&gt;
&lt;br /&gt;
=Ferramentas=&lt;br /&gt;
*[[FAQ.pt]]&lt;br /&gt;
*[[Fitteia]]&lt;br /&gt;
*[[Editor Online de Latex]]&lt;br /&gt;
*[[Main Page|Lista de experiências]]&lt;br /&gt;
*[[My solutions]]&lt;br /&gt;
&lt;br /&gt;
=Licensa=&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by-sa/4.0/&amp;quot;&amp;gt;&amp;lt;img alt=&amp;quot;Licença Creative Commons&amp;quot; style=&amp;quot;border-width:0&amp;quot; src=&amp;quot;http://i.creativecommons.org/l/by-sa/4.0/88x31.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;Esta obra e todos os conteúdos sob o portal do e-lab estão licenciados sob uma Licença &amp;lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by-sa/4.0/&amp;quot;&amp;gt;Creative Commons - Atribuição-Partilha nos termos da mesma licença 4.0 Internacional&amp;lt;/a&amp;gt;.&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3752</id>
		<title>Painel Fotovoltaico</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_Fotovoltaico&amp;diff=3752"/>
		<updated>2020-08-22T14:08:18Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: Ist176128 moved page Painel fotovoltaico to Painel Fotovoltaico&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Descrição da experiência =&lt;br /&gt;
[[File:Pv panel photo.jpg||thumb|Fig. 1 - Aparato experimental utilizado composto pelo painel de leds tricolores, painel fotovoltaico amorfo e controlador. |right|border|300px]]&lt;br /&gt;
&lt;br /&gt;
A energia solar fotovoltaica é uma fonte de energia limpa e renovável, em rápido crescimento. Os painéis fotovoltaicos usam radiação solar para produzir eletricidade, que pode ser usada localmente ou injectada na rede elétrica.&lt;br /&gt;
&lt;br /&gt;
A presente experiência pretende estudar vários factores que afetam a característica, a eficiência e a potência de um painel fotovoltaico. Para tal, um painel de LEDs fixo, contendo vários LEDs RGB, é usado como fonte de radiação para um painel fotovoltaico. Este painel fotovoltaico pode rodar e, consequentemente, variar o ângulo que faz com o painel de LEDs. Além disso, a resistência da carga conectada ao painel fotovoltaico também pode ser variada, permitindo estudar os imapctos desta quantidade na tensão, corrente e potência produzidas pelo painel fotovoltaico.&lt;br /&gt;
&lt;br /&gt;
Este aparato experimental permite a simulação e análise dos fatores mais relevantes que afetam o uso de painéis fotovoltaicos em ambientes reais, contribuindo para a compreensão dos desafios e detalhes relacionados com tal uso.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:320px&amp;quot;&amp;gt;&lt;br /&gt;
'''Links'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/fotovoltaico.sdp&lt;br /&gt;
*Laboratório: Básico no [http://elab.tecnico.ulisboa.pt elab]&lt;br /&gt;
*Sala de controlo: Fotovoltaico&lt;br /&gt;
*Nível: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Aparato Experimental =&lt;br /&gt;
&lt;br /&gt;
== Descrição ==&lt;br /&gt;
[[File:Pv_panel.jpg||thumb|Fig. 2 - Representação esquemática da experiência onde o painel de leds está fixo e o painel fotovoltaico pode rodar em torno dum eixo, variando deste modo o ângulo de incidência dos raios luminosos. |right|border|250px]]&lt;br /&gt;
&lt;br /&gt;
O aparato experimental utilizado é composto por três componentes principais:&lt;br /&gt;
;Painel de LEDs:&lt;br /&gt;
: um painel fixo contendo 162 LEDs RGB do modelo SMD5050, organizados numa grelha 18 x 9. Cada um destes LEDs RGB é composto internamente por 3 LEDs (vermelho, verde e azul) que podem ser controlados independentemente, permitindo a seleção de qualquer cor desejada. Deste modo os resultados permitem determinar também a eficiência do painel para vários comprimentos de onda.&lt;br /&gt;
;Painel fotovoltaico:&lt;br /&gt;
: um painel fotovoltaico montado sobre um eixo rotativo. Este eixo está conectado a um motor servo que permite a rotação do painel e, consequentemente, a variação do ângulo entre os painéis LED e fotovoltaico.&lt;br /&gt;
;Resistência de carga variável:&lt;br /&gt;
: o painel fotovoltaico está conectado a uma resistência variável que atua como a carga que é alimentada pelo painel. O valor de tal resistência também pode ser variado.&lt;br /&gt;
&lt;br /&gt;
As dimensões dos painéis LED e fotovoltaico encontram-se na tabela seguinte.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Dimensões dos painéis (mm)&lt;br /&gt;
|-&lt;br /&gt;
| LEDs RGB &lt;br /&gt;
|145 x 90&lt;br /&gt;
|-&lt;br /&gt;
| Fotovoltaico &lt;br /&gt;
|150 x 100&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A figura 2 mostra uma representação esquemática da experiência. É importante notar que a colocação do painel fotovoltaico a 0º corresponde a ter os dois painéis paralelos, ou seja, o máximo de radiação emitida pelo painel LED atinge o painel fotovoltaico. O limite oposto corresponde ao painel fotovoltaico a 90º, colocando ambos os painéis perpendiculares.&lt;br /&gt;
&lt;br /&gt;
Por fim, o utilizador deve ter em conta que os três LEDs internos (vermelho, verde e azul) constituinte de cada um dos LEDs RGB emitem com intensidades diferentes devido à tecnologia relativa à produção de cada led. Deste modo cada comprimento de onda em jogo deve atender a essa correção na emissividade. Para referência, a tabela abaixo mostra essa relação para o fluxo luminoso real (intensidade da radiação no visível) emitido pelos LEDs das diferentes cores.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Fluxo luminoso para LEDs RGB&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|(Medido com brilho máximo - nivel 255)&lt;br /&gt;
|-&lt;br /&gt;
|Cor&lt;br /&gt;
|Fluxo luminoso (lux)&lt;br /&gt;
|-&lt;br /&gt;
|Vermelho (R)&lt;br /&gt;
|1080&lt;br /&gt;
|-&lt;br /&gt;
|Verde (G)&lt;br /&gt;
|5780&lt;br /&gt;
|-&lt;br /&gt;
|Azul (B)&lt;br /&gt;
|7320&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuração ==&lt;br /&gt;
&lt;br /&gt;
O utilizador pode definir os seguintes parâmetros experimentais:&lt;br /&gt;
;Intensidade vermelho (R):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente vermelho de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade verde (G):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente verde de acordo com o modelo de cores RGB;&lt;br /&gt;
;Intensidade azul (B):&lt;br /&gt;
: De 0 a 255, corresponde à intensidade da componente azul de acordo com o modelo de cores RGB;&lt;br /&gt;
;Ângulo:&lt;br /&gt;
: De -20º a 100º, é o ângulo entre os painéis LED e fotovoltaico, como mostrado na figura 2;&lt;br /&gt;
;Resistência de carga:&lt;br /&gt;
: De 1 a 100, esta quantidade é proporcional à resistência de carga conectada ao painel fotovoltaico;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mais ainda, a experiência pode ser executada em três modos distintos:&lt;br /&gt;
;Varrimento de ângulo:&lt;br /&gt;
: o painel fotovoltaico é rodado de -20º a 100º em etapas de 1º, mantendo constantes a cor selecionada e a resistência de carga;&lt;br /&gt;
;Varrimento da resistência de carga:&lt;br /&gt;
: o valor da resistência de carga varia de 1 a 100% com as etapas de 1, mantendo constantes a cor e o ângulo selecionados;&lt;br /&gt;
;Encontrar a resistência de carga correspondente à máxima potência:&lt;br /&gt;
: para uma determinada cor e ângulo selecionados, o valor da resistência de carga que maximiza a potência extraída do painel é encontrado automaticamente através de um processo iterativo similar ao utilizado nos ''Maximum Power Point Tracking'' (MPPT);&lt;br /&gt;
&lt;br /&gt;
== Resultados ==&lt;br /&gt;
Após o início da experiência, é retornada uma tabela dinâmica com a data/hora de cada medição, o ângulo entre os painéis, o valor da resistência de carga e os elementos medidos em cada ponto: a tensão e a corrente na resistência de carga permitindo determinar indiretamente a potência total consumida nessa resistência (carga).&lt;br /&gt;
&lt;br /&gt;
Deve ser dada particular atenção à propagação de erros na potência pois quer a corrente quer a tensão variam.&lt;br /&gt;
&lt;br /&gt;
A aplicação permite ainda visualizar em tempo real os dados que vão sendo recolhidos.&lt;br /&gt;
&lt;br /&gt;
= Física =&lt;br /&gt;
== Semicondutores ==&lt;br /&gt;
Os paineis fotovoltaicos baseam-se em junções p-n de silício. O silício puro é um semicondutor intrínseco com uma condutividade elétrica de cerca de 2500 \(\Omega \cdot m\), indicando que este material não é um condutor nem um isolante. Um semicondutor puro pode ser dopado através da adição de iões de impurezas específicas, criando semicondutores extrínsecos. Considerando que o silício possui 4 electrões de valência, os iões dopantes de impurezas de menor valência tornam-se aceitadores de elctrões e as impurezas de maior valência tornam-se dadores de electrões. Para o primeiro caso, se não houver electrões livres, produzem-se estados de carga positiva, conhecidos como buracos, que se movem através do material e actuam como portadores maioritários. No caso dos dadores de electrões, existe um excesso de electrões livres que actuam como portadores maioritários. Para o silício dopado, os valores típicos de condutividade elétrica encontram-se em torno de 10 \(\Omega \cdot cm\).&lt;br /&gt;
&lt;br /&gt;
== Junções P-N ==&lt;br /&gt;
Quando um material do tipo p entra em contacto com um material do tipo n, forma-se uma região de mudança de dopante - a junção p-n. Quando essa junção é criada, o excesso de electrões do material do tipo n (dador) move-se para o material do tipo p (aceitador) e os buracos em excesso do material do tipo p movem-se para o material do tipo n. Esta movimentação de cargas ocorre até que um estado estacionário seja alcançado. Neste estado, o campo elétrico causado pela acumulação de cargas de sinais opostos em cada um dos lados da junção equilibra a difusão decorrente das diferentes concentrações de electrões livres e buracos. Em torno da interface entre os materiais do tipo p e n é criada uma zona sem portadores maioritários - a região de deplecção.&lt;br /&gt;
&lt;br /&gt;
Em tal junção, pares de livres e buracos podem ser espontaneamente gerados a partir de estados ligados, principalmente devido a excitação térmica. Quando tais portadores são gerados ou são capazes de se difundir para a região de deplecção, são puxadas electrostaticamente de acordo com os seus respectivos gradientes de potencial, criando uma corrente de geração constante, \(I_g\). Para manter o equilíbrio geral de corrente na região de deplecção, existe uma corrente de recombinação inversa \(I_r\), que resulta da recombinação de electrões e buracos provenientes dos diferentes lados da junção. Cada evento de recombinação electeão-buraco corresponde ao transporte de uma carga elementar através da junção.&lt;br /&gt;
Se a junção p-n não estiver iluminada e não tiver polarização externa, a corrente total é nula porque \(I_r = I_g\). No entanto, se uma polarização externa positiva for aplicada à junção \(V_b\), a corrente de recombinação é \(I_r = I_g \cdot e ^ {eV_b / k_B T} \), o que resulta numa corrente total no escuro, \(I_D\):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I_D = I_r - I_g = I_g \cdot (e ^ {eV_b / k_B T} -1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Essa expressão é muito semelhante à característica de um diodo. A única diferença é que, num diodo, \(I_g\) é substituído por \(I_0 \), a corrente de saturação.&lt;br /&gt;
&lt;br /&gt;
== Absorção de fotões na junção P-N ==&lt;br /&gt;
Quando uma junção p-n é exposta a radiação eletromagnética, um processo de formação de pares electrão-buraco é responsável pela maior parte da sua absorção. Como anteriormente visto, a formação destes pares resulta na criação de dois portadores de carga. Quando a criação de tais portadores ocorre perto de uma junção p – n, o campo interno na região de deplecção impede a sua recombinação e produz uma corrente, \(I_L \), num circuito conectado externamente. Esta corrente é muito maior do que a corrente resultante da geração térmica de pares electrão-buraco já presente, fazendo com que a junção p-n se comporte como uma fonte de corrente. A corrente total produzida é dada por:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; I = I_D - I_L = I_g \cdot (e^{eV_b/k_B T}-1) - I_L &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Figura 3 mostra os diferentes tipos de corrente existentes numa junção p-n iluminada.&lt;br /&gt;
&lt;br /&gt;
[[File:Photon_absor.PNG||thumb|Fig. 3 - Diferentes correntes existentes numa junção p-n iluminada. |center|350px]]&lt;br /&gt;
&lt;br /&gt;
= Estudos experimentais =&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Bibliografia =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
*[[ Photovoltaic panel | Versão em Inglês (English Version)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_fotovoltaico&amp;diff=3754</id>
		<title>Painel fotovoltaico</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Painel_fotovoltaico&amp;diff=3754"/>
		<updated>2020-08-22T14:08:18Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: Ist176128 moved page Painel fotovoltaico to Painel Fotovoltaico&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Painel Fotovoltaico]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Reposit%C3%B3rio_de_Conte%C3%BAdos&amp;diff=3750</id>
		<title>Repositório de Conteúdos</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Reposit%C3%B3rio_de_Conte%C3%BAdos&amp;diff=3750"/>
		<updated>2020-08-22T14:05:42Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bem-vindo à wiki do e-lab. Aqui serão reunidos artigos com a documentação e textos de apoio às experiências dos laboratórios remotos do IST.&lt;br /&gt;
&lt;br /&gt;
=Introdução=&lt;br /&gt;
O e-lab é um espaço onde podem ser realizadas experiências reais através da Internet.&lt;br /&gt;
&lt;br /&gt;
As experiências estão montadas e instaladas fisicamente num laboratório do [http://www.ist.utl.pt/ Instituto Superior Técnico] ou em escolas e centros de ciência parceiras. A experiencia é controlada pelo seu administrador, que não é mais do que o primeiro membro da lista de espera dos utilizadores interessados em realizá-la. Existe, também, uma lista que permite, por exemplo, que um professor realize a experiência e os seus alunos recebam em simultâneo a imagem e os dados, apesar de poderem estar em locais fisicamente distantes.&lt;br /&gt;
&lt;br /&gt;
Os dados das experiências e a imagem dos acontecimentos (vídeos) são captados por meio de sensores conectados, directa ou indirectamente, a um computador central, de onde são difundidos através da Internet.&lt;br /&gt;
&lt;br /&gt;
Cada '''sala de controlo''', que corresponde a uma determinada experiência, dispõe dum espaço próprio, onde se sugere um protocolo experimental, sugestões de variantes à experiência, bem como as explicações e análises dos dados. Cada sala de controlo dispõe, também, de um chat onde todos podem tecer comentários e trocar informação sobre a experiência e sobre a análise dos dados.&lt;br /&gt;
&lt;br /&gt;
Sala de controlo, aparato experimental, protocolo e montagem experimental são conceitos fundamentais no e-lab:&lt;br /&gt;
&lt;br /&gt;
* '''Sala de controlo:''' ambiente virtual para controlo dum aparato experimental real incluído num determinado laboratório.&lt;br /&gt;
* '''Aparato experimental:''' equipamento que permite realizar determinada experiência.&lt;br /&gt;
* '''Montagem experimental:''' configuração do aparato experimental de acordo com o protocolo a executar.&lt;br /&gt;
* '''Protocolo:''' sequência da execução da experiência com a respectiva selecção e configuração da montagem experimental.&lt;br /&gt;
&lt;br /&gt;
Os utilizadores do portal e-escola podem enviar sugestões ou relatórios das suas experiências para [mailto:wwwelab@ist.utl.pt este endereço].&lt;br /&gt;
&lt;br /&gt;
O IST providencia ainda [[Cursos de Formação]] a docentes do ensino secundário.&lt;br /&gt;
&lt;br /&gt;
Há também uma página de apoio a [[Estudantes Brasileiros]].&lt;br /&gt;
&lt;br /&gt;
O projecto [[Pêndulo Mundial]] é um bom exemplo dos nossos planos para o futuro.&lt;br /&gt;
&lt;br /&gt;
=Experiências=&lt;br /&gt;
&lt;br /&gt;
Antes de tentar iniciar o elab, certifique-se de ter instalado o JAVA e o VLC e todas as permissões de segurança definidas como explicado nas [[Add_e-lab_to_Java's_Security_Exception_Site_List | PERGUNTAS FREQUENTES]]&lt;br /&gt;
&lt;br /&gt;
{{Launch}}&lt;br /&gt;
==Laboratório Básico==&lt;br /&gt;
*[[Queda de Graves (determinação de g)]]&lt;br /&gt;
*[[Conservação do Momento Linear]]&lt;br /&gt;
*[[Variação da Pressão num Líquido com a Profundidade]]&lt;br /&gt;
*[[Estatística de Dados]]&lt;br /&gt;
*[[Lei de Boyle-Mariotte]]&lt;br /&gt;
*[[Lei de Hooke]]&lt;br /&gt;
*[[Determinação da Velocidade do Som]]&lt;br /&gt;
*[[Pêndulo de Haste Rígida]] (em construção)&lt;br /&gt;
*[[Determinação do consumo de água em plantas]](em construção)&lt;br /&gt;
*[[Painel_fotovoltaico | Painel fotovoltaico]]&lt;br /&gt;
*[[Plano Inclinado| Plano Inclinado]]&lt;br /&gt;
*[[Pêndulo Mundial]]&lt;br /&gt;
&lt;br /&gt;
==Laboratório Intermédio==&lt;br /&gt;
*[[Determinação da Condutividade Térmica em Metais]]  &lt;br /&gt;
*[[Atenuação da Radiação em Diferentes Materiais]]       &amp;lt;!-- determinação da semi espessura do cobre --&amp;gt;&lt;br /&gt;
*[[Estação Metreológica]]&lt;br /&gt;
*[[Oscilações de um Pêndulo Amortecido | Pendulo Amortecido]]&lt;br /&gt;
*[[Conservação do Momento Angular]]&lt;br /&gt;
*[[Optica de uma Câmara Estenopeica (Pinhole)]]&lt;br /&gt;
*[[Estudos de Óptica num Prisma Semi-cilíndrico]]&lt;br /&gt;
*[[Campo de indução magnético criado por 2 condutores]]&lt;br /&gt;
*[[Polarização da Luz]]&lt;br /&gt;
*[[Determinação da Constante de Planck]]&lt;br /&gt;
&lt;br /&gt;
==Laboratório Avançado==&lt;br /&gt;
*[[Estudo de Estacionárias]]&lt;br /&gt;
*[[Determinação da Constante Adiabática do Ar]]&lt;br /&gt;
*[[Propagação de Solitões num Meio Viscoso]]&lt;br /&gt;
*[[Determinação da Constante Dieléctrica num Condensador Cilíndrico]]&lt;br /&gt;
*[[Sonda de Langmuir]]&lt;br /&gt;
*[[Curva de Paschen]]&lt;br /&gt;
&lt;br /&gt;
=Mais Informações=&lt;br /&gt;
&amp;lt;!--[[Personalidades]] (em construção): NAO FAZ SENTIDO --&amp;gt;&lt;br /&gt;
*[[Publications | Publicações]]&lt;br /&gt;
&lt;br /&gt;
*[[Hall of fame | Colaboradores do e-lab]]&lt;br /&gt;
&lt;br /&gt;
*[[Como instalar o Java]]&lt;br /&gt;
&lt;br /&gt;
*[[Executar o e-lab a partir da command prompt]]&lt;br /&gt;
&lt;br /&gt;
*[[Adicionar o e-lab às excepções de segurança do Java]]&lt;br /&gt;
&lt;br /&gt;
*[[Training | Programas de formação]]&lt;br /&gt;
&lt;br /&gt;
=Ferramentas=&lt;br /&gt;
*[[FAQ.pt]]&lt;br /&gt;
*[[Fitteia]]&lt;br /&gt;
*[[Editor Online de Latex]]&lt;br /&gt;
*[[Main Page|Lista de experiências]]&lt;br /&gt;
*[[My solutions]]&lt;br /&gt;
&lt;br /&gt;
=Licensa=&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by-sa/4.0/&amp;quot;&amp;gt;&amp;lt;img alt=&amp;quot;Licença Creative Commons&amp;quot; style=&amp;quot;border-width:0&amp;quot; src=&amp;quot;http://i.creativecommons.org/l/by-sa/4.0/88x31.png&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;Esta obra e todos os conteúdos sob o portal do e-lab estão licenciados sob uma Licença &amp;lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by-sa/4.0/&amp;quot;&amp;gt;Creative Commons - Atribuição-Partilha nos termos da mesma licença 4.0 Internacional&amp;lt;/a&amp;gt;.&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3746</id>
		<title>Plano Inclinado</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_Inclinado&amp;diff=3746"/>
		<updated>2020-08-22T14:05:13Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: Ist176128 moved page Plano inclinado to Plano Inclinado&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Plano inclinado=&lt;br /&gt;
&lt;br /&gt;
==Descrição da experiência ==&lt;br /&gt;
&lt;br /&gt;
O plano inclinado é uma das seis máquinas simples clássicas. Os planos inclinados são geralmente utilizados para mover cargas pesadas sobre obstáculos verticais tais como rampas para mover carga.&lt;br /&gt;
&lt;br /&gt;
Mover um objeto para cima em um plano inclinado requer menos força do que levantá-lo na vertical, como se desmultiplicassemos a gravidade! Esta vantagem mecânica pelo qual a força é reduzida é igual à razão entre o comprimento da superfície inclinada e a altura em que se estende a rampa.&lt;br /&gt;
&lt;br /&gt;
Nas experiências laboratoriais que recriam esta máquina, na situação em que não é usada uma calha de ar de modo a quase eliminar o atrito de rolamento, tem de ser usado um ângulo significativo de forma à aceleração gravítica ser muito superior ao atrito, eliminando a vantagem da experiência poder ser realizada num tempo grande, percetível aos sentidos humanos.&lt;br /&gt;
&lt;br /&gt;
Contudo o atrito faz parte integrante da mecânica do problema e esta experiência permite determinar a função de atrito através duma análise multi-variada ajustando uma função que dependa da inclinação da calha. A experiência para o efeito, permite alterar o ângulo de descida e, através deste, separar as forças de atrito da gravítica, obtendo-se um valor muito próximo de 9,8 ms&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:420px&amp;quot;&amp;gt;&lt;br /&gt;
'''Ligações'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Video: rtsp://elabmc.ist.utl.pt/plinc.sdp&lt;br /&gt;
*Laboratory: [http://elab.tecnico.ulisboa.pt Básico]&lt;br /&gt;
*Control room: Plano inclinado&lt;br /&gt;
*Level: *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Propositadamente nesta experiência é usado um carro equipado com um pára-vento frontal de modo a exarcebar o efeito do atrito e demonstrar que a sua equação pode ser determinada pela anáside multivariada de vários percursos para ângulos váriados.&lt;br /&gt;
&lt;br /&gt;
==Aparato experimental==&lt;br /&gt;
&lt;br /&gt;
[[File:Pincl_Schematic.png||thumb|Esquema da montagem do plano inclinado, cujo fulcro do balanço é a origem do ângulo.|right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Promenor_Sonar.jpeg||thumb|Vista geral da experiencia com o sonar numa das extremidades, após a mola coletora do embate. |right|border|288px]]&lt;br /&gt;
&lt;br /&gt;
O plano inclinado desta experiência recria essa &amp;quot;desmultiplicação da gravidade&amp;quot;. Consiste num veículo que se desloca numa calha com um ângulo regulavel e que bascula no seu ponto médio. A altura da calha é medida a 1003 mm do eixo da experiência.&lt;br /&gt;
&lt;br /&gt;
Inicialmente a calha bascula para uma posição com um ângulo negativo de modo a recolher e a parquear o carro na origem, a cerca de 1,3m da mola que irá absorver a energia do seu movimento. Este é imobilizado através dum eletroímã e posteriormente a calha é elevada até à altura pré-seleccionada. Quando atinge esse ponto, o electroímane liberta o carrinho e este desloca-se livremente sobre a calha até embater na mola.&lt;br /&gt;
Um detector ultra-sónico colhe então amostras da posição em função do tempo decorrido, permitindo traçar a trajectória do veículo durante a queda e no seu amortecimento final.&lt;br /&gt;
&lt;br /&gt;
==Protocolo==&lt;br /&gt;
Com base nos dados pré-seleccionados na experiência obtenha um gráfico da posição em função do tempo decorrido. Com base nestes dados determine ainda os gráficos da velocidade e da aceleração. Compare o valor obtido da aceleração com a gravidade.&lt;br /&gt;
&lt;br /&gt;
===Determinação da velocidade em função da distância percorrida===&lt;br /&gt;
Com base nos dados anteriores determine a velocidade em função da distância percorrida, eliminando o tempo nos gráficos anteriores, ou seja, traçando a curva desenhada pelos pares velocidade, distância para cada tempo disponível.&lt;br /&gt;
&lt;br /&gt;
===Determinação da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Em função das várias parábolas obtidas no amortecimento do veículo, determine a perda relativa de energia em cada embate com a mola e determine a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Protocolo avançado==&lt;br /&gt;
Como pode ser inferido rapidamente, o ajuste do modelo parabólico ao movimento produz um desvio só possivel de entender com a inclusão dum termo de fricção. Com efeito o carrinho dispõe duma pala frontal destinada a induzir um certo atrito aerodinâmico. Adaptando as equações de modo a incluir um termo de atrito de rolamento (linear com a velocidade) e aerodinâmico (Cx, dependencia quadrática com a velocidade), pode-se determinar finalmente um valor mais preciso para a aceleração do veículo.&lt;br /&gt;
Normalmente o ''Cx'' só influência significativamente o movimento a partir dos 25 km/h. &lt;br /&gt;
&lt;br /&gt;
O ajuste duma função de atrito para a aceleração na forma ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' permite extrair a aceleração local da gravidade ao serem utilizadas várias séries de dados para ângulos variados.&lt;br /&gt;
&lt;br /&gt;
===Modelo multivariado===&lt;br /&gt;
A análise multivariada utilizada serve para construir um modelo de ajuste numérido para vários ângulos às várias características do movimento obtido. A variação do ângulo permite com efeito distinguir o efeito da gravidade da força de atrito de rolamento já que este é considerado independente do ângulo. Dete modo, ao fazer um ajuste do tipo ''a = b + c*v + d*v&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'' o parâmetro ''b'' que detém implicitamente a gravidade e o atrito de rolamento (relacionado com a mecânica do veículo) pode ser resolvido separando-o em ''b=g*sin(θ) + b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;''. Os restantes parâmetros resultam dum modelo da dependência do atrito com a velocidade que para valores elevados desta (tipicamente superior a 7-10 ms&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;) tem uma forte dependência quadrática na velocidade – atrito aerodinâmico – mas que no nosso caso também temos de considerar a dependência de atrito mecânico (''b&amp;lt;sub&amp;gt;atrito&amp;lt;/sub&amp;gt;+c*v'') uma vez que o carro parte do repouso.&lt;br /&gt;
&lt;br /&gt;
Ao realizar esta análise multivariada estamos a considerar uma associação independente entre os parâmetros, condição necessária para esses parâmetros fazerem parte de um modelo numérico que se provará correto pelo desfecho do ajuste. Para o efeito deverá ser utilizado um ''solver'' numérico ajustando iterativamente as várias co-variáveis, tal como o do MSExcel.&lt;br /&gt;
&lt;br /&gt;
===Determinação rigorosa da constante de restituição da mola===&lt;br /&gt;
&lt;br /&gt;
Uma análise breve permite concluir que a constante de restituição da mola para os vários embates vem ferida dum erro apreciável, tanto maior quanto o percurso percorrido, uma vez que o trabalho realizado pela força de atrito prejudica o cálculo da energia mecânica em cada troço do movimento. No entanto, calculando o trabalho efetuado pela força de atrito com base na equação da força de atrito determinada pelo processo anteriormente descrito, permite inferir corretamente a energia mecânica antes e depois de cada embate, permitindo calcular corretamente a constante de restituição da mola.&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Inclined plane | This page in English]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_inclinado&amp;diff=3748</id>
		<title>Plano inclinado</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Plano_inclinado&amp;diff=3748"/>
		<updated>2020-08-22T14:05:13Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: Ist176128 moved page Plano inclinado to Plano Inclinado&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Plano Inclinado]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Technical_pages&amp;diff=3636</id>
		<title>Technical pages</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Technical_pages&amp;diff=3636"/>
		<updated>2020-05-13T19:28:27Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* elab1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Services inside elab cluster ==&lt;br /&gt;
=== elabmc ===&lt;br /&gt;
 provides relay of video streams&lt;br /&gt;
 elabmc.ist.utl.pt 193.136.197.67&lt;br /&gt;
 elabmc 192.168.0.2&lt;br /&gt;
&lt;br /&gt;
=== elab ===&lt;br /&gt;
 main server for experiments&lt;br /&gt;
 elab.ist.utl.pt 193.136.197.66 (sshd 22xx)&lt;br /&gt;
 elab 192.168.0.192&lt;br /&gt;
&lt;br /&gt;
=== elab1 ===&lt;br /&gt;
 secondary server for testing and ssh access&lt;br /&gt;
 elab1.ist.utl.pt 193.136.197.191 (sshd 22xx)&lt;br /&gt;
 elab1 192.168.0.1&lt;br /&gt;
&lt;br /&gt;
=== elab150 ===&lt;br /&gt;
 192.168.0.150&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
 dhcpd for all other nodes&lt;br /&gt;
 tftpd for elab151 to elab153&lt;br /&gt;
 nfsd for elab151 to elab153&lt;br /&gt;
&lt;br /&gt;
=== elab151 - elab153 ===&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
&lt;br /&gt;
=== elab100 ===&lt;br /&gt;
 192.168.0.100&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
 tftpd for elab101 to elab106&lt;br /&gt;
 nfsd for elab101 to elab106&lt;br /&gt;
&lt;br /&gt;
== List of experiments ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Experiment name&lt;br /&gt;
! Video&lt;br /&gt;
! Experiment host &amp;amp; serial port&lt;br /&gt;
|-&lt;br /&gt;
| gamma&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/gamma.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/gamma.html watch]&lt;br /&gt;
5008&lt;br /&gt;
| elab150&lt;br /&gt;
/dev/ttyS3 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| radiare&lt;br /&gt;
| elab100&lt;br /&gt;
[http://elabmc.ist.utl.pt/radiare.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/radiare.html watch]&lt;br /&gt;
5006&lt;br /&gt;
| elab100&lt;br /&gt;
/dev/ttyS0 - 4800&lt;br /&gt;
|-&lt;br /&gt;
| optica&lt;br /&gt;
| elab100&lt;br /&gt;
[http://elabmc.ist.utl.pt/optica.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/optica.html watch]&lt;br /&gt;
5034&lt;br /&gt;
| elab100&lt;br /&gt;
/dev/ttyS1 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| polaroid&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/polaroid.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/polaroid.html watch]&lt;br /&gt;
5010&lt;br /&gt;
| elab101&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| scuba&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/scuba.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/scuba.html watch]&lt;br /&gt;
5042&lt;br /&gt;
| elab101&lt;br /&gt;
/dev/ttyS1 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| pendulo gravitico&lt;br /&gt;
| elab102&lt;br /&gt;
[http://elabmc.ist.utl.pt/pendulogravitico.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/pendulogravitico.html watch]&lt;br /&gt;
5016&lt;br /&gt;
| elab102&lt;br /&gt;
/dev/ttyS0 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| pv&lt;br /&gt;
| elab102&lt;br /&gt;
[http://elabmc.ist.utl.pt/pv.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/pv.html watch]&lt;br /&gt;
5040&lt;br /&gt;
| elab102&lt;br /&gt;
/dev/ttyS1 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| langmuir&lt;br /&gt;
| elab103&lt;br /&gt;
[http://elabmc.ist.utl.pt/langmuir.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/langmuir.html watch]&lt;br /&gt;
5024&lt;br /&gt;
| elab103&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| condensador cilindrico&lt;br /&gt;
| elab103&lt;br /&gt;
[http://elabmc.ist.utl.pt/langmuir.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/condensador.html watch]&lt;br /&gt;
5032&lt;br /&gt;
| elab103&lt;br /&gt;
/dev/ttyS1 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| g&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/g.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/g.html watch]&lt;br /&gt;
5026&lt;br /&gt;
| elab152&lt;br /&gt;
/dev/ttyS0 - 38400&lt;br /&gt;
|-&lt;br /&gt;
| conducaocalor&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/conducaocalor.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/conducaocalor.html watch]&lt;br /&gt;
5030&lt;br /&gt;
| elab151&lt;br /&gt;
/dev/ttyS3 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| pendulo amortecido&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/penduloamortecido.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/penduloamortecido.html watch]&lt;br /&gt;
5048&lt;br /&gt;
| elab104&lt;br /&gt;
/dev/ttyS0 - 38400, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| planck&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/planck.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/planck.html watch]&lt;br /&gt;
5004&lt;br /&gt;
| elab105&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| inertiadisks&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/inertiadisks.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/inertiadisks.html watch]&lt;br /&gt;
5014&lt;br /&gt;
| elab105&lt;br /&gt;
/dev/ttyS1 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| statsound&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/statsound.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/statsound.html watch]&lt;br /&gt;
5036&lt;br /&gt;
| elab151&lt;br /&gt;
/dev/ttyS2 - 38400&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| aleatorio&lt;br /&gt;
| elab106&lt;br /&gt;
[http://elabmc.ist.utl.pt/aleatorio.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/aleatorio.html watch]&lt;br /&gt;
5038&lt;br /&gt;
| elab152&lt;br /&gt;
aleatorio (java, nao tem pic)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_planetarium&lt;br /&gt;
| planetarium (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_planetarium.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_planetarium.html watch]&lt;br /&gt;
5018&lt;br /&gt;
| planetarium (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_ccvalg&lt;br /&gt;
| ccvalg (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_ccvalg.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_ccvalg.html watch]&lt;br /&gt;
5020&lt;br /&gt;
| ccvalg (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| paschen&lt;br /&gt;
| eindhoven (jloureiro)&lt;br /&gt;
[http://elabmc.ist.utl.pt/paschen.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/paschen.html watch]&lt;br /&gt;
5028&lt;br /&gt;
| eindhoven (jloureiro)&lt;br /&gt;
TUeDAC PicoGiant&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_ilheus&lt;br /&gt;
| ilheus (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_ilheus.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_ilheus.html watch]&lt;br /&gt;
5022&lt;br /&gt;
| ilheus (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| boyle_mariotte&lt;br /&gt;
| espav (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/boyle_mariotte.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/boyle_mariotte.html watch]&lt;br /&gt;
5050&lt;br /&gt;
| espav (vpn)&lt;br /&gt;
(?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colisao&lt;br /&gt;
| ecb (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/colisao.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/colisao.html watch]&lt;br /&gt;
5044&lt;br /&gt;
| ecb (vpn)&lt;br /&gt;
(?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_puc&lt;br /&gt;
| puc (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_puc.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_puc.html watch]&lt;br /&gt;
5046&lt;br /&gt;
| puc (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| wp_epm&lt;br /&gt;
| epm (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/wp_epm.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/wp_epm.html watch]&lt;br /&gt;
5052&lt;br /&gt;
| epm (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| hidrostat&lt;br /&gt;
| sines (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/scubasines.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/scubasines.html watch]&lt;br /&gt;
5054&lt;br /&gt;
| sines (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| mola&lt;br /&gt;
| mola (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/mola.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/mola.html watch]&lt;br /&gt;
5058&lt;br /&gt;
| mola (vpn)&lt;br /&gt;
/dev/ttyAMA0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_saotome&lt;br /&gt;
| wp_saotome (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/wp_saotome.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/wp_saotome.html watch]&lt;br /&gt;
5060&lt;br /&gt;
| wp_saotome (vpn)&lt;br /&gt;
/dev/ttyAMA0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| mag3d &lt;br /&gt;
| mag3d (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/mag3d.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/mag3d.html watch]&lt;br /&gt;
5062&lt;br /&gt;
| mag3d (vpn)&lt;br /&gt;
/dev/ttyUSB0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Technical_pages&amp;diff=3634</id>
		<title>Technical pages</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Technical_pages&amp;diff=3634"/>
		<updated>2020-05-13T19:28:19Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* elab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Services inside elab cluster ==&lt;br /&gt;
=== elabmc ===&lt;br /&gt;
 provides relay of video streams&lt;br /&gt;
 elabmc.ist.utl.pt 193.136.197.67&lt;br /&gt;
 elabmc 192.168.0.2&lt;br /&gt;
&lt;br /&gt;
=== elab ===&lt;br /&gt;
 main server for experiments&lt;br /&gt;
 elab.ist.utl.pt 193.136.197.66 (sshd 22xx)&lt;br /&gt;
 elab 192.168.0.192&lt;br /&gt;
&lt;br /&gt;
=== elab1 ===&lt;br /&gt;
 secondary server for testing and ssh access&lt;br /&gt;
 elab1.ist.utl.pt 193.136.197.191 (sshd 2222)&lt;br /&gt;
 elab1 192.168.0.1&lt;br /&gt;
&lt;br /&gt;
=== elab150 ===&lt;br /&gt;
 192.168.0.150&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
 dhcpd for all other nodes&lt;br /&gt;
 tftpd for elab151 to elab153&lt;br /&gt;
 nfsd for elab151 to elab153&lt;br /&gt;
&lt;br /&gt;
=== elab151 - elab153 ===&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
&lt;br /&gt;
=== elab100 ===&lt;br /&gt;
 192.168.0.100&lt;br /&gt;
 hardware servers for experiments&lt;br /&gt;
 tftpd for elab101 to elab106&lt;br /&gt;
 nfsd for elab101 to elab106&lt;br /&gt;
&lt;br /&gt;
== List of experiments ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Experiment name&lt;br /&gt;
! Video&lt;br /&gt;
! Experiment host &amp;amp; serial port&lt;br /&gt;
|-&lt;br /&gt;
| gamma&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/gamma.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/gamma.html watch]&lt;br /&gt;
5008&lt;br /&gt;
| elab150&lt;br /&gt;
/dev/ttyS3 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| radiare&lt;br /&gt;
| elab100&lt;br /&gt;
[http://elabmc.ist.utl.pt/radiare.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/radiare.html watch]&lt;br /&gt;
5006&lt;br /&gt;
| elab100&lt;br /&gt;
/dev/ttyS0 - 4800&lt;br /&gt;
|-&lt;br /&gt;
| optica&lt;br /&gt;
| elab100&lt;br /&gt;
[http://elabmc.ist.utl.pt/optica.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/optica.html watch]&lt;br /&gt;
5034&lt;br /&gt;
| elab100&lt;br /&gt;
/dev/ttyS1 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| polaroid&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/polaroid.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/polaroid.html watch]&lt;br /&gt;
5010&lt;br /&gt;
| elab101&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| scuba&lt;br /&gt;
| elab101&lt;br /&gt;
[http://elabmc.ist.utl.pt/scuba.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/scuba.html watch]&lt;br /&gt;
5042&lt;br /&gt;
| elab101&lt;br /&gt;
/dev/ttyS1 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| pendulo gravitico&lt;br /&gt;
| elab102&lt;br /&gt;
[http://elabmc.ist.utl.pt/pendulogravitico.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/pendulogravitico.html watch]&lt;br /&gt;
5016&lt;br /&gt;
| elab102&lt;br /&gt;
/dev/ttyS0 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| pv&lt;br /&gt;
| elab102&lt;br /&gt;
[http://elabmc.ist.utl.pt/pv.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/pv.html watch]&lt;br /&gt;
5040&lt;br /&gt;
| elab102&lt;br /&gt;
/dev/ttyS1 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| langmuir&lt;br /&gt;
| elab103&lt;br /&gt;
[http://elabmc.ist.utl.pt/langmuir.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/langmuir.html watch]&lt;br /&gt;
5024&lt;br /&gt;
| elab103&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| condensador cilindrico&lt;br /&gt;
| elab103&lt;br /&gt;
[http://elabmc.ist.utl.pt/langmuir.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/condensador.html watch]&lt;br /&gt;
5032&lt;br /&gt;
| elab103&lt;br /&gt;
/dev/ttyS1 - 115200, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| g&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/g.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/g.html watch]&lt;br /&gt;
5026&lt;br /&gt;
| elab152&lt;br /&gt;
/dev/ttyS0 - 38400&lt;br /&gt;
|-&lt;br /&gt;
| conducaocalor&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/conducaocalor.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/conducaocalor.html watch]&lt;br /&gt;
5030&lt;br /&gt;
| elab151&lt;br /&gt;
/dev/ttyS3 - 9600&lt;br /&gt;
|-&lt;br /&gt;
| pendulo amortecido&lt;br /&gt;
| elab104&lt;br /&gt;
[http://elabmc.ist.utl.pt/penduloamortecido.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/penduloamortecido.html watch]&lt;br /&gt;
5048&lt;br /&gt;
| elab104&lt;br /&gt;
/dev/ttyS0 - 38400, 1 stop&lt;br /&gt;
|-&lt;br /&gt;
| planck&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/planck.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/planck.html watch]&lt;br /&gt;
5004&lt;br /&gt;
| elab105&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| inertiadisks&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/inertiadisks.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/inertiadisks.html watch]&lt;br /&gt;
5014&lt;br /&gt;
| elab105&lt;br /&gt;
/dev/ttyS1 - 115200&lt;br /&gt;
|-&lt;br /&gt;
| statsound&lt;br /&gt;
| elab105&lt;br /&gt;
[http://elabmc.ist.utl.pt/statsound.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/statsound.html watch]&lt;br /&gt;
5036&lt;br /&gt;
| elab151&lt;br /&gt;
/dev/ttyS2 - 38400&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| aleatorio&lt;br /&gt;
| elab106&lt;br /&gt;
[http://elabmc.ist.utl.pt/aleatorio.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/aleatorio.html watch]&lt;br /&gt;
5038&lt;br /&gt;
| elab152&lt;br /&gt;
aleatorio (java, nao tem pic)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_planetarium&lt;br /&gt;
| planetarium (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_planetarium.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_planetarium.html watch]&lt;br /&gt;
5018&lt;br /&gt;
| planetarium (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_ccvalg&lt;br /&gt;
| ccvalg (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_ccvalg.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_ccvalg.html watch]&lt;br /&gt;
5020&lt;br /&gt;
| ccvalg (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| paschen&lt;br /&gt;
| eindhoven (jloureiro)&lt;br /&gt;
[http://elabmc.ist.utl.pt/paschen.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/paschen.html watch]&lt;br /&gt;
5028&lt;br /&gt;
| eindhoven (jloureiro)&lt;br /&gt;
TUeDAC PicoGiant&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_ilheus&lt;br /&gt;
| ilheus (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_ilheus.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_ilheus.html watch]&lt;br /&gt;
5022&lt;br /&gt;
| ilheus (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| boyle_mariotte&lt;br /&gt;
| espav (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/boyle_mariotte.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/boyle_mariotte.html watch]&lt;br /&gt;
5050&lt;br /&gt;
| espav (vpn)&lt;br /&gt;
(?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colisao&lt;br /&gt;
| ecb (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/colisao.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/colisao.html watch]&lt;br /&gt;
5044&lt;br /&gt;
| ecb (vpn)&lt;br /&gt;
(?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_puc&lt;br /&gt;
| puc (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/worldpendulum_puc.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/worldpendulum_puc.html watch]&lt;br /&gt;
5046&lt;br /&gt;
| puc (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| wp_epm&lt;br /&gt;
| epm (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/wp_epm.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/wp_epm.html watch]&lt;br /&gt;
5052&lt;br /&gt;
| epm (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| hidrostat&lt;br /&gt;
| sines (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/scubasines.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/scubasines.html watch]&lt;br /&gt;
5054&lt;br /&gt;
| sines (vpn)&lt;br /&gt;
/dev/ttyS0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| mola&lt;br /&gt;
| mola (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/mola.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/mola.html watch]&lt;br /&gt;
5058&lt;br /&gt;
| mola (vpn)&lt;br /&gt;
/dev/ttyAMA0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| worldpendulum_saotome&lt;br /&gt;
| wp_saotome (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/wp_saotome.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/wp_saotome.html watch]&lt;br /&gt;
5060&lt;br /&gt;
| wp_saotome (vpn)&lt;br /&gt;
/dev/ttyAMA0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| mag3d &lt;br /&gt;
| mag3d (vpn)&lt;br /&gt;
[http://elabmc.ist.utl.pt/mag3d.sdp sdp]&lt;br /&gt;
[http://elab1.ist.utl.pt/mag3d.html watch]&lt;br /&gt;
5062&lt;br /&gt;
| mag3d (vpn)&lt;br /&gt;
/dev/ttyUSB0 - 115200&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
[ sdp]&lt;br /&gt;
[ watch]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3632</id>
		<title>DsPic-Raspberry programmer interface</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3632"/>
		<updated>2020-05-13T19:22:33Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* dsPic-Raspberry programmer interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=dsPic-Raspberry programmer interface=&lt;br /&gt;
&lt;br /&gt;
A general purpose interface consisting in two opto-couplers have been developed to program the dsPic micro-controllers directly from the Raspberry, allowing remote maintenance and reprogramming of each de-localized unit.&lt;br /&gt;
&lt;br /&gt;
It as to be powered by 12 V (minimum voltage 10.5V - maximum voltage 13.5V) dsPic node unregulated Vcc and feed by the Raspberry GP_I/O, with a common digital ground.&lt;br /&gt;
&lt;br /&gt;
== Pin-out and connections==&lt;br /&gt;
[[File:ProgrammerOptoCouplerTopView.jpg||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
[[File:SchematicPicProgrammer.png||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
The following table describes the pin-out assembly of the opt-programmer developed to be used with picpgm software. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;6&amp;quot;|Programmer pin-out&lt;br /&gt;
|-&lt;br /&gt;
  | '''Rasp I/O&lt;br /&gt;
  | '''Label&lt;br /&gt;
  | '''Programmer I/O&lt;br /&gt;
  | '''Picpgm function (invert)&lt;br /&gt;
  | '''Cable&lt;br /&gt;
|-&lt;br /&gt;
  | 39&lt;br /&gt;
  | GND&lt;br /&gt;
  | GND&lt;br /&gt;
  | -&lt;br /&gt;
  | Blue/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 37&lt;br /&gt;
  | BCM26&lt;br /&gt;
  | PGD1//470&lt;br /&gt;
  | DIN (0)&lt;br /&gt;
  | Brown&lt;br /&gt;
|-&lt;br /&gt;
  | 35&lt;br /&gt;
  | BCM19&lt;br /&gt;
  | PGD2//470&lt;br /&gt;
  | DOUT (0)&lt;br /&gt;
  | Blue&lt;br /&gt;
|-&lt;br /&gt;
  | 33&lt;br /&gt;
  | BCM13&lt;br /&gt;
  | PGC&lt;br /&gt;
  | CLK (0)&lt;br /&gt;
  | Green&lt;br /&gt;
|-&lt;br /&gt;
  | 29&lt;br /&gt;
  | BCM5&lt;br /&gt;
  | RST (when high)&lt;br /&gt;
  | MCLR (1)&lt;br /&gt;
  | Brown/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 03&lt;br /&gt;
  | BCM2&lt;br /&gt;
  | PGMmode (high)&lt;br /&gt;
  | PGM (0)&lt;br /&gt;
  | Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If RST low and PGMmode high the pic enter program mode (12V @ MCLR).&lt;br /&gt;
If RST high (PGMmode any but should be low) the pic reset and hold.&lt;br /&gt;
If PGMmode low and RST low the pic run with MCLR at high impedance (or pulled up from dsPicnode side. &lt;br /&gt;
&lt;br /&gt;
PGD1 and PDG2 are summed with two 470 ohm resistors to the pic PGD&lt;br /&gt;
PGC is connected to the pic PGC with one series resistor of 470 ohm.&lt;br /&gt;
&lt;br /&gt;
The 12V pull-up is wired with a 100 Ohm resistor (version 1) and 470 ohm (original version). This is a non-essential situation as it was devised to create 4.3V  if PGMmode and RST were independent.&lt;br /&gt;
&lt;br /&gt;
The Picpgm column shows how to set the Picpgm configuration file in order to use this programmer with the GPIO's shown on the table. It also shows if the invert option should be selected for each of them.&lt;br /&gt;
&lt;br /&gt;
==Software use==&lt;br /&gt;
&lt;br /&gt;
The picpgm software is [http://picpgm.picprojects.net/index.html hosted here] and should be used with the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Bash file @ /etc/rc.local&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#The following lines should be added to file to allow the pic to run after RPI boot&lt;br /&gt;
#The wiringpi package needs to be installed&lt;br /&gt;
gpio -g mode 5 down&lt;br /&gt;
gpio -g mode 2 down&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A backup is also founded at elab1/...&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3630</id>
		<title>DsPic-Raspberry programmer interface</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3630"/>
		<updated>2020-05-13T19:22:01Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* dsPic-Raspberry programmer interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=dsPic-Raspberry programmer interface=&lt;br /&gt;
&lt;br /&gt;
A general purpose interface consisting in two opto-couplers have been developed to program the dsPic micro-controllers directly from the Raspberry, allowing remote maintenance and reprogramming of each de-localized unit.&lt;br /&gt;
&lt;br /&gt;
It as to be powered by 12 V (minimum voltage 10.5V - maximum voltage 13.5V) dsPic node unregulated Vcc and feed by the Raspberry GP_I/O, with a common digital ground.&lt;br /&gt;
&lt;br /&gt;
== Pin-out and connections==&lt;br /&gt;
[[File:ProgrammerOptoCouplerTopView.jpg||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
[[File:SchematicPicProgrammer.png||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
The following table describes the pin-out assembly of the opt-programmer developed to be used with picpgm software. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;6&amp;quot;|Programmer pin-out&lt;br /&gt;
|-&lt;br /&gt;
  | '''Rasp I/O&lt;br /&gt;
  | '''Label&lt;br /&gt;
  | '''Programmer I/O&lt;br /&gt;
  | '''Picpgm function (invert)&lt;br /&gt;
  | '''Cable&lt;br /&gt;
|-&lt;br /&gt;
  | 39&lt;br /&gt;
  | GND&lt;br /&gt;
  | GND&lt;br /&gt;
  | -&lt;br /&gt;
  | Blue/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 37&lt;br /&gt;
  | BCM26&lt;br /&gt;
  | PGD1//470&lt;br /&gt;
  | DIN (0)&lt;br /&gt;
  | Brown&lt;br /&gt;
|-&lt;br /&gt;
  | 35&lt;br /&gt;
  | BCM19&lt;br /&gt;
  | PGD2//470&lt;br /&gt;
  | DOUT (0)&lt;br /&gt;
  | Blue&lt;br /&gt;
|-&lt;br /&gt;
  | 33&lt;br /&gt;
  | BCM13&lt;br /&gt;
  | PGC&lt;br /&gt;
  | CLK (0)&lt;br /&gt;
  | Green&lt;br /&gt;
|-&lt;br /&gt;
  | 29&lt;br /&gt;
  | BCM5&lt;br /&gt;
  | RST (when high)&lt;br /&gt;
  | MCLR (1)&lt;br /&gt;
  | Brown/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 03&lt;br /&gt;
  | BCM2&lt;br /&gt;
  | PGMmode (high)&lt;br /&gt;
  | PGM (0)&lt;br /&gt;
  | Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If RST low and PGMmode high the pic enter program mode (12V @ MCLR).&lt;br /&gt;
If RST high (PGMmode any but should be low) the pic reset and hold.&lt;br /&gt;
If PGMmode low and RST low the pic run with MCLR at high impedance (or pulled up from dsPicnode side. &lt;br /&gt;
&lt;br /&gt;
PGD1 and PDG2 are summed with two 470 ohm resistors to the pic PGD&lt;br /&gt;
PGC is connected to the pic PGC with one series resistor of 470 ohm.&lt;br /&gt;
&lt;br /&gt;
The 12V pull-up is wired with a 100 Ohm resistor (version 1) and 470 ohm (original version). This is a non-essential situation as it was devised to create 4.3V  if PGMmode and RST were independent.&lt;br /&gt;
&lt;br /&gt;
The Picpgm column shows how to set the Picpgm configuration file in order to use this programmer with the GPIO's shown on the table. It also shows if the invert option should be selected for each of them.&lt;br /&gt;
&lt;br /&gt;
==Software use==&lt;br /&gt;
&lt;br /&gt;
The picpgm software is [http://picpgm.picprojects.net/index.html hosted here] and should be used with the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Bash file @ /etc/rc.local&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#The following lines should be added to file to allow the pic to run after RPI boot&lt;br /&gt;
#The wiringpi package needs to be installed&lt;br /&gt;
gpio -g mode 5 down&lt;br /&gt;
gpio -g mode 2 down&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Phyton script&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;CODE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A backup is also founded at elab1/...&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3628</id>
		<title>DsPic-Raspberry programmer interface</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface&amp;diff=3628"/>
		<updated>2020-05-13T19:19:22Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Pin-out and connections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=dsPic-Raspberry programmer interface=&lt;br /&gt;
&lt;br /&gt;
A general purpose interface consisting in two opto-couplers have been developed to program the dsPic micro-controllers directly from the Raspberry, allowing remote maintenance and reprogramming of each de-localized unit.&lt;br /&gt;
&lt;br /&gt;
It as to be powered by 12 V (minimum voltage 10.5V - maximum voltage 13.5V) dsPic node unregulated Vcc and feed by the Raspberry GP_I/O, with a common digital ground.&lt;br /&gt;
&lt;br /&gt;
== Pin-out and connections==&lt;br /&gt;
[[File:ProgrammerOptoCouplerTopView.jpg||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
[[File:SchematicPicProgrammer.png||thumb|Photo of the pic programmer.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
The following table describes the pin-out assembly of the opt-programmer developed to be used with picpgm software. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;6&amp;quot;|Programmer pin-out&lt;br /&gt;
|-&lt;br /&gt;
  | '''Rasp I/O&lt;br /&gt;
  | '''Label&lt;br /&gt;
  | '''Programmer I/O&lt;br /&gt;
  | '''Picpgm function (invert)&lt;br /&gt;
  | '''Cable&lt;br /&gt;
|-&lt;br /&gt;
  | 39&lt;br /&gt;
  | GND&lt;br /&gt;
  | GND&lt;br /&gt;
  | -&lt;br /&gt;
  | Blue/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 37&lt;br /&gt;
  | BCM26&lt;br /&gt;
  | PGD1//470&lt;br /&gt;
  | DIN (0)&lt;br /&gt;
  | Brown&lt;br /&gt;
|-&lt;br /&gt;
  | 35&lt;br /&gt;
  | BCM19&lt;br /&gt;
  | PGD2//470&lt;br /&gt;
  | DOUT (0)&lt;br /&gt;
  | Blue&lt;br /&gt;
|-&lt;br /&gt;
  | 33&lt;br /&gt;
  | BCM13&lt;br /&gt;
  | PGC&lt;br /&gt;
  | CLK (0)&lt;br /&gt;
  | Green&lt;br /&gt;
|-&lt;br /&gt;
  | 29&lt;br /&gt;
  | BCM5&lt;br /&gt;
  | RST (when high)&lt;br /&gt;
  | MCLR (1)&lt;br /&gt;
  | Brown/Wh&lt;br /&gt;
|-&lt;br /&gt;
  | 03&lt;br /&gt;
  | BCM2&lt;br /&gt;
  | PGMmode (high)&lt;br /&gt;
  | PGM (0)&lt;br /&gt;
  | Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If RST low and PGMmode high the pic enter program mode (12V @ MCLR).&lt;br /&gt;
If RST high (PGMmode any but should be low) the pic reset and hold.&lt;br /&gt;
If PGMmode low and RST low the pic run with MCLR at high impedance (or pulled up from dsPicnode side. &lt;br /&gt;
&lt;br /&gt;
PGD1 and PDG2 are summed with two 470 ohm resistors to the pic PGD&lt;br /&gt;
PGC is connected to the pic PGC with one series resistor of 470 ohm.&lt;br /&gt;
&lt;br /&gt;
The 12V pull-up is wired with a 100 Ohm resistor (version 1) and 470 ohm (original version). This is a non-essential situation as it was devised to create 4.3V  if PGMmode and RST were independent.&lt;br /&gt;
&lt;br /&gt;
The Picpgm column shows how to set the Picpgm configuration file in order to use this programmer with the GPIO's shown on the table. It also shows if the invert option should be selected for each of them.&lt;br /&gt;
&lt;br /&gt;
==Software use==&lt;br /&gt;
&lt;br /&gt;
The picpgm software is [http://picpgm.picprojects.net/index.html hosted here] and should be used with the following script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Bash file @ /etc/rc.local&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;CODE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Phyton script&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;CODE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A backup is also founded at elab1/...&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3570</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3570"/>
		<updated>2020-04-27T23:51:28Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_UESC_IOS&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployment&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wpuesciosHardwareServer_24-01-2020.zip -d wpuescios&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wpuescios&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwpuesciosDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deployed after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In case ttyS0 is not being used, a symbolic linker ca be used if needed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /dev/ttyAMA0 /dev/ttyS0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
su USER -c &amp;quot;/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&amp;quot;&lt;br /&gt;
su USER -c &amp;quot;(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=\&amp;quot;%x - %X\&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, typically ''wpa'' as previously instructed.&lt;br /&gt;
&lt;br /&gt;
In case ttyS0 is not being used, a symbolic linker ca be used if needed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /dev/ttyAMA0 /dev/ttyS0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3512</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3512"/>
		<updated>2020-03-23T19:00:39Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployment&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deployed after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
su - USER /home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
su - USER (gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, as previously instructed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3508</id>
		<title>List of UDP ports for streaming</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3508"/>
		<updated>2020-03-16T17:18:04Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following table list the information needed to setup video streaming for the partner pendulums. '''''Each partner pendulum must be set up to use the indicated ports.''''' Any deviation from this settings will result in conflicts that will disrupt video streaming on the affected pendulums.&lt;br /&gt;
&lt;br /&gt;
It also shows the names the corresponding SDP files are expected to have. These must also be followed, otherwise the client application won't be able to play the videos as the expected filenames will be missing. The ''xx'' as to be replaced by the confidential designated two digits.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Video Streaming Settings&lt;br /&gt;
|-&lt;br /&gt;
  | Pendulum Location&lt;br /&gt;
  | Experiment Name&lt;br /&gt;
  | Port&lt;br /&gt;
  | SDP Name&lt;br /&gt;
|-&lt;br /&gt;
  | Prague - CTU&lt;br /&gt;
  | WP_PRG&lt;br /&gt;
  | xx72&lt;br /&gt;
  | wp_prg.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Barcelona - UPC&lt;br /&gt;
  | WP_BCN&lt;br /&gt;
  | xx66&lt;br /&gt;
  | wp_bcn.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Marseille - ECM&lt;br /&gt;
  | WP_MRS&lt;br /&gt;
  | xx70&lt;br /&gt;
  | wp_mrs.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Brasilia - UnB&lt;br /&gt;
  | WP_UNB_BSB&lt;br /&gt;
  | xx90&lt;br /&gt;
  | wp_unb_bsb.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Ilheus - UESC&lt;br /&gt;
  | WP_UESC_IOS&lt;br /&gt;
  | xx22&lt;br /&gt;
  | wp_uesc_ios.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Rio de Janeiro - PUC&lt;br /&gt;
  | WP_PUC_RIO&lt;br /&gt;
  | xx46&lt;br /&gt;
  | wp_puc_rio.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Santiago - UChile&lt;br /&gt;
  | WP_UCHILE_SCL&lt;br /&gt;
  | xx76&lt;br /&gt;
  | wp_uc_scl.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Valparaíso - UTFSM&lt;br /&gt;
  | WP_UTFSM_VAP&lt;br /&gt;
  | xx78&lt;br /&gt;
  | wp_utfsm_vap.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UniAndes&lt;br /&gt;
  | WP_UNIANDES_BOG&lt;br /&gt;
  | xx80&lt;br /&gt;
  | wp_uniandes_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UNAD&lt;br /&gt;
  | WP_UNAD_BOG&lt;br /&gt;
  | xx82&lt;br /&gt;
  | wp_unad_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - UTP&lt;br /&gt;
  | WP_UTP_PTY&lt;br /&gt;
  | xx84&lt;br /&gt;
  | wp_utp_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - USMA&lt;br /&gt;
  | WP_USMA_PTY&lt;br /&gt;
  | xx86&lt;br /&gt;
  | wp_usma_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Praia - UniCV&lt;br /&gt;
  | WP_UNICV_RAI&lt;br /&gt;
  | xx74&lt;br /&gt;
  | wp_unicv_rai.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Punta Arenas - UMAG&lt;br /&gt;
  | WP_UMAG_PUQ&lt;br /&gt;
  | xx88&lt;br /&gt;
  | wp_umag_puq.sdp&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3502</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3502"/>
		<updated>2020-03-11T16:02:51Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Hardware Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployment&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deployed after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, as previously instructed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3500</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3500"/>
		<updated>2020-03-11T16:02:28Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Hardware Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployment&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, as previously instructed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3498</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3498"/>
		<updated>2020-03-11T16:00:17Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Hardware Server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployement&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir /home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd home/wpa/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, as previously instructed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3496</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3496"/>
		<updated>2020-03-11T15:58:46Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployement&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd home/wpa/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. The USER field should be changed to match the user account created, as previously instructed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3492</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3492"/>
		<updated>2020-03-11T15:38:30Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployement&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd home/wpa/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/USER/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the, USER, HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3490</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3490"/>
		<updated>2020-03-11T15:37:40Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
=== Network tools ===&lt;br /&gt;
The connetivity of the computer were the hardware server will be installed can be tested and verify by installing some tools such as nmap:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install nmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The nmap program is used to check for the port access testing to elab1.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab1.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployement&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd home/wpa/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
/home/$user/rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3486</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3486"/>
		<updated>2020-03-04T21:23:44Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Now that you have the Raspberry Pi and the Pendulum all set up, you are ready to connect it to the World Pendulum Alliance network.&amp;lt;/p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to do that you will need to deploy and run an application on the Raspberry. This application is called REC Hardware Server, it is a Java application and that is why it is necessary to have the JDK installed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Once you run the REC Hardware Server, it will automatically try to contact your Pendulum where it is expecting to find its ID String (e.g. &amp;quot;WP_TEST&amp;quot;). If it finds the expected ID, it will then connect with the Pendulum and your pendulum should come alive at elab1 public page. Otherwise it will output an error message, in which case we advise you to contact the project management team to help with the debugging.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The REC Hardware Server specific for your pendulum will be provided by the project coordination in a .ZIP file, that will be made available at a specific folder at elab1 server. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To deploy a new version of the REC Hardware Server for a specific pendulum you should open a terminal (e.g. Putty) and access the machine where the HardwareServer will be deployed - in this case, the RPi - and follow these steps:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if the &amp;quot;rec-deployement&amp;quot; directory exists, if not create it by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: mkdir home/wpa/rec-deployment &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
List HardwareServer Zip files:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;ls *.zip&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Once you identified the Hardware Server for your pendulum, copy the hardwareServer Zip file to your machine (Raspberry):&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;get ${hardwareServerZipFile} ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex. echo &amp;quot;get wpunicvraiHarwareServer_21-02-2020.zip ~/rec-reployment/&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
Go to rec-deployment directory:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;cd home/wpa/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipFile} -d ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: unzip wptestHarwareServer_24-01-2020.zip -d wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Change to directory of experience:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: cd wptest&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;ex: ./StartwptestDriver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page and executed with the minicom or other terminal program.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; \&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sleep 120&lt;br /&gt;
rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
(gst-launch-1.0 v4l2src device=/dev/video0 ! \&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 ! \&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;! \&lt;br /&gt;
 videoconvert ! \&lt;br /&gt;
 omxh264enc ! \&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse ! \&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay ! \&lt;br /&gt;
 udpsink host=HOST port=PORT async=false ) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3478</id>
		<title>List of UDP ports for streaming</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3478"/>
		<updated>2020-02-27T20:41:58Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following table list the information needed to setup video streaming for the partner pendulums. '''''Each partner pendulum must be set up to use the indicated ports.''''' Any deviation from this settings will result in conflicts that will disrupt video streaming on the affected pendulums.&lt;br /&gt;
&lt;br /&gt;
It also shows the names the corresponding SDP files are expected to have. These must also be followed, otherwise the client application won't be able to play the videos as the expected filenames will be missing. The ''xx'' as to be replaced by the confidential designated two digits.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Video Streaming Settings&lt;br /&gt;
|-&lt;br /&gt;
  | Pendulum Location&lt;br /&gt;
  | Experiment Name&lt;br /&gt;
  | Port&lt;br /&gt;
  | SDP Name&lt;br /&gt;
|-&lt;br /&gt;
  | Prague - CTU&lt;br /&gt;
  | WP_PRG&lt;br /&gt;
  | xx72&lt;br /&gt;
  | wp_prg.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Barcelona - UPC&lt;br /&gt;
  | WP_BCN&lt;br /&gt;
  | xx66&lt;br /&gt;
  | wp_bcn.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Marseille - ECM&lt;br /&gt;
  | WP_MRS&lt;br /&gt;
  | xx70&lt;br /&gt;
  | wp_mrs.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Brasilia - UnB&lt;br /&gt;
  | WP_UNB_BSB&lt;br /&gt;
  | xx90&lt;br /&gt;
  | wp_unb_bsb.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Ilheus - UESC&lt;br /&gt;
  | WP_UESC_IOS&lt;br /&gt;
  | xx22&lt;br /&gt;
  | wp_uesc_ios.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Rio de Janeiro - PUC&lt;br /&gt;
  | WP_PUC_RIO&lt;br /&gt;
  | xx46&lt;br /&gt;
  | wp_puc_rio.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Santiago - UChile&lt;br /&gt;
  | WP_UC_SCL&lt;br /&gt;
  | xx76&lt;br /&gt;
  | wp_uc_scl.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Valparaíso - UTFSM&lt;br /&gt;
  | WP_UTFSM_VAP&lt;br /&gt;
  | xx78&lt;br /&gt;
  | wp_utfsm_vap.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UniAndes&lt;br /&gt;
  | WP_UNIANDES_BOG&lt;br /&gt;
  | xx80&lt;br /&gt;
  | wp_uniandes_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UNAD&lt;br /&gt;
  | WP_UNAD_BOG&lt;br /&gt;
  | xx82&lt;br /&gt;
  | wp_unad_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - UTP&lt;br /&gt;
  | WP_UTP_PTY&lt;br /&gt;
  | xx84&lt;br /&gt;
  | wp_utp_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - USMA&lt;br /&gt;
  | WP_USMA_PTY&lt;br /&gt;
  | xx86&lt;br /&gt;
  | wp_usma_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Praia - UniCV&lt;br /&gt;
  | WP_UNICV_RAI&lt;br /&gt;
  | xx74&lt;br /&gt;
  | wp_unicv_rai.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Punta Arenas - UMAG&lt;br /&gt;
  | WP_UMAG_PUQ&lt;br /&gt;
  | xx88&lt;br /&gt;
  | wp_umag_puq.sdp&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3468</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3468"/>
		<updated>2020-02-24T15:30:16Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
To deploy a new version of the hardware server for a specific pendulum you should follow the following steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal (eg Putty) on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
login rasperry com o user wpa&lt;br /&gt;
&lt;br /&gt;
mkdir rec-deployment&lt;br /&gt;
&lt;br /&gt;
ssh elab1.ist.utl.pt -p 2222&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Ve o nome que corresponde à distribuicao pretendida e copia ultima versao&lt;br /&gt;
&lt;br /&gt;
scp {nome ficheiro}.zip wpa@{vpn_name}:~/rec-reployment/{nome ficheiro}.zip&lt;br /&gt;
&lt;br /&gt;
exit (logout elab1)&lt;br /&gt;
&lt;br /&gt;
cd rec-deployment&lt;br /&gt;
&lt;br /&gt;
Pkunzip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 !\&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 !\&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;!\&lt;br /&gt;
 videoconvert !\&lt;br /&gt;
 omxh264enc !\&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse !\&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay !\&lt;br /&gt;
 udpsink host=HOST port=PORT async=false &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and [[List of UDP ports for streaming| PORT]] fields need to be replaced as exampled above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3466</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3466"/>
		<updated>2020-02-24T15:29:33Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
To deploy a new version of the hardware server for a specific pendulum you should follow the following steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal (eg Putty) on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
login rasperry com o user wpa&lt;br /&gt;
&lt;br /&gt;
mkdir rec-deployment&lt;br /&gt;
&lt;br /&gt;
ssh elab1.ist.utl.pt -p 2222&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Ve o nome que corresponde à distribuicao pretendida e copia ultima versao&lt;br /&gt;
&lt;br /&gt;
scp {nome ficheiro}.zip wpa@{vpn_name}:~/rec-reployment/{nome ficheiro}.zip&lt;br /&gt;
&lt;br /&gt;
exit (logout elab1)&lt;br /&gt;
&lt;br /&gt;
cd rec-deployment&lt;br /&gt;
&lt;br /&gt;
Pkunzip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rec-deployment/exp_name/expDaemon.sh start &amp;amp;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 !\&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 !\&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;!\&lt;br /&gt;
 videoconvert !\&lt;br /&gt;
 omxh264enc !\&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse !\&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay !\&lt;br /&gt;
 udpsink host=HOST port=PORT async=false &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and PORT fields need to be replaced as exampled above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3464</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3464"/>
		<updated>2020-02-24T15:04:29Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
To deploy a new version of the hardware server for a specific pendulum you should follow the following steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal (eg Putty) on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
login rasperry com o user wpa&lt;br /&gt;
&lt;br /&gt;
mkdir rec-deployment&lt;br /&gt;
&lt;br /&gt;
ssh elab1.ist.utl.pt -p 2222&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Ve o nome que corresponde à distribuicao pretendida e copia ultima versao&lt;br /&gt;
&lt;br /&gt;
scp {nome ficheiro}.zip wpa@{vpn_name}:~/rec-reployment/{nome ficheiro}.zip&lt;br /&gt;
&lt;br /&gt;
exit (logout elab1)&lt;br /&gt;
&lt;br /&gt;
cd rec-deployment&lt;br /&gt;
&lt;br /&gt;
Pkunzip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(sleep 60; rec-deployment/exp_name/expDaemon.sh start) &amp;amp;&lt;br /&gt;
(sleep 10; gst-launch-1.0 v4l2src device=/dev/video0 !\&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 !\&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;!\&lt;br /&gt;
 videoconvert !\&lt;br /&gt;
 omxh264enc !\&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse !\&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay !\&lt;br /&gt;
 udpsink host=HOST port=PORT async=false) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the HOST and PORT fields need to be replaced as exampled above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3462</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3462"/>
		<updated>2020-02-24T14:59:33Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
To deploy a new version of the hardware server for a specific pendulum you should follow the following steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal (eg Putty) on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
login rasperry com o user wpa&lt;br /&gt;
&lt;br /&gt;
mkdir rec-deployment&lt;br /&gt;
&lt;br /&gt;
ssh elab1.ist.utl.pt -p 2222&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Ve o nome que corresponde à distribuicao pretendida e copia ultima versao&lt;br /&gt;
&lt;br /&gt;
scp {nome ficheiro}.zip wpa@{vpn_name}:~/rec-reployment/{nome ficheiro}.zip&lt;br /&gt;
&lt;br /&gt;
exit (logout elab1)&lt;br /&gt;
&lt;br /&gt;
cd rec-deployment&lt;br /&gt;
&lt;br /&gt;
Pkunzip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file, before the ''exit 0'' and after the ''fi'', will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(sleep 60; rec-deployment/exp_name/expDaemon.sh start) &amp;amp;&lt;br /&gt;
(sleep 10; gst-launch-1.0 v4l2src device=/dev/video0 !\&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 !\&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;!\&lt;br /&gt;
 videoconvert !\&lt;br /&gt;
 omxh264enc !\&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse !\&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay !\&lt;br /&gt;
 udpsink host=HOST port=PORT async=false) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3460</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3460"/>
		<updated>2020-02-24T14:58:40Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Automatically Start on RPi Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
To deploy a new version of the hardware server for a specific pendulum you should follow the following steps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal (eg Putty) on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
login rasperry com o user wpa&lt;br /&gt;
&lt;br /&gt;
mkdir rec-deployment&lt;br /&gt;
&lt;br /&gt;
ssh elab1.ist.utl.pt -p 2222&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
---&amp;gt; Ve o nome que corresponde à distribuicao pretendida e copia ultima versao&lt;br /&gt;
&lt;br /&gt;
scp {nome ficheiro}.zip wpa@{vpn_name}:~/rec-reployment/{nome ficheiro}.zip&lt;br /&gt;
&lt;br /&gt;
exit (logout elab1)&lt;br /&gt;
&lt;br /&gt;
cd rec-deployment&lt;br /&gt;
&lt;br /&gt;
Pkunzip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(sleep 60; rec-deployment/exp_name/expDaemon.sh start) &amp;amp;&lt;br /&gt;
(sleep 10; gst-launch-1.0 v4l2src device=/dev/video0 !\&lt;br /&gt;
 video/x-raw,width=320,height=240,framerate=10/1 !\&lt;br /&gt;
 clockoverlay time-format=&amp;quot;%x - %X&amp;quot;!\&lt;br /&gt;
 videoconvert !\&lt;br /&gt;
 omxh264enc !\&lt;br /&gt;
 video/x-h264,profile=baseline ! h264parse !\&lt;br /&gt;
 mpegtsmux ! rtpmp2tpay !\&lt;br /&gt;
 udpsink host=HOST port=PORT async=false) &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3446</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3446"/>
		<updated>2020-02-24T01:42:09Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VER HS E VIDEO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3444</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3444"/>
		<updated>2020-02-24T01:40:08Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions. Be sure to create the file with the name indicated on the aforementioned page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VER HS E VIDEO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3442</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3442"/>
		<updated>2020-02-24T01:38:54Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created with the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VER HS E VIDEO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3440</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3440"/>
		<updated>2020-02-24T01:38:33Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created in the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
To make the programs start automatically as the RPi boots, edit the file ''/etc/rc.local'' by executing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /etc/rc.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Assuming the hardware server has been placed on the folder indicated on the previous section, adding the following lines to the file will make the RPi start the hardware server and the video streaming automatically as it boots without further intervention.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VER HS E VIDEO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3438</id>
		<title>List of UDP ports for streaming</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3438"/>
		<updated>2020-02-24T01:30:55Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following table list the information needed to setup video streaming for the partner pendulums. '''''Each partner pendulum must be set up to use the indicated ports.''''' Any deviation from this settings will result in conflicts that will disrupt video streaming on the affected pendulums.&lt;br /&gt;
&lt;br /&gt;
It also shows the names the corresponding SDP files are expected to have. These must also be followed, otherwise the client application won't be able to play the videos as the expected filenames will be missing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Video Streaming Settings&lt;br /&gt;
|-&lt;br /&gt;
  | Pendulum Location&lt;br /&gt;
  | Experiment Name&lt;br /&gt;
  | Port&lt;br /&gt;
  | SDP Name&lt;br /&gt;
|-&lt;br /&gt;
  | Prague&lt;br /&gt;
  | WP_PRG&lt;br /&gt;
  | 5072&lt;br /&gt;
  | wp_prg.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Barcelona&lt;br /&gt;
  | WP_BCN&lt;br /&gt;
  | 5066&lt;br /&gt;
  | wp_bcn.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Marseille&lt;br /&gt;
  | WP_MRS&lt;br /&gt;
  | 5070&lt;br /&gt;
  | wp_mrs.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Brasilia&lt;br /&gt;
  | WP_UNB_BSB&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_unb_bsb.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Ilheus&lt;br /&gt;
  | WP_UESC_IOS&lt;br /&gt;
  | 5022&lt;br /&gt;
  | wp_uesc_ios.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Rio de Janeiro&lt;br /&gt;
  | WP_PUC_RIO&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_puc_rio.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Santiago&lt;br /&gt;
  | WP_UC_SCL&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_uc_scl.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Valparaíso&lt;br /&gt;
  | WP_UTFSM_VAP&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_utfsm_vap.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UniAndes&lt;br /&gt;
  | WP_UNIANDES_BOG&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_uniandes_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - Unad&lt;br /&gt;
  | WP_UNAD_BOG&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_unad_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - UTP&lt;br /&gt;
  | WP_UTP_PTY&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_utp_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - USMA&lt;br /&gt;
  | WP_USMA_PTY&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_usma_pty.sdp&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3436</id>
		<title>List of UDP ports for streaming</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=List_of_UDP_ports_for_streaming&amp;diff=3436"/>
		<updated>2020-02-24T01:29:03Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following table list the information needed to setup video streaming for the partner pendulums. '''''Each partner pendulum must be set up to use the indicated ports.''''' Any deviation from this settings will result in conflicts that will disrupt video streaming on the affected pendulums.&lt;br /&gt;
&lt;br /&gt;
It also shows the names the corresponding SDP files are expected to have. These must also be followed, otherwise the client application won't be able to play the videos as the expected filenames will be missing.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Video Streaming Settings&lt;br /&gt;
|-&lt;br /&gt;
  | Pendulum Location&lt;br /&gt;
  | Experiment Name&lt;br /&gt;
  | Port&lt;br /&gt;
  | SDP Name&lt;br /&gt;
|-&lt;br /&gt;
  | Prague&lt;br /&gt;
  | WP_PRG&lt;br /&gt;
  | 5072&lt;br /&gt;
  | wp_prg.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Maputo&lt;br /&gt;
  | WP_EPM&lt;br /&gt;
  | 5052&lt;br /&gt;
  | wp_epm.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | São Tomé&lt;br /&gt;
  | WP_SAOTOME&lt;br /&gt;
  | 5060&lt;br /&gt;
  | wp_saotome.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Barcelona&lt;br /&gt;
  | WP_BCN&lt;br /&gt;
  | 5066&lt;br /&gt;
  | wp_bcn.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Marseille&lt;br /&gt;
  | WP_MRS&lt;br /&gt;
  | 5070&lt;br /&gt;
  | wp_mrs.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Brasilia&lt;br /&gt;
  | WP_UNB_BSB&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_unb_bsb.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Ilheus&lt;br /&gt;
  | WP_UESC_IOS&lt;br /&gt;
  | 5022&lt;br /&gt;
  | wp_uesc_ios.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Rio de Janeiro&lt;br /&gt;
  | WP_PUC_RIO&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_puc_rio.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Santiago&lt;br /&gt;
  | WP_UC_SCL&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_uc_scl.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Valparaíso&lt;br /&gt;
  | WP_UTFSM_VAP&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_utfsm_vap.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - UniAndes&lt;br /&gt;
  | WP_UNIANDES_BOG&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_uniandes_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Bogotá - Unad&lt;br /&gt;
  | WP_UNAD_BOG&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_unad_bog.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - UTP&lt;br /&gt;
  | WP_UTP_PTY&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_utp_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Panamá City - USMA&lt;br /&gt;
  | WP_USMA_PTY&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_usma_pty.sdp&lt;br /&gt;
|-&lt;br /&gt;
  | Cabo Verde&lt;br /&gt;
  | WP_UNICV_RAI&lt;br /&gt;
  | xx&lt;br /&gt;
  | wp_unicv_rai.sdp&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3434</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3434"/>
		<updated>2020-02-24T01:07:25Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created in the same name as indicated on the [[List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3432</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3432"/>
		<updated>2020-02-24T01:07:13Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [[List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [[List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created in the same name as indicated on the [List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3430</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3430"/>
		<updated>2020-02-24T01:06:43Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [List of UDP ports for streaming| Port listing page.]] The ''HOST'' field should be set to the same value as described on the training sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SDP file should be created in the same name as indicated on the [List of UDP ports for streaming| Port listing page.]] This file must then be transferred to the server responsible for making it available to the web as instructed on the training sessions.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3428</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3428"/>
		<updated>2020-02-24T01:03:33Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v=0&lt;br /&gt;
o=- 16251185917537979632 16251185917537979632 IN IP4 EXPERIMENT NAME&lt;br /&gt;
s=EXPERIMENT NAME&lt;br /&gt;
i=N/A&lt;br /&gt;
c=IN IP4 HOST&lt;br /&gt;
t=0 0&lt;br /&gt;
a=tool:vlc 3.0.8&lt;br /&gt;
a=recvonly&lt;br /&gt;
a=type:broadcast&lt;br /&gt;
a=charset:UTF-8&lt;br /&gt;
m=video PORT RTP/AVP 33&lt;br /&gt;
b=RR:0&lt;br /&gt;
a=rtpmap:33 MP2T/90000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3426</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3426"/>
		<updated>2020-02-24T01:01:36Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or seen through the pendulum client software.&lt;br /&gt;
The file can be made by adapting the template below, replacing the ''EXPERIMENT NAME'' and ''PORT'' by the appropriate fields, as shown on the [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3424</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3424"/>
		<updated>2020-02-24T00:58:50Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
In order to make the needed information available for users to be able to connect to the stream, [https://en.wikipedia.org/wiki/Session_Description_Protocol| SDP] files must be made available. These can then be independently opened on video player software, like [https://www.videolan.org/vlc/| VLC], or&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3422</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3422"/>
		<updated>2020-02-24T00:54:10Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Specific Instructions for the World Pendulum Alliance Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
For the main partner pendulums, the HOST parameter of the streaming command should be set as instructed on the training sessions. The PORT should be set as indicated on [List of UDP ports for streaming| Port listing page.]]&lt;br /&gt;
For each secondary pendulum, the same process may be followed. However, partners must set up independent streaming infrastructure for secondary pendulums video streaming.&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3420</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3420"/>
		<updated>2020-02-23T20:56:12Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
==== Specific Instructions for the World Pendulum Alliance Project ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[List of UDP ports for streaming| Port listing]]&lt;br /&gt;
&lt;br /&gt;
=== Automatically Start on RPi Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3418</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3418"/>
		<updated>2020-02-21T17:44:39Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad\&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera. Furthermore, they were designed to work with a streaming server that receives the video from the RPi and resends it to all connected clients. &lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although it is almost certainly on ''/dev/video0'', it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the output, the entry of the format ''videoX'', where X is a number, is the logical location of the camera on the system. Edit the command above so that the number ''X'' is the same as the one listed on the output of the last command.&lt;br /&gt;
&lt;br /&gt;
It's possible to increase the resolution of the video and the framerate by altering the width, height and framerate fields on the example command above. The example values shown above are very conservative but ensure that video streaming is possible even in the toughest network conditions by generating a very low bitrate stream. Note that any width, height and framerate asked for needs to be supported by the video camera, otherwise the command will return with an error. Edit the HOST and PORT fields so they point to your particular video streaming server.&lt;br /&gt;
&lt;br /&gt;
Once it's verified that the video is running, it can be made permanent by slightly altering the command to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nohup gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false &amp;amp;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run until the RPi is shutdown or the camera is disconnected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[List of UDP ports for streaming| Port listing]]&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3416</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3416"/>
		<updated>2020-02-21T17:25:08Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: /* Video Streaming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera.&lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot;\&lt;br /&gt;
! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although its almost the case that it is, it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[List of UDP ports for streaming| Port listing]]&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
	<entry>
		<id>http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3414</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=3414"/>
		<updated>2020-02-21T17:24:37Z</updated>

		<summary type="html">&lt;p&gt;Ist176128: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Raspberry software=&lt;br /&gt;
&lt;br /&gt;
'''PAGE UNDER CONSTRUCTION'''&lt;br /&gt;
== Software management ==&lt;br /&gt;
The Raspberry Pi computer interfaces the experiment micro-controller and the e-lab servers. Without it, no remote access is possible. It's, therefore, essential it is properly setup and configured to ensure high reliability and safety.&lt;br /&gt;
&lt;br /&gt;
=== Operating System Installation ===&lt;br /&gt;
Should you start with a blank SD card, the first task is to install the Operating System (OS). There are several OSes supporting the Raspberry Pi (RPi) available and, in theory, any of those supporting the needed software can be used. However the use of Raspbian is ''' ''highly'' ''' recommended. It's the official OS from the Raspberry Pi Foundation for all RPi models, it has a wide selection of supported software available on the official repositories and tutorials and guides abound, online and in other mediums.&lt;br /&gt;
&lt;br /&gt;
'''''Instructions below this point assume that Raspbian is being used. Other OSes may have different configuration methods.'''''&lt;br /&gt;
&lt;br /&gt;
When creating a new SD card, the latest version of the OS should be installed. This ensures that the system is going to run with all the available security and performance fixes available. The latest version of Raspbian can be downloaded from [https://www.raspberrypi.org/downloads/raspbian/ this link]. Three versions are available:&lt;br /&gt;
* The ''lite version'' contains the minimal amount of software needed to boot the RPi. No extra software is included. This implies the lack of a Graphical User Interface (GUI), meaning that, if connected to a display, the RPi will show only a command line (as pictured).&lt;br /&gt;
* The ''desktop version'' contains the same software as the ''lite'' version plus the software needed to use a GUI. When connected to a display, the RPi will show a GUI (pictured).&lt;br /&gt;
* The ''desktop and recommended software'' version contains the same software as the ''desktop'' version plus some pre-selected software and utilities.&lt;br /&gt;
&lt;br /&gt;
The same software is available for installation on all versions, meaning that one can start with a ''lite'' version and later install all the software included in the ''desktop and recommended software'' version. '''If the RPi is being prepared to run solely as a server for the experiment, it's recommended that the ''lite'' or ''desktop'' version is chosen, as having an OS with only the needed software is safer, improves performance and maintainability. In particular, if you plan to use the RPi without a display, the ''lite'' version is of special interest as it doesn't package the GUI, which is only useful if you use a display.'''&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi Foundation provides installation instructions for the Raspbian OS [https://www.raspberrypi.org/documentation/installation/installing-images/README.md here].&lt;br /&gt;
&lt;br /&gt;
=== After Installation ===&lt;br /&gt;
After installing the OS, the SD card is now ready to be used to boot the RPi. However, before inserting the SD card on the RPi, one needs to consider how to interface it the RPi. It's possible to do so through two different methods, as follows:&lt;br /&gt;
&lt;br /&gt;
==== Using the RPi through a keyboard, mouse and display ====&lt;br /&gt;
When using a keyboard, mouse and display, the RPi works just like any other computer. Since it's possible to interface with the RPi through the keyboard, mouse and display, the SD card can be inserted into the RPi and the boot process can be started by connecting the power adapter to the RPi. This is a simpler procedure, however the extra hardware needed makes it more expensive. '''Do not connect the RPi to the internet before completing the OS configuration, as described below.'''&lt;br /&gt;
When successfully setup, you should see either a prompt showing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
or the usual graphical user interface of the OS, depending on the version of Raspbian chosen.&lt;br /&gt;
&lt;br /&gt;
Proceed to the '''RPi Operating System Configuration''' section.&lt;br /&gt;
&lt;br /&gt;
==== Connecting to the RPi through a ssh connection ====&lt;br /&gt;
If a keyboard, mouse and display are not available to use and interact with the RPi, it's still possible to interact with it by setting up the [https://en.wikipedia.org/wiki/Secure_Shell SSH] service before inserting the SD card into the RPi. The SSH service allows connections with a RPi via a network interface, through which commands can be sent. This makes use of the keyboard, mouse and display of a second computer, e.g. a already setup laptop or desktop computer. To do so, the Raspberry Pi and the computer used need their network setting to be adjusted.&lt;br /&gt;
&lt;br /&gt;
To enable the SSH service on the RPi externally:&lt;br /&gt;
*Insert the SD card into a computer, e.g. the one used to install the OS on the card.&lt;br /&gt;
*After installing the OS, the card will show on computers as being composed of two drives. A smaller drive of a few hundred MBs and a larger drive of a few GBs (depending on the size of the SD card).&lt;br /&gt;
*On the smaller &amp;quot;drive&amp;quot;, create an empty file called '''ssh'''. This enables the SSH service during the next boot of the RPi ''only''. This setting will be made permanent later.&lt;br /&gt;
*On the bigger &amp;quot;drive&amp;quot;, edit the file &amp;quot;/etc/dhcpcd.conf&amp;quot;. On the end of the file, there should be a section of text similar to this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# It is possible to fall back to a static IP if DHCP fails:&lt;br /&gt;
# define static profile&lt;br /&gt;
profile static_eth0&lt;br /&gt;
static ip_address=123.123.123.123/24&lt;br /&gt;
#static routers=192.168.1.1&lt;br /&gt;
#static domain_name_servers=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
# fallback to static profile on eth0&lt;br /&gt;
interface eth0&lt;br /&gt;
fallback static_eth0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the file so it mimics the text shown above. The line:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
static ip_address=123.123.123.123/24&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Defines the fallback IP address of the Raspberry Pi when it receives no IP offers through [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. In general, this happens when no connection is available on the network or it has been connected to a common laptop or desktop computer. Other fallback IP's other than 123.123.123.123 can be chosen. This one is suggested as it's easy to remember.&lt;br /&gt;
*The SD card can now be safely unmounted from the computer and inserted into the Raspberry Pi and booted&lt;br /&gt;
&lt;br /&gt;
Next, the computer that will connect to the RPi must have it's own Ethernet connection configured so it connects to the same [https://en.wikipedia.org/wiki/Subnetwork subnet] as the RPi. This means that, following the configuration shown above, its' IP should be configured to be ''123.123.123.xxx'', where the last number can be any from 001 to 254, and a netmask of ''255.255.255.000''. The exact procedure to follow to accomplish this is highly dependent on the OS installed on the computer. Be sure to proceed in a way appropriate for your specific OS. '''If your computer uses the Ethernet port for day-to-day internet connection, it's possible that some specific configuration is attributed to it to make this connection possible on your network. Be sure to preserve the original network settings, by either taking screenshots of the appropriate dialogs or taking notes, of your Ethernet adapter so you can rollback any changes made.''' Below are some examples for common OSes.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi =====&lt;br /&gt;
*Microsoft provides [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnet prefix length''/''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol on the Windows tray should now show the Ethernet connection. Possibly stating it is an unknown network.&lt;br /&gt;
*Windows does not install a SSH client by default. To connect to the RPi via SSH one must be set up. Although others can be used, [https://putty.org/ putty] is an open source, free software SSH client for Windows. It can be installed or used as standalone, meaning no install necessary. The following steps will follow the use of putty. Be aware that although the general configuration also applies to other software, specific instructions may differ.&lt;br /&gt;
*Fill the field ''Host Name (or IP Address)'' with the configured IP of the RPi. If the suggested configuration is being followed, this should be filled with ''123.123.123.123''. On the radio buttons below, select ''SSH''. If you wish to save this configuration so that it's not needed to remember or rewrite it every time, write any memorable name on the field ''Saved Sessions'' and click ''Save''. You can then retrieve this settings by selecting the name from the list and selecting ''Load''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Accept the warning by selecting ''Yes'' and the connection should be completed.&lt;br /&gt;
*When prompted for the user and password, input the default user and password of the Raspian OS which can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here].&lt;br /&gt;
*Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi =====&lt;br /&gt;
*Linux isn't a monolithic OS. What is generally know as Linux is a set of several distributions, also know as distros, that build an OS on the same basis, the Linux kernel. Depending on the distro used, the specific procedure to follow will differ. The following procedure applies to distros that have Network Manager setup to manage connectivity. This is the case for most of the popular distros, such as Ubuntu and its flavours, Linux Mint, Fedora, etc.&lt;br /&gt;
*Right click on the Network Manager icon and select edit connections&lt;br /&gt;
*Click on the ''+'' sign on the bottom left of the window,select Ethernet on the dialog shown and click create. By creating a new configuration, the settings used for regular internet access are preserved, making it easier to roll back the changes.&lt;br /&gt;
*The name field can be filled with any name, although it's recommended to write an easy to remember one, such as ''Raspberry'' or ''Ethernet RPi''.&lt;br /&gt;
*Select the ''IPv4 Settings'' tab and, on the ''Method'' dropdown menu, select ''Manual''.&lt;br /&gt;
*Click ''Add'' next to the ''Adresses'' table and, when prompted, fill the ''Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the neighboring field ''Netmask'' can be filled either with ''255.255.255.0'' or ''24''.&lt;br /&gt;
*The rest of the fields can be safely ignored. Click ''Save'' to save the new connection settings. The new settings will now appear on the list with the name selected.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The Network Manager icon should now show a spinning symbol, as it tries to connect to the RPi. Click on the Network Manager symbol and on the menu select the Ethernet connection with the name chosen before. The connection should now be set up.&lt;br /&gt;
*Most Linux distros include SSH client software on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi =====&lt;br /&gt;
*Apple provides [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instructions] on how to manually configure the Ethernet adapter.&lt;br /&gt;
*Follow the procedure for manually configuring IPv4 settings. When prompted, fill the ''IP Address'' field with an appropriate address according to the configuration selected for the RPi. Assuming the example configuration shown on this page was selected, this field can be filled with ''123.123.123.124'', and the field ''Subnetmask'' can be filled either with ''255.255.255.0'' or ''24''. Settings regarding the ''Gateway'' and ''DNS'' fields and IPv6 can be ignored.&lt;br /&gt;
*If not done so before, the RPi can be booted and connected to the computer throught Ethernet. This is accomplished by connecting one end of an Ethernet cable to the Ethernet port of the computer and the other end of the cable to the Ethernet port of the RPi&lt;br /&gt;
*The network symbol should now show the connection as being completed.&lt;br /&gt;
*MacOS includes a SSH client on the default OS install, making it unnecessary to install any additional software. SSH commands follow the syntax ''ssh user@ip'' or ''ssh user@hostname''. The default user and password of the Raspian OS can be found [https://www.raspberrypi.org/documentation/linux/usage/users.md here]. To connect to the RPi open a terminal on the computer, and write&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
''RPI ADDRESS'' should be replaced by the IP address selected for the RPi on the previous section. Assuming the configuration suggested was followed, the command should be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@123.123.123.123&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Note that in this case ''pi'' and ''123.123.123.123'' are used since we're connecting to the RPi as user pi and it's directly connected to the computer with the configured IP of ''123.123.123.123''. After creating a new user and deleting the default one and connecting the RPi to regular network, '''''this will change'''''.&lt;br /&gt;
*A warning can appear stating that the host, the computer you're connecting to, is new and unknown. You'll be asked if the new computer can be trusted and the connection completed. Since this a fresh install of a computer you own and have setup by yourself, you can safely answer yes. When prompted, input the password. If this is not the first time following this guide, it's possible that the warning states that the host, the computer you're connecting to, has changed. This is expected as you can now be applying theses steps to a different RPi. Edit the file stated on the warning and delete the line starting with the IP of the RPi. If the example configuration is being followed, this will be the line starting with ''123.123.123.123''. Attempt to reconnect by using the SSH command again. You should know see the warning stating this is a new, unknown computer.&lt;br /&gt;
*After successfully inputting the default password, a prompt will be shown stating:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
You have logged in successfully and can now proceed to the '''RPi Operating System Configuration'''&lt;br /&gt;
*If there was an error stating&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Where xxx.xxx.xxx.xxx is the IP used in the ssh command, the Ethernet adapters have been misconfigured. Please, revisit the configuration of the adapters. For a successful connection both the computer and the RPi must be configured to be in the same subnet. If you haven't followed the IP configuration suggested here, please note it is known to provide a functional set up.&lt;br /&gt;
&lt;br /&gt;
=== RPi Operating System Configuration ===&lt;br /&gt;
After installation, the OS needs to be configured. The following instructions are to be followed on the terminal prompt. If you are using a keyboard and display connected to the RPi and installed an OS with GUI, please open a terminal emulator.&lt;br /&gt;
&lt;br /&gt;
First, proceed with general system configuration by loading the raspi-config utilty, executing the command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo raspi-config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When prompted input user's ''pi'' password. The menu that shows can be navigated using arrow keys for selection, escape key for moving backwards on the menus and enter to select the highlighted entry.&lt;br /&gt;
&lt;br /&gt;
*The ''1 Change User Password'' entry can be ignored as the ''pi'' user will be deleted later&lt;br /&gt;
&lt;br /&gt;
*On the ''2 Network Options'' entry, it's possible for the ''Hostname'' to be set and a ''Wi-fi'' connection to be configured. &lt;br /&gt;
&lt;br /&gt;
The ''Hostname'' is the name assigned to the RPi and has no special meaning. It's helpful for easy recognition of the computer based only on name. &lt;br /&gt;
&lt;br /&gt;
The ''Wi-fi'' entry allows the configuration of a Wi-fi network by entering the SSID (network name) and network password. This dialog only works for WEP, WPA and WPA2 schemes. WPA-entreprise must be manualy setup through the [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore the remaining entries unless certain about the changes being performed. &lt;br /&gt;
&lt;br /&gt;
*On the ''3 Boot Options'', it's the ''Desktop / CLI'' entry selects whether the RPi boots into a GUI environment or into a command prompt, the ''Wait for Network at Boot'' if it waits for network connection before completing the boot process and the ''Splash Screen'' if it shows an image or debugging text during boot.&lt;br /&gt;
&lt;br /&gt;
Be aware that the ''Desktop / CLI'' entry only produces effects if you previously installed a version of Raspbian with GUI or have meanwhile installed a GUI on the lite version.&lt;br /&gt;
&lt;br /&gt;
These settings are safe to setup according to users wishes.&lt;br /&gt;
&lt;br /&gt;
*On the ''4 Localisation Options'' entry, the ''Change Locale'' entry allows setting up the RPi so it's diplayed language, and other localisation elements, such as time and date format, name of days of the wiki, currency, etc, are according the RPi user's location, the ''Change Timezone'' entry allows setting the local timezone, so that the RPi shows the correct time and date, the ''Change Keyboard Layout'' entry allows the user to set up it's keyboard so that the keys typed in the physical keyboard match the ones that appear on screen, and the ''Change Wi-fi Country'' sets up the RPi so it's communicating on the right Wi-fi frequencies according to the local laws.&lt;br /&gt;
&lt;br /&gt;
The ''Change Keyboard Layout'' entry is only important if the RPi is used with a keyboard directly connected to it. Users connecting through SSH do no need to configure this setting.&lt;br /&gt;
&lt;br /&gt;
The ''Change Wi-fi Country'' entry must be configured if a Wi-fi connection is to be setup. Failure to do so may result in a non-working connection, as the RPi is trying to communicate in different frequencies as the rest of the local Wi-fi devices, and regulatory issues for the user for transmitting in prohibited frequencies.&lt;br /&gt;
&lt;br /&gt;
*On the ''5 Interfacing Options'', the entries allow enabling/disabling the various listed services. All should be configured to disabled except for the ''SSH'' and/or [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''] services, the ''Serial'' interface and ''Remote GPIO'' access.&lt;br /&gt;
&lt;br /&gt;
Be aware that the VNC service will only work if a GUI is installed on the system. If not, only the ''SSH' service can be enabled.&lt;br /&gt;
&lt;br /&gt;
Enabling the ''SSH'' service makes it unnecessary to create the ssh file on disk as described before. It will be available on every boot until disabled again.&lt;br /&gt;
&lt;br /&gt;
On the ''Serial'' entry, please select ''No'' when prompted if the login shell should be available over serial and ''Yes'' when prompted if the serial port hardware should be enabled.&lt;br /&gt;
&lt;br /&gt;
*Please ignore the remaining options, except for the ''Expand Filesystem'' option available on the ''Advanced Options'' entry.&lt;br /&gt;
&lt;br /&gt;
*Exit the utility by selecting ''Finish'' and, when prompted, allow the RPi to reboot  by selecting ''yes''. If connected via SSH, the connection will be automatically terminated.&lt;br /&gt;
&lt;br /&gt;
*Allow the RPi to finish rebooting. Do not power it off by disconnecting the power cable.&lt;br /&gt;
&lt;br /&gt;
*When the green led has stopped flashing, the reboot is complete. Login into the RPi as before.&lt;br /&gt;
&lt;br /&gt;
'''Before''' connecting the RPi to the internet, a new user must be to created and the the default user  must be deleted. '''''Since all fresh Raspbian OS installs have the same default user and password, [https://www.raspberrypi.org/documentation/linux/usage/users.md that everyone can find on the internet], keeping them available on the OS is a very serious security vulnerability. Anybody that knows this is free to try to login into your RPi and, if successful, take control of the system.'''''&lt;br /&gt;
&lt;br /&gt;
The following commands create an user named ''newton''. Other usernames can, and should be, chosen when configuring the RPi. The username newton is being used as an example.&lt;br /&gt;
*Create user ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
When prompted to input user ''pi's'' password, input the same password used to login. This will start the user creation process where a new password for the new user is going to be asked for. Choose a new password, different from the default ''pi'' user password. '''''When choosing the new password please remember that:'''''&lt;br /&gt;
&lt;br /&gt;
'''''Strong passwords have at least 8 characters, a mixture of both uppercase and lowercase letters, a mixture of letters and numbers and include at least one special character, e.g., ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''A strong password is hard to guess, but it should be easy to remember. A password that has to be written down is not strong, no matter how many of the above characteristics are employed.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Do not choose passwords that are composed of any word that can be found in a dictionary, in any language (e.g., airplane or aeroplano), a dictionary word with some letters simply replaced by numbers (e.g., a1rplan3 or aer0plan0), a repeated character or a series of characters (e.g., AAAAA or 12345), a keyboard series of characters (e.g., qwerty or qazwsx), anything that’s written down and stored somewhere near your computer.'''''&lt;br /&gt;
&lt;br /&gt;
'''''Your username and password are one of the main mechanisms of defense against unauthorized access and tampering. Having easy to guess usernames, weak passwords or having them known to the public severely impacts the security of your devices and network.'''''&lt;br /&gt;
&lt;br /&gt;
*Add the new user to the system groups&lt;br /&gt;
&lt;br /&gt;
Start by identifying the groups the original user ''pi'' is a member of by executing the command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command will output three lists in the format ''number(text)''. Keep the output on screen. Write, but don't execute, the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the previous command output, select the list after ''groups='', except for the first element, by clicking and dragging with the mouse over the text. Copy it to the command line by clicking the middle mouse button after selecting the text. Edit the current command by using the arrows on the keyboard to move the cursor and removing the numbers and parenthesis but keeping the text and commas. Add the name of the user being created to the end of the command. The final command should have the same format as this:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo usermod -a -G group1,group2,group3,group4 newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the user was successfully added to the system groups by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the output, after ''groups='', the same groups as above should appear. '''Do not proceed before they do.'''&lt;br /&gt;
&lt;br /&gt;
*Log out from the RPi and login using the new user&lt;br /&gt;
&lt;br /&gt;
*Delete the ''pi'' user account&lt;br /&gt;
&lt;br /&gt;
The default user ''pi'' still exist in the system. Leaving this account active is a security vulnerability. Delete it by executing:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo userdel -remove-home pi&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In order to configure the network where the RPi will be connected, it's often useful to know the [https://en.wikipedia.org/wiki/MAC_address MAC address] of the network adapter. Execute the following command:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If planning to connect the experiment via Ethernet cable, copy the ''ether'' field on the ''eht0'' entry of the output. If connecting via wireless connection, copy the ''ether'' field on the ''wlan0'' entry of the output. &lt;br /&gt;
&lt;br /&gt;
*If planning to use a VPN connection to manage remotely deployed experiments, now is also a good time to send the needed files to the RPi. Doing so ensures the needed secrecy of the keys, as they are sent through the cable that connects your computer and the RPi. If using the RPi with keyboard and display, consider shutting it down and writing the files directly on the sd card by inserting it on a computer. VPN configuration is highly dependent on your setup, so it should be completed on case by case basis.&lt;br /&gt;
&lt;br /&gt;
*If not done so, shutdown the RPi. Wait for the green led on the RPi to stop blinking before disconnecting the power source. Move it to its permanent location, connecting it to experiment's electronics and network infrastructure.&lt;br /&gt;
&lt;br /&gt;
*Turn on the RPi by connecting the power source. It should obtain a valid IP adress from your network. Network and firewall configuration is highly dependent on your specific network infrastructure. If the above instructions were followed, the RPi is configured to accept DHCP IP lease offers. In order for the hardware server and the video streaming to work, the RPi must be able to communicate &lt;br /&gt;
&lt;br /&gt;
*Login into it. Update the software on the RPi by running the following commands in succession:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get full-upgrade&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last command can take a while to complete. While it works, '''''DO NOT DISCONNECT THE RPi FROM THE POWER SOURCE. IF YOU DO, YOU'LL MOST LIKELY CORRUPT THE SD CARD AND YOU'LL HAVE TO START ANEW.''''' &lt;br /&gt;
&lt;br /&gt;
*Reboot the RPi to ensure the latest software is running. Log into it again.&lt;br /&gt;
&lt;br /&gt;
*Install the needed software for the hardware server and the video streaming.&lt;br /&gt;
&lt;br /&gt;
For the hardware server, the following software should be installed:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo apt-get install openjdk-8-jre-headless librxtx-java&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the video streaming, various software could be used. The recommend way is to use GStreamer and its libraries that support video hardware enconding on the RPi. It can be installed by the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad&lt;br /&gt;
gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config gstreamer1.0-omx-generic gstreamer1.0-omx-generic-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, also install the software for the VPN connection. For example, the openvpn client would be installed by the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install openvpn&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VPN is install, complete the configuration of the VPN with the files transfered to the RPi on the last step.&lt;br /&gt;
&lt;br /&gt;
Please note that the software manager will suggest extra packages, mostly dependencies of the ones explicited ordered to install. Accept any extra suggested packages.&lt;br /&gt;
&lt;br /&gt;
==Autonomous codes==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Open terminal on HardwareServer machine (in this case RPi) and folow the procedure:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Validate if rec-deployement directory exits, if not create by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ${home_directory}/rec-deployement &amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Unzip HardwareServer's zip file to rec-deployment directory&lt;br /&gt;
&amp;lt;pre&amp;gt;unzip ${hardwareServerZipLocation}/${hardwareServerZipFile} -d ${home_directory}/rec-deployement/${hardwareServerAliasName}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Start HardwareServer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ${home_directory}/rec-deployement/${hardwareServerAliasName} &amp;amp;&amp;amp; ./Start${AliasName}Driver.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE''&lt;br /&gt;
&lt;br /&gt;
The HardwareServer should only be deploy after the complete calibration procedure described on the next page.&lt;br /&gt;
&lt;br /&gt;
=== Video Streaming ===&lt;br /&gt;
The video streaming can be done by using the [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], the RPi proprietary camera, or a common USB camera. The following steps were tested on a USB camera.&lt;br /&gt;
&lt;br /&gt;
*Start the streaming on the RPi. This is done with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=10/1 ! clockoverlay time-format=&amp;quot;%x - %X&amp;quot; ! videoconvert ! omxh264enc ! video/x-h264,profile=baseline ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=HOST port=PORT async=false&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although its almost the case that it is, it's possible that the camera does not show on the RPi system on ''/dev/video0''. Verify that it is by running:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ls /dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[List of UDP ports for streaming| Port listing]]&lt;br /&gt;
&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;/div&gt;</summary>
		<author><name>Ist176128</name></author>
		
	</entry>
</feed>