<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.elab.tecnico.ulisboa.pt/wwwelab/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ist428984</id>
	<title>wwwelab - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.elab.tecnico.ulisboa.pt/wwwelab/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ist428984"/>
	<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Special:Contributions/Ist428984"/>
	<updated>2026-05-26T08:55:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4348</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4348"/>
		<updated>2021-08-26T14:12:40Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[FREE - Framework for Remote Experiments in Education |Previous Page (FREE - Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Descri%C3%A7%C3%A3o_do_aparato&amp;diff=4347</id>
		<title>Montagem do Pêndulo de Precisão: Descrição do aparato</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Descri%C3%A7%C3%A3o_do_aparato&amp;diff=4347"/>
		<updated>2021-08-26T14:11:56Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Limites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Descrição do aparato==&lt;br /&gt;
&lt;br /&gt;
O pêndulo é composto por três componentes: a estrutura de suporte para o fulcro do pêndulo; o lançador da massa do pêndulo e a electrónica do controlador.&lt;br /&gt;
&lt;br /&gt;
O suporte de base pode ser uma parede ou uma estrutura metálica robusta como a que é aqui apresentada. A escolha para o pêndulo foi um peso de treino de aço colocado de 2kg. Este peso tem a vantagem de ter um buraco perfurado para segurar um parafuso M4 e pode ser encontrado em qualquer boa loja de desporto. Este parafuso pode ser feito a partir de uma haste de latão roscado com 10mm de comprimento. Faz-se um pequeno furo de 1mm na haste, onde o cabo pendular é fixado utilizando uma corrente de solda fina (ou qualquer liga de prata fina) ou atando com um nó adequado. O cabo utilizado é de fio ''remanium'' de 0,4mm que pode ser comprado em qualquer dentista retalhista.&lt;br /&gt;
&lt;br /&gt;
As próximas figuras documentam a construção das secções metálicas do pêndulo. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+ Desenhos de fabrico-padrão do Pêndulo Mundial&lt;br /&gt;
|[[File:pendulo_mundial_vista.png|thumb]]&lt;br /&gt;
|[[File:pendulo_apoio.png|thumb]]&lt;br /&gt;
|[[File:pendulo_topo.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:pendulo_base.png|thumb]]&lt;br /&gt;
|[[File:pendulo_fulcro.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
O suporte do fulcro do pêndulo é feito a partir de qualquer superfície plana que seja robusta e dura, tal como uma peça de latão ou de aço inoxidável com um furo de 12-16mm. Esta superfície tem uma reentrância que é feita com uma lâmina de diamante ou de aço duro e que mantem o pivô no lugar, evitando o deslizamento.&lt;br /&gt;
&lt;br /&gt;
O próprio fulcro também é de aço inoxidável ou de latão e consiste num prisma triangular com 50mmx9mm com um furo central de 1mm numa das faces que atravessa a aresta oposta. Neste furo, é soldada ou colada uma agulha intravenosa por onde passa o cabo pendular que é fixado por um pequeno parafuso na parte superior. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:PendulumPivot.jpg|thumb| Suporte de pêndulo mostrando a estrutura de suporte do pivô para a pirâmide triangular de 50mmx9mm.]]&lt;br /&gt;
|[[File:Stringsuport.png|thumb|Suporte do cabo do pêndulo para evitar erros de alongamento. O cabo é fixado soldando-o num parafuso de latão M4 de 40mm de comprimento ou numa agulha intravenosa.]]&lt;br /&gt;
|[[File:Fulcro.jpg|thumb| Detalhe do fulcro do cabo, mostrando o parafuso que o fixa. O ''Remanium'' é muito dúctil e facilmente enrolado no parafuso.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Fulcro&amp;amp;Apoio.jpg|thumb| Estrutura de suporte do fulcro para ser fixada no topo da estrutura piramidal usando parafusos M6 ou M8 fortes.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Limites do comprimento do pêndulo==&lt;br /&gt;
O lançador do pêndulo e a electrónica do controlador têm limites que restingem o comprimento do pêndulo e/ou o funcionamento do conjunto do pêndulo de precisão. Cada um desses limites (mín. e máx.) são explicados nas próximas subsecções. A última subsecção ([[#Limites|Limites]]) mostra uma tabela com os limites para o lançador padrão e para a electrónica do controlador usados na montagem do aparato do World Pendulum Alliance (WPA).&lt;br /&gt;
&lt;br /&gt;
===Comprimento mínimo===&lt;br /&gt;
O comprimento mínimo do pêndulo é principalmente limitado pela velocidade do lançador. Para uma dada distância de lançamento, quanto mais curto for o pêndulo, maior será a sua velocidade horizontal. Assim, a aceleração da pá deve ser suficientemente alta para conseguir uma libertação &amp;quot;limpa&amp;quot; da bola e a velocidade da pá deve ser alta o suficiente para que se tenha a certeza que a bola nunca volta a tocar na pá depois de ter sido libertada. A velocidade máxima da pá e a sua aceleração ditam os limites para o comprimento mínimo do pêndulo e dependem da tensão do motor de passo. Quanto maior a tensão, maior é a velocidade e a aceleração que a pá pode ter. Uma restrição adicional que também pode ser observada em pêndulos demasiado curtos é o risco de a bola passar por cima da pá em casos de grandes distâncias de lançamento.&lt;br /&gt;
&lt;br /&gt;
Existem duas opções que podem ser adoptadas para reduzir o limite do comprimento mínimo de um pêndulo: &lt;br /&gt;
* '''Aumentar a tensão do motor de passo:''' Na configuração padrão do WPA, a tensão definida é de 12V. Algumas das fontes de energia disponibilizadas podem chegar aos 20V. Aumentar demasiado a tensão pode resultar no sobreaquecimento do motor pelo que é importante realizar este aumento com as devidas precauções. Uma sugestão é aumentar a tensão passo a passo realizando algumas experiências entre cada passo para verificar que o motor não sobreaquece. Uma tensão até 20V deve ser segura. &lt;br /&gt;
* '''Limitar a distância horizontal máxima de lançamento:''' Esta opção restringe o espaço operacional do lançador. Reduzindo a distância horizontal de lançamento (ângulo inicial), a velocidade horizontal máxima e a aceleração são reduzidas. A distância de lançamento deve ser reduzida até ao ponto em que a pá consegue fazer face aos requisitos de lançamento (velocidade e aceleração) sem o risco de parar a meio do processo de lançamento. &lt;br /&gt;
&lt;br /&gt;
'''NOTA:''' Seja qual for a circunstância, o ângulo inicial nunca deve exceder os 45 graus porque o controlador não foi programado para lidar com ângulos de lançamento superiores a 45 graus.&lt;br /&gt;
&lt;br /&gt;
===Comprimento máximo===&lt;br /&gt;
O comprimento máximo do pêndulo é limitado pela electrónica do controlador e está associado ao período de oscilação. Quanto maior o comprimento do pêndulo, maior é o período de oscilação. &lt;br /&gt;
Existem duas limitações no controlador:&lt;br /&gt;
* '''Temporizador ''Watchdog'':''' Este temporizador foi configurado por ''default'' para cerca de 16s. Como resultado, isto restringe o período de oscilação do pêndulo a um valor abaixo dos 16s. Valores maiores, até ~131s, podem ser configurados neste temporizador.&lt;br /&gt;
* '''Contador do período de oscilação:''' Este contador consiste num contador de 32 bits (2 x registos de 16 bits) e cada contagem corresponde a 1/3686400s (~271ns, pré-calibrador de temporizador 1:1). Esta configuração do temporizador resulta num tempo total máximo de ~1165 s. É possível obter tempos máximos totais mais elevados aumentando o pré-calibrador do temporizador (até 1:256). Neste caso, a resolução do temporizador é diminuída de acordo com o valor do pré-calibrador.&lt;br /&gt;
&lt;br /&gt;
Entre os dois, a principal limitação é, de longe, devida ao temporizador.&lt;br /&gt;
&lt;br /&gt;
===Limites===&lt;br /&gt;
A fotografia abaixo mostra o lançador usado no WPA. Este lançador utiliza uma tecnologia de calha em V e é caracterizado por uma distância máxima de lançamento horizontal de 250 mm. A tabela seguinte mostra os limites de comprimento do pêndulo para este lançador específico.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Launcher 2.png|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Limites do comprimento do pêndulo &amp;lt;br/&amp;gt;(ver [[#Limites do comprimento do pêndulo| Limites do comprimento do pêndulo]] para perceber estes limites)&lt;br /&gt;
|-&lt;br /&gt;
| Mínimo || ~1.5 m&lt;br /&gt;
|-&lt;br /&gt;
| Máximo || sem limite, virtualmente (~63.5 m)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Controlador de Experiências Remotas | Página Anterior (Controlador de Experiências Remotas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Montagem mecânica | Página Seguinte (Montagem mecânica)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Apparatus description | Versão em inglês (English Version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: descripción del aparato | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Apparatus_description&amp;diff=4346</id>
		<title>Precision Pendulum Assembly: Apparatus description</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Apparatus_description&amp;diff=4346"/>
		<updated>2021-08-26T14:09:42Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Limits */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Apparatus description==&lt;br /&gt;
&lt;br /&gt;
The pendulum apparatus is composed of three components: the supporting structure for the pendulum fulcrum, the launcher of the pendulum mass and the controller electronics.&lt;br /&gt;
&lt;br /&gt;
The basic support can be a wall or a robust metallic structure like the one presented here. The choice for the bob was a training steel weight from the official shot put with 2kg. This weight has the advantage of having a drilled hole for holding an M4 screw and can be found in any good sports shop. This screw can be made of a threaded brass rod with 10mm length. A small 1mm hole is drilled on the rod were the pendulum cable is fixed using current soldering thin-plumb(or any silver-thin alloy) or by tying a proper knot. The cable used is from 0.4mm ''remanium'' wire that can be bought in any dentistry retailer. &lt;br /&gt;
&lt;br /&gt;
The following drawings document the construction of the metallic pendulum's sections.&lt;br /&gt;
{|&lt;br /&gt;
|+ World Pendulum standard manufacturing drawings&lt;br /&gt;
|[[File:pendulo_mundial_vista.png|thumb]]&lt;br /&gt;
|[[File:pendulo_apoio.png|thumb]]&lt;br /&gt;
|[[File:pendulo_topo.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:pendulo_base.png|thumb]]&lt;br /&gt;
|[[File:pendulo_fulcro.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The support for the fulcrum is made from any robust and hard flat surface as for instance a brass or stainless steel piece with a 12-16mm hole. This surface has an indentation made with a diamond or hard steel blade which holds the pivot in place. With this design, slippage is avoided.&lt;br /&gt;
&lt;br /&gt;
The fulcrum itself is made as well of stainless steel or brass consisting in a triangular prism with 50mmx9mm with a central 1mm hole in one face crossing the opposite edge. In this hole is soldered or glued an intravenous needle where the pendulum cable goes through and is secured by a small screw on the top. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:PendulumPivot.jpg|thumb|Pendulum holder showing the pivot support structure for the 50mmx9mm triangular pyramid.]]&lt;br /&gt;
|[[File:Stringsuport.png|thumb|Pendulum string support to avoid elongation errors. The cable is fixed by soldering it into an M4 brass screw 40mm long or an intravenous needle.]]&lt;br /&gt;
|[[File:Fulcro.jpg|thumb|Pendulum string fulcrum detail showing the screw to hold the wire. Remanium is very ductile and easily wound around the screw.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Fulcro&amp;amp;Apoio.jpg|thumb|Fulcrum support structure to be held on top of the pyramidal pendulum support. Strong M6 or M8 screws are used.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Pendulum length limits==&lt;br /&gt;
The launcher of the pendulum and controller electronics have limits which restrict the pendulum length and/or operation of the Precision Pendulum Assembly.&lt;br /&gt;
Each one of those limits (min. and max.) are explained in the following subsections below.&lt;br /&gt;
The last subsection ([[#Limits|Limits]]) presents a table with the limits for the standard launcher and controller electronics used in the World Pendulum Alliance (WPA) apparatus assemblies.&lt;br /&gt;
&lt;br /&gt;
===Minimum length===&lt;br /&gt;
The minimum length of the pendulum is mainly limited by the launcher speed.&lt;br /&gt;
For a given launching distance, the shorter the pendulum the higher is the horizontal pendulum velocity.&lt;br /&gt;
Therefore, the shovel acceleration should be high enough to make a clean release of the ball and the shovel speed should be high enough to make sure the ball never touches the shovel after it has been released.&lt;br /&gt;
The shovel maximum speed and acceleration set the limits for the minimum pendulum length and they depend on the step-motor power voltage. The higher the voltage the higher the speed and acceleration the shovel can have.&lt;br /&gt;
An additional constrain that may also be observed in too short pendulums is the risk of the ball going over the shovel for large launching distances.&lt;br /&gt;
&lt;br /&gt;
There are two options that can be adopted to reduce the minimum length limit of a pendulum:&lt;br /&gt;
* '''Increase the step-motor power voltage:''' In the standard/default WPA launcher configuration, the power voltage is set to 12 V. Some of the provided power supplies can go up to 20 V. Increasing the power voltage too much may result in overheating of the motor. Care should be taken when performing this operation. A suggestion is to increase the voltage step by step while performing some experiments in between steps to verify that the motor does not overheat. A voltage up to 20 V should be safe to use.&lt;br /&gt;
* '''Limit the maximum horizontal launching distance:''' This options restricts the operational space of the launcher. By reducing the horizontal launching distance (initial angle), the maximum horizontal velocity and acceleration are reduced. The launching distance should be reduced to a point where the shovel can cope with the launching requirements (velocity and acceleration) without the risk of stalling half way during the launching process.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' In any circumstance, the initial angle should never exceed 45 degrees because the controller has not been programmed to deal with launching angles larger than 45 degrees.&lt;br /&gt;
&lt;br /&gt;
===Maximum length===&lt;br /&gt;
The maximum length of the pendulum is limited by the controller electronics and it is associated with oscillation period.&lt;br /&gt;
The longer the pendulum length the longer is the oscillation period.&lt;br /&gt;
There are two limitations in controller:&lt;br /&gt;
* '''Watchdog timer:''' This timer has been configured by default to last about 16 s. As a result, it restricts the oscillation period of the pendulum to a value lower than 16 s. Higher values up to ~131 s can be configured for the watchdog timer.&lt;br /&gt;
* '''Oscillation period counter:''' This counter consists of a 32 bit counter (2 x 16 bit registers) and each count corresponds to 1/3686400 s (~271 ns, timer prescaler 1:1). This timer configuration results in a total maximum time of ~1165 s. Higher counter total maximum times can be obtained by increasing the timer prescaler (up to 1:256). In this case the timer resolution is decreased in accordance to the prescaler value.&lt;br /&gt;
Between the two, the main limitation is, by far, due to the watchdog timer.&lt;br /&gt;
&lt;br /&gt;
===Limits===&lt;br /&gt;
A photo of the launcher used in the WPA is shown in the figure below.&lt;br /&gt;
This launcher uses a V-slot rail technology and it is characterized by a maximum horizontal launching distance of 250 mm.&lt;br /&gt;
The following table shows the pendulum length limits for this specific launcher.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Launcher 2.png|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Pendulum length limits&amp;lt;br/&amp;gt;(see [[#Pendulum length limits|Pendulum length limits]] to understand these limits)&lt;br /&gt;
|-&lt;br /&gt;
| Minimum || ~1.5 m&lt;br /&gt;
|-&lt;br /&gt;
| Maximum || virtually no limit (~63.5 m)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Remote Experiment Controller | Previous Page (Remote Experiment Controller)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Mechanical assembly| Next Page (Mechanical assembly)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Descrição do aparato | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: descripción del aparato | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly&amp;diff=4345</id>
		<title>Precision Pendulum Assembly: Mechanical assembly</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly&amp;diff=4345"/>
		<updated>2021-08-26T14:09:14Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Maintenance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mechanical assembly=&lt;br /&gt;
&lt;br /&gt;
In this section is described the procedure to assemble the tripod metallic structure also known as ''Primary Pendulums''.&lt;br /&gt;
&lt;br /&gt;
==Order of assembly and filling with sand==&lt;br /&gt;
&lt;br /&gt;
# Screw the three plastic base support under the triangular base and level the base with the help of a spirit level;&lt;br /&gt;
# Fit together the three lower sections of each leg following the numeration presented in the figure below;&lt;br /&gt;
# Fix each one of the legs to the triangular base by tightening the provided screw and taking into account the letters &amp;quot;E&amp;quot; and &amp;quot;D&amp;quot;, as shown in the figure below leaving the screws a bit loosy;&lt;br /&gt;
# Fill the legs with sand while the whole structure is standing in the vertical (use a table or step ladder);&lt;br /&gt;
# Fit the last section of each leg following the numeration;&lt;br /&gt;
# Fit the aluminum top plate and tighten it slightly to each one of the legs using the screws;&lt;br /&gt;
# To check that both top plate and base triangle are aligned, one can lean the whole structure against a wall and adjust the top plate in accordance if necessary. Once both aligned, firmly tighten the screws of the (i) bottom triangle followed by the (ii) top plate;&lt;br /&gt;
# Pass the bob cable and fix it in such position that the equatorial plane crosses the photo-gate, as shown in the schematic below (Horizontal view);&lt;br /&gt;
# Align the whole structure (regulating the height of the three pads touching the floor) so that the horizontal rest position of the ball relatively to the laser beam is as specified in the schematic below (view from top);&lt;br /&gt;
# Having the bob at rest, start the pendular movement by slowly excite the fulcrum in the top;&lt;br /&gt;
# With the help of a flashlight in the front of the shovel and putting a white paper on the shovel other end adjust the horizontal tilt screws in order to have the launcher platform aligned with the plane of oscillation. This can be seen easily if the shadow center of the bob do not move horizontally.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:TripodMetallicAss_BaseWFeet.jpg|x400px|Base of the metallic structure]] &lt;br /&gt;
|[[File:structure_assembly_procedure_crop.png|x400px|Structure assembly procedure]]&lt;br /&gt;
|[[File:TripodMetallicAss_FillingSand.jpg|x400px|Fill the legs with sand]]&lt;br /&gt;
|[[File:TripodMetallicAss_TopPart.jpg|x400px|Top]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Ball and laser equatorial plane.png|x250px|Top|Frontal view of the laser alignment]]&lt;br /&gt;
|[[File:Ball and laser relative position.png|x250px|Top|Top view of the laser alignment]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Wall mount assembly==&lt;br /&gt;
&lt;br /&gt;
The simplified version of the pendulum is delivered as a toolkit to be fixed in a masonry or concrete wall. It do not include the tripod and consists on the launcher with shovel and the top holder to sustain the fulcrum.&lt;br /&gt;
&lt;br /&gt;
The main aspects to retain on the fixture is (i) to have all structure completely tied-up and firmly secured, (ii) the launcher perfectly horizontal and (iii) aligned with the natural plane of oscillations (please refer to previous sub-section &amp;quot;Order of assembly&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Maintenance==&lt;br /&gt;
The main components of the launcher should not need any maintenance; do not lubricate any part except the rail in case it gets sticky. For that end it should be disassembled, clean with a soft tissue and alcohol and lubricated lightly with a very small amount of grease or vaseline on the linear bearing. Check if every rolling sphere is working properly.&lt;br /&gt;
&lt;br /&gt;
If the shovel's cable (over the rail) broke it has to be substituted by a steel cable with a track capability of 250 N, typically found as fish lines of 25m coils. If the location is in a hard climate were corrosion show-up it can be replaced by an equivalent dyneema cable.&lt;br /&gt;
&lt;br /&gt;
Please let it have two turns on the motor's shaft. Although the string position is not critical we have found that in some situations is preferable to have it between the shovel and the motor. Nevertheless never use a high tension on the cable as it can jeopardize the fast movement of the shovel. Usually 2-5 N should be enough to avoid slipping in the shaft.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Apparatus description |Previous Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces|Next Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Montagem mecânica |Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: ensamble mecanico |Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica&amp;diff=4344</id>
		<title>Montagem do Pêndulo de Precisão: Montagem mecânica</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica&amp;diff=4344"/>
		<updated>2021-08-26T14:08:59Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Manutenção */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Montagem mecânica=&lt;br /&gt;
&lt;br /&gt;
Nesta secção é descrito o procedimento de montagem do tripé metálico, também conhecido como ''Pêndulos Primários''.&lt;br /&gt;
&lt;br /&gt;
==Ordem de montagem e enchimento com areia==&lt;br /&gt;
&lt;br /&gt;
# Aparafusar as três bases de plástico por baixo da base triangular e nivelar a base com o auxílio de um nivel de bolha;&lt;br /&gt;
# Encaixar as três secções inferiores de cada perna seguindo a numeração apresentada na figura abaixo;&lt;br /&gt;
# Fixar cada uma das pernas à base triangular apertando o parafuso fornecido e levando em consideração as letras &amp;quot;E&amp;quot; e &amp;quot;D&amp;quot;, como mostra a figura abaixo, deixando os parafusos um pouco frouxos;&lt;br /&gt;
# Encher as pernas com areia com a estrutura em pé, na vertical (usar uma mesa ou escada);&lt;br /&gt;
# Ajustar a última secção de cada perna seguindo a numeração;&lt;br /&gt;
# Encaixar a placa superior de alumínio e apertar os parafusos levemente em cada uma das pernas;&lt;br /&gt;
# Para verificar se a placa superior e a base triângular estão alinhados, pode-se encostar toda a estrutura contra uma parede e ajustar a placa superior conforme necessário. Depois de ambos alinhados, apertar firmemente os parafusos do (i) triângulo inferior, seguido da (ii) placa superior;&lt;br /&gt;
# Passar o cabo do pêndulo e fixá-lo de forma a que o plano equatorial cruze a porta fotoelétrica, conforme mostra o esquema abaixo (vista horizontal);&lt;br /&gt;
# Alinhar toda a estrutura (regulando a altura das três almofadas que ficam em contacto com o chão) de forma a que a posição de descanso horizontal da bola, em relação ao feixe de laser, seja conforme especificado no esquema abaixo (vista de cima);&lt;br /&gt;
# Com o pêndulo em repouso, iniciar o movimento pendular movendo lentamente o fulcro no topo;&lt;br /&gt;
# Com o auxílio de uma lanterna na frente da pá e colocando um papel branco na sua outra ponta, ajustar os parafusos de inclinação horizontal para que a plataforma do lançador fique alinhada com o plano de oscilação. Isso pode ser visto facilmente se o centro da sombra do pêndulo não se mover horizontalmente.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:TripodMetallicAss_BaseWFeet.jpg|x400px|Base da estrutura metálica]] &lt;br /&gt;
|[[File:structure_assembly_procedure_crop.png|x400px|Procedimento da montagem da estrutura]]&lt;br /&gt;
|[[File:TripodMetallicAss_FillingSand.jpg|x400px|Colocação da areia nas pernas]]&lt;br /&gt;
|[[File:TripodMetallicAss_TopPart.jpg|x400px|Topo]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Ball and laser equatorial plane.png|x250px|Top|Vista frontal do alinhamento do laser]]&lt;br /&gt;
|[[File:Ball and laser relative position.png|x250px|Top|Vista de topo do alinhamento do laser]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Montagem do pêndulo numa parede==&lt;br /&gt;
&lt;br /&gt;
A versão simplificada do pêndulo é fornecida como um kit de ferramentas para ser fixado numa parede de alvenaria ou de cimento. Não inclui o tripé e consiste num lançador com pá e num suporte superior para sustentar o fulcro.&lt;br /&gt;
&lt;br /&gt;
Os principais aspectos a reter na fixação são (i) ter toda a estrutura completamente amarrada e fixa firmemente, (ii) ter o lançador perfeitamente horizontal e (iii) alinhado com o plano natural das oscilações (consultar a subsecção anterior &amp;quot;Ordem de montagem&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Manutenção==&lt;br /&gt;
Os principais componentes do lançador não devem precisar de manutenção; não lubrificar nenhuma parte, exceto a calha, caso esta fique pegajosa. Para isso, deve ser desmontada, limpa com um pano macio e álcool e lubrificada levemente com uma quantidade muito pequena de graxa ou vaselina. Verificar se todas as esferas rolantes funcionam corretamente.&lt;br /&gt;
&lt;br /&gt;
Se o cabo da pá (sobre o calha) se partir, este deve ser substituído por um cabo de aço com capacidade de 250 N, normalmente encontrado em linhas de pesca com bobinas de 25m. Se o pêndulo se encontrar num clima difícil onde a corrosão se manifesta facilmente, este cabo pode ser substituido por um cabo 'dyneema' equivalente.&lt;br /&gt;
&lt;br /&gt;
Sugerimos dar duas voltas no eixo do motor. Embora a posição da coluna não seja crítica, descobrimos que em algumas situações é preferível colocá-la entre a pá e o motor. No entanto, nunca usar uma tensão elevada no cabo, pois pode comprometer o movimento rápido da pá. Normalmente, 2-5 N deve ser suficiente para evitar escorregar no eixo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Descrição do aparato|Página Anterior (Descrição do aparato)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas|Página Seguinte (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Mechanical assembly |Versão em inglês (English Version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: ensamble mecanico |Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces&amp;diff=4343</id>
		<title>Precision Pendulum Assembly: Electrical interfaces</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces&amp;diff=4343"/>
		<updated>2021-08-26T14:06:42Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Electric tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Electrical interfaces==&lt;br /&gt;
This section describes the electrical components used to operate the experimental apparatus. As an overview, each launcher consists of:&lt;br /&gt;
* a Raspberry Pi (or computer running Linux): makes the interface between the micro-controller and the human (e.g., direct connection to a console) or e-lab server via Internet.&lt;br /&gt;
* a micro-controller (dsPic): makes the interface between the electrical components (including the step-motor) and the computer.&lt;br /&gt;
* complementary electrical components: laser, micro-switch, photo-gate (aka photo-diode), light bulb, temperature sensor and 7-digits display.&lt;br /&gt;
see [[#Parts|Parts]] for detailed description. These components are the interface between the experimental apparatus and the micro-controller while providing ways of controlling the pendulum as well as measurement capabilities.&lt;br /&gt;
&lt;br /&gt;
See the [[#Connections|Connections]] subsection for details on how to connect the electrical components.&lt;br /&gt;
&lt;br /&gt;
[[File:ComparisonPhotodiodeLDR.png|thum|Comparison in the dispersion error between a photo-diode (StDev=0.002) or LDR (StDev=0.006) photodetector due to slew rate.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
The photo-gate/photo-diode and laser alignment is described in subsection [[#Photo-gate and laser alignment|Photo-gate and laser alignment]]. In particular, photo-diodes have been chosen due to their faster transition characteristics, reducing the overall jitter on the photo-gate and consequently the random error. &lt;br /&gt;
&lt;br /&gt;
This is to be performed only after the micro-controller has been powered up, read section [[#Interface console to micro-controller|Interface console to micro-controller]] first.&lt;br /&gt;
&lt;br /&gt;
===Parts===&lt;br /&gt;
This subsection presents a description of the different electrical parts of the experiment.&lt;br /&gt;
* '''Raspberry Pi (RPi)''': Device running Linux to allow remote connection to the experiment as well as an easy way to interface with the micro-controller. The present micro-controller and corresponding flat cable connections are designed for the Raspberry Pi 3 model B, which has the following pin-out connections as described in https://www.raspberrypi.org/documentation/usage/gpio. The Raspberry Pi is used as well to power the micro-controller, as such a +5 V power supply with at least 2.5 A should be used.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_1.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''SD card''': The SD card comes with Linux operating system and all necessary additional programs. This should be an Industrial card with robust specs.&lt;br /&gt;
* '''Micro-controller board''': This board contains a micro-controller (dsPic33F) as well as all peripheral components needed for the control of the experiment. The board can be powered using the flat cable connected to the Raspberry Pi or by an USB connection (an onboard jumper is used to select the power source, the default position corresponds to the one from the flat cable/Raspberry source). The board contains 4 LEDs: 2 red, 1 blue and 1 green. The red LEDs indicate if power is connected to the board. Looking to the figures bellow, the red LED on the left corresponds to the +5 V that powers the micro-controller board. The red LED on the right corresponds to the +12 V power that is used to feed the step-motor. The blue and green LEDs (LEDs at the top on the figure) are used for run-time information output by the micro-controller. The blue (left) LED turns on when the micro-switch is pressed, i.e., when the shovel is at the origin. The green (right) LED turns on when the photo-gate is active (conducting), i.e., when it is lit by the laser. The blue and green LEDs are also used for two other cases: (i) at boot and (ii) to indicate that the micro-controller is in an error state. At boot, the LEDs blink 5 times with a period of 400 ms and with alternate states (when the blue LED is ON the green LED is OFF and vice-versa). To indicate an error state, the LEDs blink with a period of about 2 s.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:dspic_board_closed.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_open.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_closed_LEDs.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_blue.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_green.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Webcam''': The webcam is used to provide live video streaming during the execution of the experiment. It is connected to the Raspberry Pi via an USB cable. The RPi performs the encoding and then sends it through Internet.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:webcam.png|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Light bulb''': The light bulb consists of a 12 V LED bulb located above the launcher. This bulb turns on during the execution of the experiment to illuminate the pendulum and launcher (specially useful if the experiment is performed during night).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:light_bulb.png|x125px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Step-motor''': The step-motor is part of the launcher and it is controlled by the micro-controller via a quad 1/2 H bridge driver. The step-motor is responsible for the displacement of the shovel.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:step_motor_1.png|x100px]]&lt;br /&gt;
|[[File:step_motor_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Micro-switch''': The micro-switch is located at the origin, close to the 0 cm of the metric scale on the launcher. It is used to indicate the micro-controller that the shovel reached the origin and cannot go further in the backward direction (end of course).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ms_1.png|x100px]]&lt;br /&gt;
|[[File:ms_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Laser''': The laser is located approximately at the center of the launcher. In conjunction with the photo-gate/photo-diode, the laser is used to measure the oscillation period as well as the location of the shovel. This laser have a regulation for the focus, can be adjusted by rotating the lens.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:laser_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:Laser_2_crop.jpeg|x100px]]&lt;br /&gt;
|[[File:Laser_3_crop.jpeg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Photo-gate (aka photo-diode)''': The photo-gate is located in front of the laser. The bob travels in-between them interrupting the laser light periodically resulting in a change of state at the input pin of the micro-controller. It is then possible to measure the period of the pendulum and the bob velocity by knowing in advance it's diameter. ''NOTE'': Avoid direct sun-light or extreme luminous areas in front of it.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ph_gate_1.jpg|x100px]]&lt;br /&gt;
|[[File:ph_gate_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Temperature sensor''': A temperature sensor is located in the DB25 box to measure the ambient temperature. The ambient temperature influences the length of the pendulum. It is therefore important to monitor this quantity for high precision measurements.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:temp_sensor_1.jpg|x100px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Display''': The 7-digits display shows the total accumulated number of oscillations. It consists of 8 digits, each one a 7 segments display. Some of the micro-controller board versions allow the connection of the display directly on the board from outside of the box.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:display_loose_crop.jpg|x100px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Power supply''': The step-motor requires an external +12 V power supply capable of providing 2 A.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ps_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_2_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_3_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Start button''': The start button allows to locally start an experiment with a predefined configuration (initial displacement of 10 cm, 20 oscillations). An external stopwatch as to be use in complement to provide time.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Connections===&lt;br /&gt;
This subsection shows how the components and cables are connected between each other.&lt;br /&gt;
* '''RPi''': The Raspberry Pi connects to the following:&lt;br /&gt;
** Power supply (via micro USB connector)&lt;br /&gt;
** Internet (via Ethernet cable)&lt;br /&gt;
** Webcam (via USB cable)&lt;br /&gt;
** Micro-controller board (via dedicated flat-cable)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Dedicated flat-cable''': This cable lays down the connection between the micro-controller (dsPic) board, the RPi and the display. At the micro-controller side, the cable has a DB25 connector.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
At the RPi side, the cable has a 2x20 pin connector to ensure a correct connection, see figures below.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_rpi_1_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_2_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_3_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
At the display end, the connector consist of a 1x5 connector. Please ensure that the connector side is correct before connecting to the display: the VCC pin of the display connects to the wire that is highlighted in this case with a blue trace. See figure below for illustration. Some versions allow the display to be connected directly on the micro-controller box. In such cases, the display should be connected as shown on the right hand side, see figure below.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_display_crop.jpg|x150px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Micro-controller''': The dsPic board connects to the following:&lt;br /&gt;
** +12 V power supply to feed the step motor&lt;br /&gt;
** RPi (via the flat-cable)&lt;br /&gt;
** Electrical components (via dedicated multi-cable)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Dspic_board_closed_crop_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Dedicated multi-cable''': The multi-cable connects the dsPic board with electrical components used to perform the experiment. At the dsPic board end, the cable has a DB25 connector as shown in the figure below.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
At the light bulb, micro-switch, laser and photo-gate end, the multi-cable has a 2 pin connector as shown in the following figures:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_light_bulb_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_ms_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_laser_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_photogate_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
At the step-motor end, the multi-cable has 4 pin connector. This is the only 4 pin connector and therefore it is not identified as the remaining ones. See figure below for illustration.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_step_motor_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
The start button and temperature sensor are directly connected to the DB25 connector, so no need for intermediate connectors.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x75px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Photo-gate and laser alignment===&lt;br /&gt;
The photo-gate and laser alignment can only be performed once the micro-controller has been turned on and it is communicating with a console. See subsection [[#Interface console to micro-controller|Interface console to micro-controller]] on how to power on the micro-controller and how to control the laser.&lt;br /&gt;
The alignment consists of pointing the laser into the hole of the photo-gate structure, as shown below in the figure on the left. The laser orientation can be adjusted using the 3 screws from its holding support structure, figure on the middle. &lt;br /&gt;
&lt;br /&gt;
The procedure for the alignment consists of the following:&lt;br /&gt;
# Turn on the laser using the &amp;quot;laser on&amp;quot; command&lt;br /&gt;
# Verify with the help of a white sheet  if the Laser focus dimension is below 1mm by the photo-diode; if not, it as to be adjusted by screwing the laser.&lt;br /&gt;
# If necessary, adjust the laser orientation so that its light goes into the photo-gate structure hole (figure on the left). An example of misalignment is shown in the figure on the right.&lt;br /&gt;
# Perform the [[#Laser and photo-gate test|Laser and photo-gate test]]&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Laser_in_photogate_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_structure_3_screws_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_out_photogate_crop.jpg|x200px]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Electric tests===&lt;br /&gt;
* Test the micro-switch with the help of a multi-meter (ohmmeter). When released it should present a very high impedance (order of MOhm) and when pressed it should present a very low impedance (like a shunt, ~0 Ohm). Perform the measurement at the micro-switch and at the DB25 pins: between pins no. 3 and 4.&lt;br /&gt;
* Check voltage of step-motor power supply to ensure that it is not higher than +12 V.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Mechanical assembly| Previous Page (Mechanical assembly)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Software management| Next Page (Software management)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Interfaces eléctricas  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas&amp;diff=4342</id>
		<title>Montagem do Pêndulo de Precisão: Interfaces elétricas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas&amp;diff=4342"/>
		<updated>2021-08-26T14:06:28Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Testes elétricos */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Interfaces elétricas==&lt;br /&gt;
Esta secção descreve os componentes elétricos usados para operar o aparato experimental. De forma geral, cada lançador consiste em:&lt;br /&gt;
* um Raspberry Pi (ou computador com Linux): faz a interface entre o microcontrolador e o Homem (por exemplo, por conexão direta a uma consola) ou servidor de e-lab via Internet.&lt;br /&gt;
* um microcontrolador (dsPic): faz a interface entre os componentes elétricos (incluindo o motor de passo) e o computador.&lt;br /&gt;
* componentes elétricos complementares: laser, microinterruptor, sensor fotoeléctrico (também conhecido como fotodiodo), lâmpada, sensor de temperatura e display de 7 dígitos.&lt;br /&gt;
Consulte [[#Elementos |Elementos]] para uma descrição detalhada. Estes componentes são a interface entre o aparato experimental e o microcontrolador, ao mesmo tempo que fornecem tanto formas de controlar o pêndulo como recursos de medição.&lt;br /&gt;
&lt;br /&gt;
Veja a subsecção [[#Conexões |Conexões]] para detalhes sobre como conectar os componentes elétricos.&lt;br /&gt;
&lt;br /&gt;
[[File:ComparisonPhotodiodeLDR.png|thum|Comparação do erro de dispersão entre um fotodiodo (StDev = 0,002) e um fotodetector LDR (StDev = 0,006) devido à taxa de variação.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
O sensor fotoeléctrico/fotodiodo e o alinhamento do laser são descritos na subseção [[# Fotodiodo e alinhamento do laser |Fotodiodo e alinhamento do laser]]. Mais particularmente, os fotodiodos foram escolhidos devido às suas características de transição mais rápida, reduzindo o seu jitter geral e, consequentemente, o erro aleatório. &lt;br /&gt;
&lt;br /&gt;
Isto deve ser executado somente após ter sido ligado o microcontrolador. Leia a secção [[#Consola de interface para o microcontrolador | Consola de interface para o microcontrolador]] primeiro.&lt;br /&gt;
&lt;br /&gt;
===Elementos===&lt;br /&gt;
Esta subsecção descreve os diferentes elementos elétricos da experiência:&lt;br /&gt;
* '''Raspberry Pi (RPi)''': Dispositivo que executa o Linux para permitir a conexão remota com a experiência, bem como uma forma simples de interagir com o microcontrolador. O microcontrolador e as conexões dos cabos planos correspondentes são projetados para o Raspberry Pi 3 modelo B, que possui as conexões de pinagem conforme descrito em https://www.raspberrypi.org/documentation/usage/gpio. O Raspberry Pi também é usado para alimentar o microcontrolador, como tal, deve ser usada uma fonte de alimentação de +5 V com pelo menos 2,5 A.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_1.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Cartão SD''': O cartão SD vem com o sistema operacional Linux e todos os programas adicionais necessários. Deve ser um cartão industrial com especificações robustas.&lt;br /&gt;
* '''Placa do microcontrolador''': Esta placa contem um microcontrolador (dsPic33F) tal como todos os componentes periféricos necessários para o controlo da experiência. A placa pode ser alimentada usando um cabo plano conectado ao Raspberry Pi ou por uma conexão USB (um jumper integrado é usado para selecionar a fonte de alimentação, a posição padrão corresponde à do cabo plano/fonte Raspberry). A placa contem 4 LEDs: 2 vermelhos, 1 azul e 1 verde. Os LEDs vermelhos indicam se a alimentação está conectada à placa. Observando as figuras abaixo, o LED vermelho da esquerda corresponde aos +5V que alimentam a placa do microcontrolador. O LED vermelho da direita corresponde aos +12V que alimentam o motor de passo. Os LEDs azul e verde (no topo da figura) são usados para a saída de informação pelo microcontrolador durante o tempo de execução da experiência. O LED azul (esquerda) acende quando o microinterruptor é pressionado, i.e., quando a pá está na posição de origem. O LED verde (direita) acende quando fotodiodo está activo (a conduzir), i.e., quando é acionado pelo laser. Os LEDs azul e verde também são usados ​​para dois outros casos: (i) no arranque e (ii) para indicar que o microcontrolador está em estado de erro. No arranque, os LEDs piscam 5 vezes com um período de 400ms e em estados alternados (quando o LED azul está LIGADO, o LED verde está DESLIGADO e vice-versa). Para indicar um estado de erro, os LEDs piscam por um período de cerca de 2s.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:dspic_board_closed.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_open.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_closed_LEDs.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_blue.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_green.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Webcam''': A webcam é usada para fornecer streaming de vídeo ao vivo durante a execução da experiência. É conectada ao Raspberry Pi por meio de um cabo USB. O RPi realiza a codificação e envia esta informação pela Internet.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:webcam.png|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Lâmpada''': A lâmpada consiste numa lâmpada LED de 12 V localizada acima do lançador. Esta lâmpada acende durante a execução da experiência para iluminar o pêndulo e o lançador (especialmente útil se a experiência for realizada durante a noite).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:light_bulb.png|x125px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Motor de passo''': O motor de passo é parte do lançador e é controlado pelo microcontrolador através de um ''quad 1/2 H bridge driver''. O motor de passo é responsável pelo deslocamento da pá.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:step_motor_1.png|x100px]]&lt;br /&gt;
|[[File:step_motor_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Microinterruptor''': O microinterruptor está localizado na origem, próximo dos 0cm da escala métrica do lançador. É usado para indicar ao microcontrolador que a pá atingiu a origem e não pode avançar mais no sentido inverso (fim do seu percurso).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ms_1.png|x100px]]&lt;br /&gt;
|[[File:ms_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Laser''': O laser está localizado aproximadamente no centro do lançador. Em conjunto com o fotodiodo, o laser é usado para medir o período de oscilação bem como a localização da pá. Este laser possui uma regulação para o foco, pode ser ajustado girando a lente.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:laser_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:Laser_2_crop.jpeg|x100px]]&lt;br /&gt;
|[[File:Laser_3_crop.jpeg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Sensor fotoeléctrico (também conhecido como fotodiodo)''': Está localizado na frente do laser. O pêndulo viaja entre estes interrompendo a luz do laser periodicamente, o que resulta numa mudança de estado no pino de entrada do microcontrolador. Assim, sabendo o seu diâmetro de antemão, é possível medir o período do pêndulo e a sua velocidade. '' NOTA '': Evite a luz solar direta ou áreas extremamente luminosas na frente deste sensor.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ph_gate_1.jpg|x100px]]&lt;br /&gt;
|[[File:ph_gate_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Sensor de temperatura''': Está localizado na caixa DB25 para medir a temperatura ambiente. A temperatura ambiente influencia o comprimento do pêndulo. Portanto, é importante monitorizá-la para medições de alta precisão.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:temp_sensor_1.jpg|x100px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Display''': O display de 7 dígitos mostra o número total acumulado de oscilações. Consiste em 8 dígitos, cada um deles com um display de 7 segmentos. Algumas das versões da placa do microcontrolador permitem a ligação do display diretamente à placa a partir do exterior da caixa.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:display_loose_crop.jpg|x100px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Fonte de alimentação''': O motor de passo requer uma fonte de alimentação externa de +12V capaz de fornecer 2A.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ps_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_2_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_3_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Botão Iniciar''': Permite iniciar localmente uma experiência com uma configuração predefinida (deslocamento inicial de 10 cm, 20 oscilações). Deve ser usado um cronómetro externo como complemento para fornecer o tempo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Conexões===&lt;br /&gt;
Esta subsecção mostra como estão conectados entre si os componentes e os cabos. &lt;br /&gt;
* '''RPi''': O Raspberry Pi liga-se aos elementos seguintes:&lt;br /&gt;
** Fonte de alimentação (via conector micro USB)&lt;br /&gt;
** Internet (via cabo Ethernet)&lt;br /&gt;
** Webcam (via cabo USB)&lt;br /&gt;
** Placa do microcontrolador (via cabo plano dedicado)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Cabo plano dedicado''': Estabelece a ligação entre a placa do microcontrolador (dsPic), o RPi e o monitor. No lado do microcontrolador, o cabo possui um conector DB25.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
No lado do RPi, o cabo é um conector de 2x20 pinos para garantir uma conexão correta, como se pode observar nas figuras abaixo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_rpi_1_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_2_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_3_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade do display, o conector é um conector 1x5. Certifique-se de que o lado do conector é o correto antes de ligar ao display: o pino VCC do display conecta-se ao fio que está destacado (neste caso, com um traço azul). A figura abaixo, do lado esquerdo, ilustra o referido. Algumas versões permitem que o monitor seja conectado diretamente à caixa do microcontrolador. Nesses casos, o display deve ser conectado conforme se pode observar abaixo, no lado direito.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_display_crop.jpg|x150px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Micro-controlador''': A placa dsPic conecta-se aos seguintes elementos:&lt;br /&gt;
** Fonte de alimentação de +12 V para alimentar o motor de passo&lt;br /&gt;
** RPi (via cabo plano)&lt;br /&gt;
** Componentes elétricos (via multicabo dedicado)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Dspic_board_closed_crop_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Multi-cabo dedicado''': O multi-cabo conecta a placa dsPic aos componentes elétricos usados para realizar a experiência. O cabo possui um conector DB25 na extremidade da placa dsPic conforme mostrado na figura abaixo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade da lâmpada, do micro-interruptor, do laser e do sensor fotoelétrico, o multicabo tem um conector de 2 pinos, conforme mostrado nas figuras seguintes:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_light_bulb_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_ms_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_laser_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_photogate_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade do motor de passo, o multicabo possui um conector de 4 pinos. Visto que este é o único conector de 4 pinos, não é identificado como os restantes, como se pode observar na figura abaixo:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_step_motor_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
O botão Iniciar e o sensor de temperatura são conectados diretamente ao conector DB25. Desta forma, não são necessários conectores intermediários.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x75px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Fotodiodo e alinhamento do laser===&lt;br /&gt;
O fotodiodo e o alinhamento do laser só podem ser executados depois de o microcontrolador ser ligado e estiver a comunicar com uma consola. Consulte a subsecção [[# Consola de interface para o microcontrolador  | Consola de interface para o microcontrolador ]] para saber como ligar o microcontrolador e como controlar o laser.&lt;br /&gt;
Como se pode observar na figura abaixo, à esquerda, o alinhamento consiste em apontar o laser para dentro do orifício da estrutura do sensor fotoelétrico. A orientação do laser pode ser ajustada utilizando os 3 parafusos da estrutura de suporte, como ilustra a seguinte figura ao centro.&lt;br /&gt;
&lt;br /&gt;
O procedimento para o alinhamento consiste no seguinte:&lt;br /&gt;
# Ligue o laser usando o comando &amp;quot;Laser on&amp;quot;&lt;br /&gt;
# Verifique com a ajuda de um lençol branco se a dimensão do foco do laser está abaixo de 1mm no fotodíodo; caso contrário, deve ser ajustado aparafusando o laser.&lt;br /&gt;
# Se necessário, ajuste a orientação do laser de forma a que o feixe entre no orifício do sensor fotoelétrico (figura à esquerda). A figura à direita mostra um exemplo de desalinhamento.&lt;br /&gt;
# Realize o [[#Teste do laser e do sensor fotoeléctrico | Teste do laser e do sensor fotoeléctrico]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Laser_in_photogate_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_structure_3_screws_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_out_photogate_crop.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Testes elétricos===&lt;br /&gt;
* Teste o microinterruptor com a ajuda de um multímetro (ohmímetro): quando pressionado, deve apresentar uma impedância muito baixa (~ 0 Ohm). Em caso contrário, deve apresentar uma impedância muito alta (ordem de MOhm), e realize a medição tanto no microinterruptor e como nos pinos DB25 (entre os pinos nº3 e 4)&lt;br /&gt;
* Verifique a tensão da fonte de alimentação do motor de passo para garantir que não é superior a +12 V.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Montagem mecânica| Página Anterior (Montagem mecânica)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Gestão de software| Página Seguinte (Gestão de software)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Electrical interfaces | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Interfaces eléctricas  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4341</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4341"/>
		<updated>2021-08-26T14:06:06Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Download firmware file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 | 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 and utilities ===&lt;br /&gt;
The connectivity of the computer were the hardware server will be installed can be tested and verified 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 test the port access to elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which has admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4340</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4340"/>
		<updated>2021-08-26T14:05:54Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Descarregar o ficheiro de firmware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no MacOS Catalina/Mojave/High Sierra e ligação ao RPi =====&lt;br /&gt;
*A Apple fornece [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento para a configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi selecionada, este campo pode ser preenchido com ''123.123.123.124'', e o campo  ''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas.&lt;br /&gt;
*Se não o tiver feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Para tal, basta ligar uma extremidade do cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*O símbolo da rede deve agora mostrar a ligação como estando concluída&lt;br /&gt;
*MacOS inclui um cliente SSH client na instalação predefinida do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador, e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que a configuração sugerida foi adotada, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e ''123.123.123.123'' , uma vez que nos estamos a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com ''123.123.123.123''. Tente voltar a ligar utilizando novamente o comando SSH. Surgirá um aviso que indica que se trata de um computador novo, desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi|Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
=== Configuração do Sistema Operativo do RPi ===&lt;br /&gt;
Depois de instalado, o SO precisa de ser configurado. As próximas instruções devem ser seguidas no prompt terminal. Se estiver a utilizar um teclado e monitor ligados ao RPi e instalado um SO com IGU, por favor abra um emulador terminal.&lt;br /&gt;
&lt;br /&gt;
Primeiro, proceda à configuração geral do sistema carregando o utilitário raspi-config, ao executar o comando:&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;
Quando solicitado, introduza a senha do utilizador ''pi''. Pode navegar no menu usando as teclas de Seta para seleção, tecla Escape para retroceder nos menus e Enter para selecionar a entrada em destaque.&lt;br /&gt;
&lt;br /&gt;
*A opção ''1 Change User Password'' pode ser ignorada, uma vez que o utilizador ''pi'' será apagado mais tarde.&lt;br /&gt;
&lt;br /&gt;
*Na opção ''2 Network Options'' é possível definir o ''Hostname'' (Nome do Anfitrião) e configurar uma ligação ''Wi-fi''&lt;br /&gt;
&lt;br /&gt;
O ''Hostname'' é o nome atribuído ao RPi e não tem qualquer significado especial. É útil porque facilita o reconhecimento do computador com base apenas no nome. &lt;br /&gt;
&lt;br /&gt;
A entrada ''Wi-fi'' permite a configuração de uma rede Wi-Fi introduzindo o SSID (nome da rede) e a palavra-passe da rede. Este diálogo só funciona para esquemas WEP, WPA e WPA2. O WPA-entreprise deve ser configurado manualmente através do [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore as restantes entradas, a não ser que tenha a certeza das alterações que estará a realizar. &lt;br /&gt;
&lt;br /&gt;
*Em ''3 Boot Options'', a entrada ''Desktop / CLI'' é a que seleciona se o RPi arranca num ambiente IGU ou num prompt de comando; a entrada ''Wait for Network at Boot'' se espera pela ligação à rede antes de completar o arranque e a ''Splash Screen'' se mostra uma imagem ou um texto de depuração durante o arranque.&lt;br /&gt;
&lt;br /&gt;
Tenha em atenção que a entrada ''Desktop / CLI'' só produz efeitos se tiver previamente instalado uma versão do Raspbian com IGU ou tiver instalado entretanto uma IGU na versão ''lite''.&lt;br /&gt;
&lt;br /&gt;
Estas configurações são seguras para aplicar consoante o que os utilizadores pretendem.&lt;br /&gt;
&lt;br /&gt;
*Em ''4 Localisation Options'', a entrada ''Change Locale'' permite configurar o RPi de modo a que a língua, e outros elementos de localização, tais como o formato da hora e da data, o nome dos dias da wiki, a moeda, etc., estejam de acordo com a localização do utilizador RPi; a entrada ''Change Timezone'' permite configurar o fuso horário local, para que o RPi mostre a hora e a data corretas; ''Change Keyboard Layout'' permite configurar o teclado para que as teclas digitadas no teclado físico coincidam com as que aparecem no ecrã, e a entrada ''Change Wi-fi Country'' configura o RPi para que este comunique nas frequências wi-fi corretas de acordo com as leis locais.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Keyboard Layout'' só é importante se o RPi for utilizado com um teclado que lhe está diretamente ligado. Os utilizadores ligados através do SSH não precisam de configurar o teclado.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Wi-fi Country'' deve ser utilizada se se pretender configurar uma ligação Wi-fi. Uma configuração errada pode resultar seja numa ligação não operacional, uma vez que o RPi tentará comunicar em frequências diferentes dos restantes dispositivos Wi-fi locais, seja em questões legais para o utilizador por transmitir em frequências proibidas.&lt;br /&gt;
&lt;br /&gt;
*Em ''5 Interfacing Options'', as entradas permitem ativar/desativar os vários serviços listados. Todos devem ser desativados, excepto os serviços ''SSH'' e/ou [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''], a interface ''Serial'' e o acesso ''Remote GPIO''&lt;br /&gt;
&lt;br /&gt;
Note que o serviço VNC só funcionará se for instalada uma IGU no sistema. Caso contrário, só poderá ser ativado o serviço ''SSH''.&lt;br /&gt;
&lt;br /&gt;
A activação do serviço  ''SSH'' torna desnecessário criar o ficheiro ssh em disco, tal como descrito anteriormente. Este estará disponível em cada arranque até ser novamente desativado.&lt;br /&gt;
&lt;br /&gt;
Na entrada ''Serial'', selecione ''No'' se a ''login shell'' deve estar disponível em série e ''Yes'' se o hardware da porta-série deve ser ativado.&lt;br /&gt;
&lt;br /&gt;
*Ignore as restantes opções, exceto a opção ''Expand Filesystem'' disponível na entrada ''Advanced Options''.&lt;br /&gt;
&lt;br /&gt;
*Saia do utilitário selecionando ''Finish'' e, quando solicitado, permita que o RPi seja reiniciado selecionando ''yes''. Se estiver ligado via SSH, a ligação será terminada automaticamente.&lt;br /&gt;
&lt;br /&gt;
*Aguarde que o RPi reinicie completamente. Não desligue o cabo de alimentação do RPi.&lt;br /&gt;
&lt;br /&gt;
*Quando o LED verde deixar de piscar, o processo está completo. Inicie a sessão no RPi como anteriormente.&lt;br /&gt;
&lt;br /&gt;
'''Antes''' de ligar o RPi à Internet, deve ser criado um novo utilizador e o utilizador predefinido deve ser eliminado. '''''Uma vez que todas as novas instalações de SO Raspbian têm o mesmo utilizador e a palavra-passe padrão que  [https://www.raspberrypi.org/documentation/linux/usage/users.md todos podem encontrar na Internet], mantê-los disponíveis no SO é uma vulnerabilidade de segurança muito grave. Desta forma, qualquer pessoa é livre de tentar entrar no seu RPi e, tendo sucesso, assumir o controlo do sistema.'''''&lt;br /&gt;
&lt;br /&gt;
Os seguintes comandos criam um utilizador chamado ''newton''. Podem, e devem, ser ser escolhidos outros nomes de utilizador  aquando da configuração do RPi. ''newton'' está apenas a ser utilizado como exemplo &lt;br /&gt;
*Crie o utilizador ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Introduza a palavra-passe do utilizador ''pi'' quando solicitada. Use a mesma palavra-passe que utiliza para iniciar sessão. Isto iniciará o processo de criação do utilizador onde uma nova palavra-passe para o novo utilizador será solicitada. Escolha uma nova palavra-passe, diferente da palavra-passe de utilizador ''pi'' padrão'''''. Ao escolher a nova palavra-passe, note que:'''''&lt;br /&gt;
&lt;br /&gt;
'''''As senhas fortes têm pelo menos 8 caracteres, uma mistura de letras maiúsculas e minúsculas, uma mistura de letras e números e incluem, pelo menos, um carácter especial, por exemplo, ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''Uma palavra-passe forte é difícil de adivinhar mas deve ser fácil de lembrar. Uma palavra-passe que tem de ser escrita não é forte, por mais que sejam as suas características acima mencionadas. '''''&lt;br /&gt;
&lt;br /&gt;
'''''Não escolha palavras-passe compostas por: qualquer palavra que possa ser encontrada num dicionário, em qualquer língua (por exemplo, avião), uma palavra de dicionário com algumas letras simplesmente substituídas por números (por exemplo, a1rplan3 ou aer0plan0), um caracter repetido ou uma série de caracteres (por exemplo, AAAAA ou 12345), uma série de caracteres de teclado (por exemplo, qwerty ou qazwsx) ou qualquer coisa que esteja escrita e guardada algures perto do seu computador'''''&lt;br /&gt;
&lt;br /&gt;
'''''O seu nome de utilizador e a palavra-passe são dos principais mecanismos de defesa contra o acesso não autorizado e adulteração. Ter nomes de utilizador fáceis de adivinhar, senhas fracas ou que sejam conhecidas publicamente afeta gravemente a segurança dos seus dispositivos e da sua rede.'''''&lt;br /&gt;
&lt;br /&gt;
*Adicione o novo utilizador aos grupos do sistema&lt;br /&gt;
&lt;br /&gt;
Comece por identificar os grupos dos quais o utilizador ''pi'' original é membro, executando o comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O comando produzirá três listas no formato ''número(texto)''. Mantenha este output no ecrã. Escreva, mas não execute, o seguinte comando:&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;
A partir do resultado do comando anterior, selecione a lista após ''groups='', exceto o primeiro elemento, clicando e arrastando com o rato sobre o texto. Copie-o para a linha de comando, clicando no botão do meio do rato depois de selecionar o texto. Edite o comando atual utilizando as setas do teclado para mover o cursor e retirar os números e parênteses, mas mantendo o texto e as vírgulas. Acrescente o nome do utilizador que está a ser criado no fim do comando. O comando final deve ter o seguinte formato:&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;
Confirme que o utilizador foi adicionado aos grupos do sistema com sucesso executando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depois de ''groups='', deverá encontrar os mesmos grupos que acima. '''Não continue antes que estes surjam'''.&lt;br /&gt;
&lt;br /&gt;
*Saia do RPi e inicie sessão utilizando o novo utilizador&lt;br /&gt;
&lt;br /&gt;
*Apague a conta do utilizador ''pi''&lt;br /&gt;
&lt;br /&gt;
O utilizador ''pi'' padrão ainda existe no sistema. Manter esta conta ativa é uma vulnerabilidade de segurança. Apague-a executando:&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;
*A fim de configurar a rede onde o RPi será ligado, muitas vezes é útil conhecer o [https://en.wikipedia.org/wiki/MAC_address endereço MAC] do adaptador de rede. Execute o seguinte comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se planear ligar a experiência via cabo Ethernet, copie o campo ''ether'' na entrada ''eht0''. Se ligar via ligação sem fios, copie o campo ''ether'' na entrada ''wlan0''.&lt;br /&gt;
&lt;br /&gt;
*Se planear utilizar uma ligação VPN para gerir experiências controladas remotamente, é também uma boa altura para enviar os ficheiros necessários para o RPi. Ao fazê-lo, assegura que as chaves continuarão secretas, uma vez que são enviadas através do cabo que liga o seu computador ao RPi. Se utilizar o RPi com teclado e monitor, considere desligá-lo e escrever os ficheiros diretamente no cartão SD, inserindo-o num computador. A configuração VPN é altamente dependente do seu ''setup'', pelo que deve ser completada caso a caso.&lt;br /&gt;
&lt;br /&gt;
*Se não o fizer, desligue o RPi. Espere que o LED verde no RPi pare de piscar antes de desligar a fonte de alimentação. Mova-o para a sua localização permanente, ligando-o à infraestrutura eletrónica e de rede da experiência.&lt;br /&gt;
&lt;br /&gt;
*Ligue o RPi, ligando a fonte de energia. Deve obter um endereço de IP da sua rede válido. A configuração da rede e da firewall é altamente dependente da sua infraestrutura de rede específica. Se as instruções acima foram seguidas, o RPi está configurado para aceitar ofertas de aluguer de IP DHCP. Para que o servidor de hardware e a transmissão de vídeo possam funcionar, o RPi deve ser capaz de comunicar&lt;br /&gt;
&lt;br /&gt;
*Inicie a sessão e atualize o software no RPi, executando sucessivamente os seguintes comandos:&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;
O último comando pode demorar algum tempo a completar-se. Enquanto isso, '''''NÃO DESCONECTE O RPi DA FONTE ALIMENTAÇÃO. SE O FIZER, MUITO PROVAVELMENTE CORROMPERÁ O CARTÃO SD E TERÁ DE COMEÇAR DE NOVO.''''' &lt;br /&gt;
&lt;br /&gt;
*Reinicie o RPi para assegurar que o software mais recente está a funcionar. Volte a entrar.&lt;br /&gt;
&lt;br /&gt;
*Instale o software necessário para o servidor de hardware e para a transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Para o servidor de hardware, deve ser instalado o seguinte software:&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;
Para a transmissão de vídeo, podem ser utilizados vários programas. O modo recomendado é utilizar o  GStreamer e as suas bibliotecas, visto que suportam o ''enconding'' de hardware de vídeo no RPi. Pode ser instalado através do seguinte comando:&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;
Se necessário, instale também o software para a ligação VPN. Por exemplo, o cliente ''openvpn'' seria instalado através do comando:&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;
Agora que a VPN está instalada, complete a sua configuração com os ficheiros transferidos para o RPi na última etapa.&lt;br /&gt;
&lt;br /&gt;
Note que o gestor do software irá sugerir pacotes extra, na sua maioria dependências dos que foram referidos explicitamente para instalar. Aceite quaisquer pacotes extra sugeridos.&lt;br /&gt;
&lt;br /&gt;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Parceiros&amp;diff=4339</id>
		<title>Montagem do Pêndulo de Precisão: Parceiros</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Parceiros&amp;diff=4339"/>
		<updated>2021-08-26T14:05:31Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Parceiros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Parceiros==&lt;br /&gt;
As estruturas mecânicas que suportam as réplicas das escolas secundárias foram construídas e montadas com o apoio do CENFIM, Lisboa.&lt;br /&gt;
[[File:Cenfim_Logo.jpg‎]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração | Página Anterior (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Partners | Versão em inglês (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Socios  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Partners&amp;diff=4338</id>
		<title>Precision Pendulum Assembly: Partners</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Partners&amp;diff=4338"/>
		<updated>2021-08-26T14:05:23Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Partners */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Partners==&lt;br /&gt;
Mechanical structures in support of high schools replicas have been assembled and constructed with the kind help of CENFIM, Lisbon.&lt;br /&gt;
[[File:Cenfim_Logo.jpg‎]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Previous Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Parceiros | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Socios  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Calibration&amp;diff=4337</id>
		<title>Precision Pendulum Assembly: Calibration</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Calibration&amp;diff=4337"/>
		<updated>2021-08-26T14:05:12Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Local gravity access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibration==&lt;br /&gt;
&lt;br /&gt;
===String measurement===&lt;br /&gt;
[[File:CalibracaoFitaMetrica.jpg||thumb|Measuring tape rigorous calibration with a caliper aid to surpass any offset.|right|border|240px]]&lt;br /&gt;
[[File:CableMeasurement.png||thumb|Detail of the pendulum cable length calibration, where the plateau touch the measuring tape to avoid parallax giving in this particular case 2824 mm.|right|border|240px]]&lt;br /&gt;
The pendulum accuracy depends strongly in its rigorous length measurement (~2,8 m) with less than 0,5 mm. Indeed this is the crucial factor to achieve the desired 0,02% accuracy and for that propose a well-calibrated measuring tape as to be chose. If this method is adopted special care has to be taken to avoid parallax. Alternative methods like ultrasonic measurement with laser targeting are the best, using a metallic or marble stone plane fitted tangential to the weight (allowing it to roll but touching the plane). With this method a few takes shall be done surrounding the ball and their average value will be considered the pendulum reference length. &lt;br /&gt;
&lt;br /&gt;
Recalibration of the length as to be pursuit every month to guarantee a reasonable precision.&lt;br /&gt;
&lt;br /&gt;
In the first figure is shown how to rectify the measuring tape initial offset by careful eliminating the systematic error from the contact with the sphere. Then, the tape passes through the plateau's hole where the fulcrum seats till it reaches the ball surface. Then a few measurements should be taken in order to have a proper average.&lt;br /&gt;
&lt;br /&gt;
===Plane of oscillation===&lt;br /&gt;
[[File:CalibrationVideoShort.gif||thumb|Correctness of the launcher alignment after the procedure to adjust the plane of oscilations.|right|border]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The plane of oscillation has to be critical defined in order to avoid second order effects on the period determination due to an elliptic moment instead of a planar one. Of course Coriolis force can not be avoided but only for very long runs (&amp;gt;15 min) it will influence significantly the movement.&lt;br /&gt;
&lt;br /&gt;
To have the plane well established any tangential force during the bob's launch as to be avoided. For such, a perfect alignment of the shovel trajectory within the plane of oscilation has to be verified.&lt;br /&gt;
&lt;br /&gt;
====Floor parallelism from top and bottom triangles====&lt;br /&gt;
The first calibration is to provide a coarse parallelism between the upper and lower structural triangles. For that end  the structure as to be laid down in a regular floor and have a final tighten of the screws leading to a rigid armor fixture.&lt;br /&gt;
&lt;br /&gt;
Then, the top triangle has to be leveled by using the bob itself, letting it be in the center position of the lower triangle and at ~10-12 cm from the back; in the orthogonal direction of the oscillatory plane a spirit level has to be used in first approximation and later a fine tuning of the bob has to be refined according to the photo-gate position. It as to be guaranteed that the bob travel exactly by the middle of the photo-gate.&lt;br /&gt;
====Bob movement given by fulcrum excitation====&lt;br /&gt;
After locating the pendulum in it's final place and having the bob at rest, start a gentle swinging (slow movement) by exciting it in the fulcrum at the top in order to define the plane of oscillation. &lt;br /&gt;
&lt;br /&gt;
*First of all assure that this oscillation is roughly parallel to the launcher/wall by rotating the fulcrum's holder.&lt;br /&gt;
&lt;br /&gt;
*With the help of a flashlight (i) in the front of the shovel/bob and (ii) putting a white paper with a vertical centered black line on top of the shovel at the origin (iii) adjust the horizontal tilt screws of the launcher in order to have the launcher platform perfectly aligned with the plane of oscillation. This can be seen easily if the shadow center of the bob do not move horizontally and the cable's shadow do no deviate from the paper's black line.&lt;br /&gt;
&lt;br /&gt;
===Interface console to micro-controller===&lt;br /&gt;
The micro-controller provides a menu that allows the user to set the parameters of the experiment and run predefined functions to allow configuration and testing.&lt;br /&gt;
The interface between user and micro-controller is performed via the RS-232 serial connection with the following parameters:&lt;br /&gt;
    • Baud-rate: 115200 bps&lt;br /&gt;
    • Parity: No&lt;br /&gt;
    • Data bits: 8&lt;br /&gt;
    • Stop bits: 1&lt;br /&gt;
Please be aware if you have another application using the corresponding device. Actually you can have the JAVA daemon running, preventing access to the serial port. In such case it should be stopped (by running the command with the flag STOP) prior to run the minicom application as in the following example (please adapt to your local path):&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
After any maintenance where it was deemed necessary to stop this daemon is has to be restarted by issueing the reciprocal command:&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
As an example, the “minicom” console interface can be used to communicate with the micro-controller. In the RaspberryPi, this interface can be called from a shell using the following command:&lt;br /&gt;
    minicom -D /dev/ttyS0&lt;br /&gt;
or&lt;br /&gt;
    minicom -D /dev/ttyAMA0&lt;br /&gt;
The “/dev/ttyS0” or &amp;quot;/dev/ttyAMA0&amp;quot; is the device (micro-controller) location. The minicom program will create a serial connection with default parameter which, in principle, are the same as the ones mentioned above. If not, check the help page of the minicom program (type &amp;quot;man minicom&amp;quot;) to see how to set those parameters. After launching the program, be sure to add a line feed so that the messages sent by the micro-controller appear in new lines. In minicom, the line feed is activated/deactivated by pressing '''Ctrl+a''' followed by '''a'''.&lt;br /&gt;
Once the communication (connection) is established, it is possible to access the micro-controller menu by sending:&lt;br /&gt;
    ? (question mark followed by an enter hit)&lt;br /&gt;
or&lt;br /&gt;
    help (“help” followed by an enter hit)&lt;br /&gt;
The output will be similar to the one shown in the following figure:&lt;br /&gt;
&lt;br /&gt;
[[File:dsPic_console_menu.png|700px|Interface console menu to micro-controller]]&lt;br /&gt;
&lt;br /&gt;
Every command should be followed by a carriage return – “\r” (hit enter) so that the micro-controller can process the sent string. Hitting enter also clears the micro-controller input buffer, so it can also be used for that purpose. The words in the commands are separated by one space character only except for the “cfg    deltaX[…]    N[...]” command where the words/inputs are separated by one tab character “\t”. If the sent command is successively received, the micro-controller will reply to the sent command by returning the send command in capital letters. If the command is successively executed the micro-controller will reply with an OK.&lt;br /&gt;
&lt;br /&gt;
The “[ ]” (square brackets) in the commands define the range of accepted input values. The numeric representation of these limits indicate the type of accepted value, i.e., integer or float. If the limit value contains a decimal case, the accepted values for that parameter are float. If the limit value does not contain a decimal case, the accepted values are integer only.&lt;br /&gt;
See the following examples:&lt;br /&gt;
    cfg    deltaX[5:25]    N[10:1000]                                      -&amp;gt;    cfg    15    30&lt;br /&gt;
    set maximum position %lf [40.0 60.0] (cm)                              -&amp;gt;    set maximum position 47.7&lt;br /&gt;
    set catch ball delay %d [1 2000] (ms)                                  -&amp;gt;    set catch ball delay 300&lt;br /&gt;
    set pulley diameter %lf [1.0 4.0] (cm)                                 -&amp;gt;    set pulley diameter 2.356&lt;br /&gt;
    set ID string %s [maximum length of 32 characters]                     -&amp;gt;    set ID string WORLD_PENDULUM_LISBON&lt;br /&gt;
    cur                                                                    -&amp;gt;    cur&lt;br /&gt;
    go to origin speed[1.0:50.0] acceleration[1.0:150.0]                   -&amp;gt;    go to origin 11.5 41.1&lt;br /&gt;
    move forward deltaX[1:50.0] speed[1.0:50.0] acceleration[1.0:150.0]    -&amp;gt;    move forward 4.5 2.2 2.0    &lt;br /&gt;
&lt;br /&gt;
Before turning the micro-controller on, it is important to perform two position measurements (maximum and vertical). The procedure to measure these positions is described in [[#Setting specific parameters for the experiment|Setting specific parameters for the experiment]].&lt;br /&gt;
&lt;br /&gt;
====Description of the console menu (commands/outputs)====&lt;br /&gt;
Commands related with the state machine and communication with e-lab driver (Java program running in the RaspberryPi):&lt;br /&gt;
* '''cur''': Ask the micro-controller about its current configuration. The micro-controller will return the following line:&lt;br /&gt;
:[[File:cur_dsPic_return.png|x60px|cur dsPic return]]&lt;br /&gt;
* '''str''': Change the micro-controller state to STARTED and starts an experiment if previously configured using a &amp;quot;cfg&amp;quot; command. Once the experiment has started the micro-controller will output the data in the following format: 1st column - data point number, 2nd column - period (s), 3rd column - g (m/s²), 4th column - velocity at laser location (cm/s), 5th column - room temperature (degC). See the figure below for illustration:&lt;br /&gt;
:[[File:str_and_data_dsPic_return.png|x230px|str and data dsPic return]]&lt;br /&gt;
* '''stp''': Stops an experiment and send the micro-controller to the STOPED state.&lt;br /&gt;
* '''rst''': Resets the micro-controller and send it to the RESET state.&lt;br /&gt;
* '''ids''': Ask the micro-controller to send its identifications. E.g.: IDS     WP_LIS  STOPED&lt;br /&gt;
* '''cfg''': Send the configuration for a new experiment. This command accepts two integer parameters: 1st - initial displacement in cm, 2nd - number of oscillations&lt;br /&gt;
:[[File:cfg_dsPic_return.png|x60px|cfg dsPic return]]&lt;br /&gt;
&lt;br /&gt;
Commands to execute predefined functions, useful for calibrations and testing:&lt;br /&gt;
* '''stop ball''': This command is used to stop the ball from oscillating. After stopping the ball, the shovel resting position is at the photo-diode/photo-gate.&lt;br /&gt;
* '''prepare launch''': This command accepts one integer which corresponds to the initial displacement (maximum amplitude) before releasing the ball. The command displaces the shovel to the required position and rests at that position.&lt;br /&gt;
* '''launch ball''': This command releases the ball by sending the shovel to the origin at its maximum speed.&lt;br /&gt;
* '''test laser''': This function is used to simultaneously test the laser and the photo-gate/photo-diode. A more detailed description of this command is found in [[#Laser and photo-gate test|Laser and photo-gate test]] as well as procedures to check in case of a failed test.&lt;br /&gt;
* '''go to origin''': This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the origin (until it reaches the micro-switch).&lt;br /&gt;
* '''move forward''': This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the forward direction (away from the origin).&lt;br /&gt;
* '''move backward''': This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the backward direction (towards the origin).&lt;br /&gt;
* '''move to photodiode''': This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the photo-diode/photo-gate if the shovel is beyond the photo-diode/photo-gate in the forward direction. If the shovel is between the photo-diode and the origin the command sends the shovel to the origin (until it reaches the micro-switch).&lt;br /&gt;
* '''light bulb on''': Turns the light bulb on to illuminate the experiment.&lt;br /&gt;
* '''light bulb off''': Turns the light bulb off.&lt;br /&gt;
* '''laser on''': Turns the laser on.&lt;br /&gt;
* '''laser off''': Turns the laser off.&lt;br /&gt;
* '''reboot''': Performs a software reset to the micro-controller. Before resetting, the micro-controller stores the current number of oscillations into the flash memory.&lt;br /&gt;
&lt;br /&gt;
Commands to set the specific parameters for the experiment (see section [[#Setting specific parameters for the experiment|Setting specific parameters for the experiment]] for more details). This parameters are stored in the flash memory so that they are not lost in case of a power down situation:&lt;br /&gt;
* '''set maximum position''': Stores the shovel maximum absolute allowed position in cm (where it is mechanically impossible to go further in the forward direction).&lt;br /&gt;
* '''set sphere diameter''': Stores the sphere diameter in cm and measured at the equatorial plane.&lt;br /&gt;
* '''set pendulum length''': Stores the length of the pendulum. See [[#String measurement|String measurement]] for details on how to measure the string length. IMPORTANT: the pendulum length should include the radius of the ball.&lt;br /&gt;
* '''set origin position''': Stores the position of the shovel when located at the origin, i.e., when the shovel is stopped by pressing the micro-switch.&lt;br /&gt;
* '''set vertical position''': Stores the position of the shovel when the pendulum (ball +  string) is perfectly vertical.&lt;br /&gt;
* '''set photodiode position''': Stores the position of the shovel when located at the photo-doide/photo-gate location.&lt;br /&gt;
* '''set catch ball delay''': Stores the delay used to catch (stop) the ball when this one is oscillating with a relatively large amplitude. NOTE: This parameter is no longer used in the recent firmware versions because the micro-controller is now able to automatically catch the ball based on its velocity. For the catch ball to work well, ensure the ball alignment is set as specified in the schematics of [https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly#Order_of_assembly_and_filling_with_sand Order of assembly and filling with sand].&lt;br /&gt;
* '''set pulley diameter''': Stores the diameter of the pulley attached to the step-motor. This value is used to calibrate the displacement of the shovel.&lt;br /&gt;
* '''set display intensity''': Stores the display light intensity. This value should be set so that the numbers are visible/readable on the live video stream when the experiment is running, i.e., when the light bulb is on. 0 is the lowest intensity and 15 is the maximum one.&lt;br /&gt;
* '''set global oscillation counter''': Stores the number of total global oscillations. It is also used to override/reset the counter.&lt;br /&gt;
* '''set ID string''': Sores the experiment identification string (name of the experiment). The string is limited to a maximum of 32 characters.&lt;br /&gt;
&lt;br /&gt;
Current values/parameters for information:&lt;br /&gt;
* '''expected period''': Shows the expected oscillation period in seconds. This value is calculated with the pendulum length and it essential for the proper operation of the experimental apparatus.&lt;br /&gt;
* '''uptime''': Shows the time in seconds since the micro-controller was powered up.&lt;br /&gt;
* '''shovel is at origin''': Indicates if the shovel is located at the origin (yes/no).&lt;br /&gt;
* '''shovel is at photodiode''': Indicates if the shovel is located at the photo-diode/photo-gate (yes/no).&lt;br /&gt;
* '''laser is on''': Indicates if the laser is switched on (yes/no).&lt;br /&gt;
* '''photodiode is on''': Indicates if the photo-diode/photo-gate is lit (conducting state) or dark (non-conduction state). The output is yes/no.&lt;br /&gt;
* '''temperature''': Indicates the temperature in degrees Celsius. The temperature sensor is located in the DB25 box connected to the micro-controller board.&lt;br /&gt;
* '''ERR 1''': Indicates that there is a problem with the laser or photo-diode/photo-gate. See [[#Laser and photo-gate test|Laser and photo-gate test]] for more details and debug procedures.&lt;br /&gt;
* '''ERR 2''': Indicates that there is a problem with the micro-switch. See [http://www.elab.ist.utl.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces#Connections | Connections] to double-check that the micro-switch is properly connected.&lt;br /&gt;
&lt;br /&gt;
====Laser and photo-gate test====&lt;br /&gt;
The micro-controller has a dedicated function (accessible from the console menu) to test the laser and photo-gate simultaneously. This function consist of blinking the laser 5 times with a full period of 100 ms (500 ms total). If the photo-gate correctly detects the laser state the test will be successful. To manually run the laser and photo-gate test, just type the “test laser” command in the console.&lt;br /&gt;
During booting, the micro-controller runs the laser and photo-gate test function to ensure that both components are working properly. If the test fails, the micro-controller returns the “ERR1” error code. This error can be associated with one or more of the following possible problems:&lt;br /&gt;
* Wrong electrical connections: Check section [http://www.elab.ist.utl.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces#Connections | Connections] to ensure that both laser and photo-gate are properly connected to the micro-controller.&lt;br /&gt;
* Laser and photo-gate misalignment: Check if the laser light is properly pointed to the photo-gate structure hole and adjust as described in section [[#Photo-gate and laser alignment|Photo-gate and laser alignment]] if needed.&lt;br /&gt;
* The photo-gate is always closed (conducting): If the ambient light is too intense or if some source of light other than the laser is going through the photo-gate structure hole with enough intensity, it can happen that the photo-gate is always conducting making it impossible to the micro-controller to distinguish between laser ON and OFF states. In this case, the solution is to reduce the ambient light or change the experiment orientation so that the photo-gate receives less light.&lt;br /&gt;
[[File:Laser focus.png |thumb| Procedure to focus the laser beam.|right|border|164px]]&lt;br /&gt;
* Unfocused laser: If the laser is not properly focused, the light intensity may not be sufficient to close the photo-gate. The laser can be focused by slightly rotating its lens (to one side or the other): rotate until the red dot is the smallest as possible (bellow 1mm) at a distance of ~150mm. To rotate the lens it is necessary to remove the laser from its support. The laser is fixed by pressure only and, in some cases, with a drop of glue or polish nail. IMPORTANT: Do not fully unscrew the lens from the body as it will result in damaging the laser. '''Never hold laser part A by the small printed circuit board.'''&lt;br /&gt;
&lt;br /&gt;
After trying to correct the possible source of errors, re-run the test to check if the problem is solved.&lt;br /&gt;
&lt;br /&gt;
====Setting specific parameters for the experiment====&lt;br /&gt;
Some of the settable parameters are essential for the correct and safe operation of the launcher and overall experiment. This subsection describes how to measure and set each one of the parameters.&lt;br /&gt;
The following settable parameters need to be measured with the micro-controller turned off (powered off). These parameters are:&lt;br /&gt;
* '''maximum position''': The shovel maximum position is measured by slowly displacing the shovel with the hand towards the end of the sliding structure (when the slider is fully extended). Once the shovel reaches the end position (cannot move further) record its absolute position by reading the value at the scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:[[File:maximum_position.png|x100px|Maximum position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''vertical position''': This position is obtained when the pendulum (ball +  string) is in the perfectly vertical position. For that, slowly move the shovel in the backwards direction (towards the origin or micro-switch) until it has passed the vertical pendulum position. Wait for the ball to stop totally. Once the ball is fully stopped, approach the shovel in the direction of the ball until it touches the ball but without displacing it. Record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:[[File:vertical_position.png|x100px|Vertical position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the above parameters have been measured, turn on the micro-controller by powering on the Raspberry Pi. During boot, the micro-controller performs some initial tests.&lt;br /&gt;
Allow some time until those tests are finished before trying to send commands to the controller.&lt;br /&gt;
In the meantime, set-up the serial console connection to receive messages from the controller.&lt;br /&gt;
Once the controller is sending its identification string or an error code, the controller finished to boot and we can now set the specific parameters for the experiment.&lt;br /&gt;
For that, use the commands described above. Here follows one example:&lt;br /&gt;
    set maximum position 47.7&lt;br /&gt;
If the command was sent and interpreted successfully, the micro-controller should reply in the following way:&lt;br /&gt;
:[[File:return_set_maximum_position.png|x100px|Return maximum position]]&lt;br /&gt;
&lt;br /&gt;
Perform the same for the vertical position.&lt;br /&gt;
&lt;br /&gt;
* '''sphere diameter''': The sphere diameter should be measured at the ball equatorial plane where the laser points on the ball. If not mentioned or impossible to measure, consider 8 cm, which should be close enough to the usually used spheres. This measurement is mainly used for the determination of the pendulum speed at the laser location. Once the sphere diameter has been measured, store the value in the micro-controller flash by using the command &amp;quot;set sphere diameter&amp;quot;. Consider to have ''multiple equatorial readings'' in different positions and take their average value because the sphere is most likely an ellipsoid!  &lt;br /&gt;
:[[File:sphere_diameter_measurement_crop.png|x200px|Sphere diameter measurement]]&lt;br /&gt;
&lt;br /&gt;
* '''pendulum length''': The procedure to measure the string is described in [[#String measurement|String measurement]]. Then, the radius of the sphere/ball (in the vertical direction, i.e., along the string direction) should be added to the string length, resulting in the pendulum length. The unit of length for this quantity is meter (unlike the other ones which is centimeter). Once the pendulum length has been measured, store the value in the micro-controller flash by using the command &amp;quot;set pendulum length&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''origin position''': This is the location of the shovel when it is stopped by the micro-switch (see figure below for illustration). To measure this position:&lt;br /&gt;
:* send the shovel to the origin using the following command:&lt;br /&gt;
    go to origin 2 2&lt;br /&gt;
:* once the shovel is stopped, record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:* store the measured value (xx.xx) in the micro-controller flash memory using the command &amp;quot;set origin position&amp;quot;.&lt;br /&gt;
:[[File:origin_position.png|x100px|Origin position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''pulley diameter''': The diameter of the pulley that is attached to the step-motor is used to calibrate the displacement of the shovel. A good initial guess can be obtained by measuring its diameter directly, as shown in the figure below. After storing this parameter in the micro-controller a more accurate calibration should be performed, described as the following:&lt;br /&gt;
:* move the shovel to the origin by sending the command &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* use the command &amp;quot;move forward&amp;quot; and request a displacement of 40 cm, e.g., &amp;quot;move forward 40 2 2&amp;quot; (speed of 2 cm/s is slow enough to guarantee a good calibration)&lt;br /&gt;
:* check how much was the actual displacement: reached position - origin position&lt;br /&gt;
:* if the displacement is different then the requested one (by more than 1 mm) scale linearly the pulley diameter to match the actual displacement with the requested one by using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; &lt;br /&gt;
New\;pulley\;diameter = Old \; pulley \; diameter \cdot \frac{Actual \; displacement}{Requested \;displacement}&lt;br /&gt;
&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:* store the new &amp;quot;pulley diameter&amp;quot; in the micro-controller by using the command &amp;quot;set pulley diameter&amp;quot;&lt;br /&gt;
:* resend the shovel back to the origin using the command &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* check the correctness made by using again the command &amp;quot;move forward&amp;quot; and request a displacement of 40 cm. This time the reached position should corresponds to a displacement of 40 cm.&lt;br /&gt;
:[[File:pulley_diameter_measurement_crop.png|x200px|Pulley diameter measurement]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''photodiode position''': The photodiode position corresponds to the location of the shovel when this one is stopped at the photo-diode/photo-gate, see the figure below for illustration. The procedure to obtain this position is the following:&lt;br /&gt;
:* locate the shovel beyond (in the forward direction) the photo-gate and laser location. This can be achieved by using the command &amp;quot;move forward&amp;quot;, as before.&lt;br /&gt;
:* send the shovel to the photodiode using the command &amp;quot;move to photodiode&amp;quot;, e.g., &amp;quot;move to photodiode 2 2&amp;quot; (to use a small speed of 2 cm/s)&lt;br /&gt;
:* once the shove is stopped record the position on the metric scale and store it in the micro-controller using the command &amp;quot;set photodiode position&amp;quot;&lt;br /&gt;
:[[File:photodiode_position.png|x100px|Photodiode_position]]&lt;br /&gt;
&lt;br /&gt;
After setting all parameters, double check if they were properly stored in the micro-controller by checking them on the menu by typing &amp;quot;?&amp;quot; or &amp;quot;help&amp;quot; on the console:&lt;br /&gt;
&lt;br /&gt;
[[File:setting_parameters_check.png|200px|Parameter set]]&lt;br /&gt;
&lt;br /&gt;
===Local gravity access===&lt;br /&gt;
&lt;br /&gt;
Local gravity in big cities normally is well known and documented by national geological entities which encompasses usually the most accurate value. Nevertheless a good comparison can be obtained with spatial harmonics even calculated on-line by a few calculators such as this  [https://www.sensorsone.com/local-gravity-calculator/ Local Gravity Calculator].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Software management| Previous Page (Software management)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Partners| Next Page (Partners)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Calibração | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Calibración  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Calibra%C3%A7%C3%A3o&amp;diff=4336</id>
		<title>Montagem do Pêndulo de Precisão: Calibração</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Calibra%C3%A7%C3%A3o&amp;diff=4336"/>
		<updated>2021-08-26T14:05:00Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Acesso à gravidade local */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibração==&lt;br /&gt;
&lt;br /&gt;
===Medição do cabo===&lt;br /&gt;
[[File:CalibracaoFitaMetrica.jpg||thumb|Calibração rigorosa da fita métrica com o auxílio de um paquímetro para evitar potenciais erros.|right|border|240px]]&lt;br /&gt;
[[File:CableMeasurement.png||thumb|Detalhe da calibração do comprimento do cabo pendular, onde o suporte do fulcro toca a fita métrica para evitar paralaxe. Neste caso particular, 2824 mm.|right|border|240px]]&lt;br /&gt;
A precisão do pêndulo depende fortemente da medição rigorosa do seu comprimento (~2,8 m) com menos de 0,5 mm de erro. De facto, este é o fator que é crucial para alcançar a precisão desejada de 0,02%. Para isso, é sugerida a utilização de uma fita métrica bem calibrada. Se este método for adotado, há que ter especial atenção para evitar erros de paralaxe. Métodos alternativos, como a medição ultrasónica com mira laser, são os melhores. Nesse caso, é utilizado um plano metálico ou de pedra de mármore, colocado tangencialmente ao peso (permitindo-lhe rolar tocando o plano). Com este método, devem ser feitas algumas medições e o seu valor médio será considerado o comprimento de referência do pêndulo.&lt;br /&gt;
&lt;br /&gt;
A recalibração do comprimento do pêndulo deve ser realizada a cada mês de forma a garantir uma precisão razoável.&lt;br /&gt;
&lt;br /&gt;
A primeira figura demonstra como corrigir o erro inicial da fita métrica eliminando cuidadosamente o erro sistemático que resulta do contacto com a esfera. Depois, a fita passa pelo orifício do suporte do fulcro até chegar à superfície da bola. Devem ser realizadas algumas medições para se obter uma média adequada.&lt;br /&gt;
&lt;br /&gt;
===Plano de oscilação===&lt;br /&gt;
[[File:CalibrationVideoShort.gif||thumb|Correção do alinhamento do lançador após o procedimento de ajuste do plano de oscilação. |right|border]]&lt;br /&gt;
 &lt;br /&gt;
O plano de oscilação tem de ser rigorosamente definido de forma a evitar que, devido a um momento elíptico em vez de plano, ocorram erros de segunda ordem na determinação do período. A força de Coriolis não pode ser evitada mas esta só influenciará significativamente o movimento se este ocorrer por períodos muito longos (&amp;gt;15 min). &lt;br /&gt;
&lt;br /&gt;
De forma a conseguir estabelecer corretamente o plano, qualquer força tangencial durante o lançamento deve ser evitada. Para tal, tem de existir um alinhamento perfeito da pá com o plano de oscilação.&lt;br /&gt;
&lt;br /&gt;
====Paralelismo do piso com os triângulos superior e inferior====&lt;br /&gt;
A primeira calibração consiste em conseguir um paralelismo aproximado entre os triângulos estruturais superior e inferior. Para tal, e estrutura deve ser colocada num piso liso e deve realizar-se um aperto final dos parafusos que confira rigidez à estrutura.&lt;br /&gt;
&lt;br /&gt;
Depois, nivela-se o triângulo superior usando o próprio pêndulo, deixando-o na posição central do triângulo inferior e a ~10-12 cm da face posterior; para uma primeira aproximação, deve ser usado um nivelador de bolha de ar na direção ortogonal do plano oscilatório. Mais tarde, deve realizar-se uma afinação mais fina do pêndulo de acordo com a posição do sensor fotoelétrico. Assim, é garantido que o pêndulo viaja exatamente pelo meio do sensor.&lt;br /&gt;
====Movimento do pêndulo pela excitação no fulcro====&lt;br /&gt;
Depois de posicionar definitivamente a estrutura e de ter o pêndulo em repouso, inicie uma oscilação suave (movimento lento), excitando o pêndulo no fulcro, no topo, a fim de definir o plano de oscilação.&lt;br /&gt;
&lt;br /&gt;
*Em primeiro lugar, assegure que esta oscilação é mais ou menos paralela ao lançador/parede, rodando o suporte do fulcro.&lt;br /&gt;
&lt;br /&gt;
*Com a ajuda de uma lanterna (i) na frente da pá/pêndulo e (ii) colocando um papel branco com uma linha preta vertical central no topo da pá, na origem (iii) ajuste os parafusos de inclinação horizontal do lançador até que a plataforma do lançador esteja perfeitamente alinhada com o plano de oscilação. Isto pode ser verificado facilmente se o centro da sombra do pêndulo não se mover na horizontal e se a sombra do cabo não se desviar da linha preta do papel.&lt;br /&gt;
&lt;br /&gt;
===Consola da interface para o microcontrolador===&lt;br /&gt;
O microcontrolador fornece um menu que permite ao utilizador definir os parâmetros da experiência e executar funções predefinidas para configuração e testes. A interface entre o utilizador e o microcontrolador é realizada através da ligação em série RS-232, com os seguintes parâmetros:&lt;br /&gt;
    • Baud-rate: 115200 bps&lt;br /&gt;
    • Parity: No&lt;br /&gt;
    • Data bits: 8&lt;br /&gt;
    • Stop bits: 1&lt;br /&gt;
Verifique se tem outra aplicação que utiliza o dispositivo correspondente. Pode ter o daemon JAVA a funcionar, impedindo o acesso à porta-série. Em caso afirmativo, este deve ser parado (executando o comando com a bandeira STOP) antes de executar a aplicação de minicom, como no exemplo seguinte (adapte à sua localização):&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
Depois de alguma manutenção onde foi necessário parar este daemon, este deve ser reiniciado através do comando recíproco: &lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
Como exemplo, a consola &amp;quot;minicom&amp;quot; pode ser utilizada para comunicar com o microcontrolador. No RaspberryPi, esta interface pode ser chamada a partir do seguinte comando:&lt;br /&gt;
    minicom -D /dev/ttyS0&lt;br /&gt;
ou&lt;br /&gt;
    minicom -D /dev/ttyAMA0&lt;br /&gt;
O &amp;quot;/dev/ttyS0&amp;quot; ou &amp;quot;/dev/ttyAMA0&amp;quot; representa a localização do dispositivo (microcontrolador). O programa minicom criará uma ligação em série com os parâmetros-padrão que, em princípio, são os mesmos que os mencionados acima. Caso contrário, recorra à página de ajuda do programa minicom (escreva &amp;quot;man minicom&amp;quot;) para ver como definir esses parâmetros. Depois de iniciar o programa, não se esqueça de adicionar uma quebra de linha para que as mensagens enviadas pelo microcontrolador surjam em novas linhas. No minicom, a quebra de linha é ativada/desativada premindo '''Ctrl+a'' seguido de '''a'''. &lt;br /&gt;
Uma vez estabelecida a comunicação (ligação), é possível aceder ao menu do microcontrolador através do envio:&lt;br /&gt;
    ? (question mark followed by an enter hit)&lt;br /&gt;
ou&lt;br /&gt;
    help (“help” followed by an enter hit)&lt;br /&gt;
O output será semelhante ao que é mostrado na figura seguinte:&lt;br /&gt;
&lt;br /&gt;
[[File:dsPic_console_menu.png|700px|Menu da consola da interface para o microcontrolador]]&lt;br /&gt;
&lt;br /&gt;
Cada comando deve ser seguido por uma quebra de linha - &amp;quot;\r&amp;quot; (premir ‘Enter’) para que o microcontrolador processe a cadeia enviada. A tecla ‘Enter’ também limpa o buffer de entrada do microcontrolador, de forma a que também possa ser utilizado para esse fim. As palavras nos comandos são separadas por um único caracter de espaço, exceto para o comando &amp;quot;cfg deltaX[...] N[...]&amp;quot; onde as palavras/inputs são separadas por um único caracter ‘tab’ &amp;quot;\t&amp;quot;. Se o comando enviado for sucessivamente recebido, o microcontrolador responderá devolvendo o comando em maiúsculas. Se o comando for executado sucessivamente, o microcontrolador responderá com um OK.&lt;br /&gt;
&lt;br /&gt;
Os &amp;quot;[ ]&amp;quot; (parêntesis retos) nos comandos definem o intervalo de valores de entrada aceites. A representação numérica destes limites indica o tipo de valor aceite, isto é, inteiro ou flutuante. Se o valor limite contiver uma casa decimal, os valores aceites para esse parâmetro são flutuantes. Se o valor limite não possuir uma casa decimal, os valores aceites são apenas números inteiros. Ver os seguintes exemplos:&lt;br /&gt;
    cfg    deltaX[5:25]    N[10:1000]                                      -&amp;gt;    cfg    15    30&lt;br /&gt;
    set maximum position %lf [40.0 60.0] (cm)                              -&amp;gt;    set maximum position 47.7&lt;br /&gt;
    set catch ball delay %d [1 2000] (ms)                                  -&amp;gt;    set catch ball delay 300&lt;br /&gt;
    set pulley diameter %lf [1.0 4.0] (cm)                                 -&amp;gt;    set pulley diameter 2.356&lt;br /&gt;
    set ID string %s [maximum length of 32 characters]                     -&amp;gt;    set ID string WORLD_PENDULUM_LISBON&lt;br /&gt;
    cur                                                                    -&amp;gt;    cur&lt;br /&gt;
    go to origin speed[1.0:50.0] acceleration[1.0:150.0]                   -&amp;gt;    go to origin 11.5 41.1&lt;br /&gt;
    move forward deltaX[1:50.0] speed[1.0:50.0] acceleration[1.0:150.0]    -&amp;gt;    move forward 4.5 2.2 2.0    &lt;br /&gt;
&lt;br /&gt;
Antes de ligar o microcontrolador, é importante realizar duas medições de posição (máxima e vertical). O procedimento para a medição destas posições é descrito em [[#Definição de parâmetros específicos para a experiência|Definição de parâmetros específicos para a experiência]].&lt;br /&gt;
&lt;br /&gt;
====Descrição do menu da consola (comandos/saídas)====&lt;br /&gt;
Comandos relacionados com o autómato e comunicação com o driver do e-lab (programa Java a correr no RaspberryPi):&lt;br /&gt;
* '''cur''': Pede a configuração atual ao microcontrolador. O microcontrolador responde com o seguinte:&lt;br /&gt;
:[[File:cur_dsPic_return.png|x60px|resposta ao comando cur dsPic]]&lt;br /&gt;
* '''str''': Altera o estado do microcontrolador para STARTED e inicia uma experiência, isto se tiver sido previamente configurado usando um comando &amp;quot;cfg&amp;quot;. Uma vez iniciada a experiência, o microcontrolador emitirá os dados no seguinte formato: 1ª coluna - ordem/nº dos dados, 2ª coluna - período (s), 3ª coluna - g (m/s²), 4ª coluna - velocidade na localização do laser (cm/s), 5ª coluna - temperatura ambiente (ºC). Ver a figura abaixo para ilustração:&lt;br /&gt;
:[[File:str_and_data_dsPic_return.png|x230px|resposta ao comando str dsPic]]&lt;br /&gt;
* '''stp''': Interrompe uma experiência e remete o microcontrolador para o estado STOPED&lt;br /&gt;
* '''rst''': Reinicia o microcontrolador e remete o mesmo para o estado RESET&lt;br /&gt;
* '''ids''': Pede ao microcontrolador para enviar as suas identificações. Por exemplo: IDS WP_LIS STOPED&lt;br /&gt;
* '''cfg''': Envia a configuração para uma nova experiência. Este comando aceita dois parâmetros inteiros: 1º - deslocamento inicial em cm, 2º - número de oscilações&lt;br /&gt;
:[[File:cfg_dsPic_return.png|x60px|resposta ao comando cfg dsPic]]&lt;br /&gt;
&lt;br /&gt;
Comandos para executar funções predefinidas, úteis para calibrações e testes:&lt;br /&gt;
* '''stop ball''': Este comando é utilizado para parar a oscilação da bola. Depois de parar a bola, a pá está na posição de repouso no fotodiodo. &lt;br /&gt;
* '''prepare launch''': Este comando aceita um número inteiro que corresponde ao deslocamento inicial (amplitude máxima) antes de soltar a bola. O comando desloca a pá para a posição pedida e repousa nessa posição.&lt;br /&gt;
* '''launch ball''': Este comando liberta a bola enviando a pá para a origem na sua velocidade máxima.&lt;br /&gt;
* '''test laser''': Esta função é utilizada para testar simultaneamente o laser e o fotodíodo. Em [[#Teste do laser e do sensor fotoelétrico | Teste do laser e do sensor fotoelétrico]] pode encontrar uma descrição mais detalhada deste comando, bem como procedimentos a verificar no caso de um teste falhado. &lt;br /&gt;
* '''go to origin''': Este comando aceita duas entradas: 1º - velocidade em cm/s (duplo) e 2º - aceleração em cm/s² (duplo). Envia a pá para a origem (até chegar ao microinterruptor). &lt;br /&gt;
* '''move forward''': Este comando aceita três entradas: 1º - deslocamento horizontal em cm (duplo), 2º - velocidade em cm/s (duplo) e 3º - aceleração em cm/s² (duplo). Desloca a pá em frente (para longe da origem).&lt;br /&gt;
* '''move backward''': Este comando aceita três entradas: 1º - deslocamento horizontal em cm (duplo), 2º - velocidade em cm/s (duplo) e 3º - aceleração em cm/s² (duplo). Desloca a pá no sentido inverso do comando anterior (em direção à origem).&lt;br /&gt;
* '''move to photodiode''': Este comando aceita duas entradas: 1º - velocidade em cm/s (duplo) e 2º - aceleração em cm/s² (duplo). Envia a pá para o fotodíodo se a pá estiver para além deste, na direção da frente. Se a pá estiver entre o fotodíodo e a origem, o comando envia a pá para a origem (até chegar ao microinterruptor).&lt;br /&gt;
* '''light bulb on''': Acende a lâmpada para iluminar a experiência.&lt;br /&gt;
* '''light bulb off''': Apaga a lâmpada.&lt;br /&gt;
* '''laser on''': Acende o laser.&lt;br /&gt;
* '''laser off''': Apaga o laser.&lt;br /&gt;
* '''reboot''': Executa um reset do software para o microcontrolador. Antes de reiniciar, o microcontrolador armazena o número atual de oscilações na memória flash.&lt;br /&gt;
&lt;br /&gt;
Comandos para definir os parâmetros específicos da experiência (ver secção [[#Definição de parâmetros específicos para a experiência| Definição de parâmetros específicos para a experiência]] para mais detalhes). São guardados na memória flash, para que não se percam no caso de falha de energia:&lt;br /&gt;
* '''set maximum position''': Guarda a posição máxima absoluta permitida da pá em cm (posição que é mecanicamente impossível de ultrapassar na direção da frente).&lt;br /&gt;
* '''set sphere diameter''': Guarda o diâmetro da esfera em cm, medido no plano equatorial.&lt;br /&gt;
* '''set pendulum length''': Guarda o comprimento do pêndulo. Ver [[#Medição do fio| Medição do fio]] para detalhes sobre como medir o comprimento do fio. IMPORTANTE: o comprimento do pêndulo deve incluir o raio da bola.&lt;br /&gt;
* '''set origin position''': Guarda a posição da pá quando localizada na origem, ou seja, quando a pá é parada pressionando o microinterruptor.&lt;br /&gt;
* '''set vertical position''': Guarda a posição da pá quando o pêndulo (bola + corda) está perfeitamente vertical.&lt;br /&gt;
* '''set photodiode position''': Guarda a posição da pá quando localizada no local do fotodíodo.&lt;br /&gt;
* '''set catch ball delay''': Guarda o atraso utilizado para apanhar (parar) a bola quando esta oscila com uma amplitude relativamente grande. NOTA: Este parâmetro já não é utilizado nas versões recentes de firmware porque o microcontrolador já é capaz de apanhar automaticamente a bola com base na sua velocidade. Para que a captura da bola funcione corretamente, assegure-se de que o alinhamento desta é definido como especificado nos esquemas de [http://www.elab.ist.utl.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica#Ordem_de_montagem_e_enchimento_com_areia Ordem da montagem e enchimento com areia].&lt;br /&gt;
* '''set pulley diameter''': Guarda o diâmetro da roldana presa ao motor de passo. Este valor é utilizado para calibrar o deslocamento da pá.&lt;br /&gt;
* '''set display intensity''': Guarda a intensidade luminosa do monitor. Este valor deve ser definido de forma a que os números sejam visíveis/legíveis na transmissão de vídeo quando a experiência está a decorrer, ou seja, quando a lâmpada está ligada. 0 é a intensidade mínima e 15 é a máxima.&lt;br /&gt;
* '''set global oscillation counter''': Guarda o número total de oscilações. Também é utilizado para anular/reiniciar o contador.&lt;br /&gt;
* '''set ID string''': Guarda a cadeia de identificação da experiência (nome da experiência). A cadeia de caracteres é limitada a um máximo de 32 caracteres.&lt;br /&gt;
&lt;br /&gt;
Valores/parâmetros atuais para informação:&lt;br /&gt;
* '''expected period''': Mostra o período de oscilação esperado, em segundos. Este valor é calculado com o comprimento do pêndulo e é essencial para o bom funcionamento do aparelho experimental.&lt;br /&gt;
* '''uptime''': Mostra o tempo, em segundos, desde o momento em que o microcontrolador foi ligado.&lt;br /&gt;
* '''shovel is at origin''': Indica se a pá se encontra na origem (yes/no).&lt;br /&gt;
* '''shovel is at photodiode''': Indica se a pá se encontra no fotodíodo (yes/no)&lt;br /&gt;
* '''laser is on''': Indica se o laser está ligado (yes/no).&lt;br /&gt;
* '''photodiode is on''': Indica se o fotodíodo está acesso (a conduzir) ou apagado (a não conduzir). A saída será, yes/no, respetivamente. &lt;br /&gt;
* '''temperature''': Indica a temperatura em graus Celsius. O sensor de temperatura está localizado na caixa DB25, ligado à placa do microcontrolador.&lt;br /&gt;
* '''ERR 1''': Indica que existe um problema com o laser ou com o sensor fotoelétrico. Ver [[#Teste do laser e do sensor fotoelétrico| Teste do laser e do sensor fotoelétrico]] para mais detalhes e procedimentos de resolução. &lt;br /&gt;
* '''ERR 2''': Indica que existe um problema com o microinterruptor. Ver [http://www.elab.ist.utl.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas#Conex.C3.B5es#Conexões |Conexões] para verificar se o microinterruptor está devidamente ligado.&lt;br /&gt;
&lt;br /&gt;
====Teste do laser e do sensor fotoelétrico====&lt;br /&gt;
O microcontrolador tem uma função dedicada (acessível a partir do menu da consola) para testar simultaneamente o laser e o sensor fotoelétrico. Esta função consiste em piscar o laser 5 vezes com um período completo de 100 ms (500 ms no total). Se o sensor detetar corretamente o estado do laser, o teste será bem sucedido. Para executar manualmente este teste, basta digitar o comando &amp;quot;test laser&amp;quot; na consola. No seu início, o microcontrolador executa a função de teste do laser e do sensor fotoelétrico para assegurar que ambos os componentes estão a funcionar corretamente. Se o teste falhar, o microcontrolador devolve o código de erro &amp;quot;ERR1&amp;quot;. Este erro pode estar associado a um ou mais dos seguintes problemas:&lt;br /&gt;
* Ligações elétricas erradas: verifique a secção [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas#Conex.C3.B5es Conexões] para assegurar que tanto o laser como o sensor estão devidamente ligados ao microcontrolador.&lt;br /&gt;
* Alinhamento incorreto do laser com o sensor: verifique se a luz laser está devidamente apontada para o furo da estrutura do sensor e, se necessário, ajuste como descrito na secção  [[#Alinhamento do laser e sensor fotoelétrico]].&lt;br /&gt;
* O sensor fotoelétrico está em condução permanente: se a luz ambiente for demasiado intensa ou se alguma outra fonte de luz que não o laser estiver a atravessar o orifício da estrutura com intensidade suficiente, pode acontecer que este esteja sempre a conduzir tornando impossível ao microcontrolador distinguir entre os estados ON e OFF do laser. Neste caso, a solução é reduzir a luz ambiente ou mudar a orientação da experiência para que o sensor receba menos luz.&lt;br /&gt;
[[File:Laser focus.png |thumb| Focagem do feixe laser|right|border|164px]]&lt;br /&gt;
* Laser desfocado: se o laser não estiver devidamente focado, a intensidade da luz pode não ser suficiente para ativar o sensor. O laser pode ser focado rodando ligeiramente a sua lente (para um lado ou para o outro): rodar até que o ponto vermelho seja o mais pequeno possível, abaixo de 1mm, a uma distância de ~150mm. Para rodar a lente, é necessário retirar o laser do seu suporte. O laser é fixado apenas por pressão e, em alguns casos, com uma gota de cola ou verniz. IMPORTANTE: Não desaparafuse completamente a lente do corpo, pois isso danificará o laser. '''Nunca segure a ‘Parte A’ do laser pela pequena placa de circuito impresso.'''&lt;br /&gt;
&lt;br /&gt;
Depois de tentar corrigir o erro, volte a executar o teste para verificar se o problema está resolvido.&lt;br /&gt;
&lt;br /&gt;
====Definição de parâmetros específicos para a experiência====&lt;br /&gt;
Alguns dos parâmetros reguláveis são essenciais para o funcionamento correto e seguro do lançador e da experiência na sua globalidade. Esta subsecção descreve como medir e definir cada um dos parâmetros.&lt;br /&gt;
Os seguintes parâmetros reguláveis devem ser medidos com o microcontrolador desligado. Estes parâmetros são:&lt;br /&gt;
* '''maximum position''': A posição máxima da pá é medida deslocando lentamente a pá com a mão para a extremidade da estrutura deslizante (até que o deslizador esteja totalmente estendido). Quando a pá atinge a posição final (quando não se consegue mover mais), registe a sua posição absoluta lendo o valor na escala fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:[[File:maximum_position.png|x100px|Posição máxima]]&lt;br /&gt;
&lt;br /&gt;
* '''vertical position''': Esta posição é obtida quando o pêndulo (bola + corda) está perfeitamente vertical. Para isso, mova lentamente a pá no sentido inverso (em direção à origem ou microinterruptor), até que tenha passado a posição vertical do pêndulo. Espere que a bola pare totalmente. A partir daí, aproxime a pá em direção à bola até tocar na mesma, sem a deslocar. Registe a posição absoluta da pá lendo o valor na escala métrica fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:[[File:vertical_position.png|x100px|Posição vertical]]&lt;br /&gt;
&lt;br /&gt;
Uma vez medidos os parâmetros acima, ligue o microcontrolador, ligando o Raspberry Pi. Durante o arranque, o microcontrolador efetua alguns testes iniciais.&lt;br /&gt;
Antes de tentar enviar comandos para o controlador, aguarde até que estes testes estejam concluídos.&lt;br /&gt;
Entretanto, configure a ligação da consola para receber mensagens do controlador.&lt;br /&gt;
Assim que o controlador estiver a enviar a sua cadeia de identificação ou um código de erro, este termina o arranque e já é possível definir os parâmetros específicos para a experiência.&lt;br /&gt;
&lt;br /&gt;
Para isso, utilize os comandos acima descritos. Segue-se um exemplo:&lt;br /&gt;
    set maximum position 47.7&lt;br /&gt;
Se o comando foi enviado e interpretado com sucesso, o microcontrolador deve responder da seguinte forma:&lt;br /&gt;
:[[File:return_set_maximum_position.png|x100px|Retornar à posição máxima]]&lt;br /&gt;
&lt;br /&gt;
Realize o mesmo procedimento para a posição vertical.&lt;br /&gt;
* '''sphere diameter''': O diâmetro da esfera deve ser medido no plano equatorial da bola, onde o laser aponta para a mesma. Se não for mencionado ou impossível de medir, considere 8 cm, que deve ser uma medida suficientemente próxima das esferas normalmente utilizadas. Esta medição é utilizada principalmente para a determinação da velocidade do pêndulo no local do laser. Uma vez medido o diâmetro da esfera, guarde o valor na memória flash do microcontrolador, utilizando o comando &amp;quot;set sphere diameter&amp;quot;. Realize &amp;quot;múltiplas leituras equatoriais&amp;quot; em diferentes posições e considere o seu valor médio porque a esfera é muito provavelmente uma elipsóide!  &lt;br /&gt;
:[[File:sphere_diameter_measurement_crop.png|x200px|Medição do diâmetro da esfera]]&lt;br /&gt;
&lt;br /&gt;
* '''pendulum length''': O procedimento para medir o fio é descrito em [[#Medição do fio| Medição do fio]]. Depois, o raio da esfera/bola (na direção vertical, ou seja, ao longo da direção do fio) deve ser adicionado ao comprimento da corda, resultando no comprimento do pêndulo. A unidade deste comprimento é o metro (ao contrário das outras que são centimétricas). Uma vez medido o comprimento do pêndulo, guarde o valor na memória flash do microcontrolador, utilizando o comando &amp;quot;set pendulum length&amp;quot;.&lt;br /&gt;
* '''origin position''': Esta é a localização da pá quando esta é parada pelo microinterruptor (ver figura abaixo). Para medir esta posição:&lt;br /&gt;
:* envie a pá para a origem utilizando o seguinte comando:&lt;br /&gt;
    go to origin 2 2&lt;br /&gt;
:* uma vez parada a pá, registe a posição absoluta da pá lendo o valor na escala métrica fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:* guarde o valor medido (xx.xx) na memória flash do microcontrolador, usando o comando &amp;quot;set origin position&amp;quot;.&lt;br /&gt;
:[[File:origin_position.png|x100px|Posição original]]&lt;br /&gt;
&lt;br /&gt;
* '''pulley diameter''': O diâmetro da roldana que está ligada ao motor de passo é utilizado para calibrar o deslocamento da pá. Um bom palpite inicial pode ser obtido medindo diretamente o seu diâmetro, como mostra a figura abaixo. Após guardar este parâmetro no microcontrolador, deve ser efetuada uma calibração mais precisa, descrita abaixo:&lt;br /&gt;
:* mova a pá para a origem utilizando o comando &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* utilize o comando &amp;quot;move forward&amp;quot; pedindo um deslocamento de 40 cm, por exemplo &amp;quot;move forward 40 2 2&amp;quot; (uma velocidade de 2 cm/s é suficientemente lenta para garantir uma boa calibração)&lt;br /&gt;
:* verifique quanto foi o deslocamento real: posição alcançada - posição de origem&lt;br /&gt;
:* se o deslocamento real for diferente do pedido (por mais de 1 mm) escale linearmente o diâmetro da roldana para que estes passem a corresponder. Utilize a fórmula:&lt;br /&gt;
&amp;lt;math&amp;gt; &lt;br /&gt;
New\;pulley\;diameter = Old \; pulley \; diameter \cdot \frac{Actual \; displacement}{Requested \;displacement}&lt;br /&gt;
&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:* guarde o novo &amp;quot;diâmetro da roldana&amp;quot; no microcontrolador utilizando o comando &amp;quot;set pulley diameter&amp;quot;&lt;br /&gt;
:* reenvie a pá para a origem usando o comando &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* verifique a correção feita utilizando novamente o comando &amp;quot;move forward&amp;quot; e pedindo um deslocamento de 40 cm. Desta vez, a posição alcançada deve corresponder a um deslocamento de 40 cm.&lt;br /&gt;
:[[File:pulley_diameter_measurement_crop.png|x200px|Medição do diâmetro da roldana]]&lt;br /&gt;
&lt;br /&gt;
* '''photodiode position''': A posição do fotodíodo corresponde à localização da pá quando esta é parada no fotodíodo, como está ilustrado na figura abaixo. O procedimento para obter esta posição é o seguinte:&lt;br /&gt;
:* posicione a pá para além do fotodíodo e do laser (na direção da frente). Isto pode ser conseguido utilizando o comando &amp;quot;move forward&amp;quot;, como anteriormente.&lt;br /&gt;
:* envie a pá para o fotodíodo usando o comando &amp;quot;move to photodiode&amp;quot;, por exemplo, &amp;quot;move to photodiode 2 2&amp;quot; (de forma a usar uma velocidade pequena de 2 cm/s)&lt;br /&gt;
:* uma vez parada a pá, registe a posição na escala métrica e guarde-a no microcontrolador usando o comando &amp;quot;set photodiode position&amp;quot;&lt;br /&gt;
:[[File:photodiode_position.png|x100px|Posição do fotodíodo]&lt;br /&gt;
&lt;br /&gt;
Após definir todos os parâmetros, verifique se foram devidamente guardados no microcontrolador, escrevendo &amp;quot;?&amp;quot; ou &amp;quot;ajuda&amp;quot; na consola:&lt;br /&gt;
:[[File:setting_parameters_check.png|200px|Set de parâmetros]&lt;br /&gt;
&lt;br /&gt;
===Acesso à gravidade local===&lt;br /&gt;
&lt;br /&gt;
A gravidade local nas grandes cidades é, em geral, bem conhecida e documentada pelas entidades geológicas nacionais, representando, normalmente, o valor mais exato. No entanto, pode realizar-se uma boa comparação recorrendo a harmónicas espaciais calculadas online por algumas calculadoras como esta  [https://www.sensorsone.com/local-gravity-calculator/ Calculadora da Gravidade Local].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Gestão de software | Página anterior (Gestão de Software)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Parceiros | Página seguinte (Parceiros)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Calibration | Versão em Inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Calibración  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Calibra%C3%A7%C3%A3o&amp;diff=4335</id>
		<title>Montagem do Pêndulo de Precisão: Calibração</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Calibra%C3%A7%C3%A3o&amp;diff=4335"/>
		<updated>2021-08-26T14:01:27Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Acesso à gravidade local */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibração==&lt;br /&gt;
&lt;br /&gt;
===Medição do cabo===&lt;br /&gt;
[[File:CalibracaoFitaMetrica.jpg||thumb|Calibração rigorosa da fita métrica com o auxílio de um paquímetro para evitar potenciais erros.|right|border|240px]]&lt;br /&gt;
[[File:CableMeasurement.png||thumb|Detalhe da calibração do comprimento do cabo pendular, onde o suporte do fulcro toca a fita métrica para evitar paralaxe. Neste caso particular, 2824 mm.|right|border|240px]]&lt;br /&gt;
A precisão do pêndulo depende fortemente da medição rigorosa do seu comprimento (~2,8 m) com menos de 0,5 mm de erro. De facto, este é o fator que é crucial para alcançar a precisão desejada de 0,02%. Para isso, é sugerida a utilização de uma fita métrica bem calibrada. Se este método for adotado, há que ter especial atenção para evitar erros de paralaxe. Métodos alternativos, como a medição ultrasónica com mira laser, são os melhores. Nesse caso, é utilizado um plano metálico ou de pedra de mármore, colocado tangencialmente ao peso (permitindo-lhe rolar tocando o plano). Com este método, devem ser feitas algumas medições e o seu valor médio será considerado o comprimento de referência do pêndulo.&lt;br /&gt;
&lt;br /&gt;
A recalibração do comprimento do pêndulo deve ser realizada a cada mês de forma a garantir uma precisão razoável.&lt;br /&gt;
&lt;br /&gt;
A primeira figura demonstra como corrigir o erro inicial da fita métrica eliminando cuidadosamente o erro sistemático que resulta do contacto com a esfera. Depois, a fita passa pelo orifício do suporte do fulcro até chegar à superfície da bola. Devem ser realizadas algumas medições para se obter uma média adequada.&lt;br /&gt;
&lt;br /&gt;
===Plano de oscilação===&lt;br /&gt;
[[File:CalibrationVideoShort.gif||thumb|Correção do alinhamento do lançador após o procedimento de ajuste do plano de oscilação. |right|border]]&lt;br /&gt;
 &lt;br /&gt;
O plano de oscilação tem de ser rigorosamente definido de forma a evitar que, devido a um momento elíptico em vez de plano, ocorram erros de segunda ordem na determinação do período. A força de Coriolis não pode ser evitada mas esta só influenciará significativamente o movimento se este ocorrer por períodos muito longos (&amp;gt;15 min). &lt;br /&gt;
&lt;br /&gt;
De forma a conseguir estabelecer corretamente o plano, qualquer força tangencial durante o lançamento deve ser evitada. Para tal, tem de existir um alinhamento perfeito da pá com o plano de oscilação.&lt;br /&gt;
&lt;br /&gt;
====Paralelismo do piso com os triângulos superior e inferior====&lt;br /&gt;
A primeira calibração consiste em conseguir um paralelismo aproximado entre os triângulos estruturais superior e inferior. Para tal, e estrutura deve ser colocada num piso liso e deve realizar-se um aperto final dos parafusos que confira rigidez à estrutura.&lt;br /&gt;
&lt;br /&gt;
Depois, nivela-se o triângulo superior usando o próprio pêndulo, deixando-o na posição central do triângulo inferior e a ~10-12 cm da face posterior; para uma primeira aproximação, deve ser usado um nivelador de bolha de ar na direção ortogonal do plano oscilatório. Mais tarde, deve realizar-se uma afinação mais fina do pêndulo de acordo com a posição do sensor fotoelétrico. Assim, é garantido que o pêndulo viaja exatamente pelo meio do sensor.&lt;br /&gt;
====Movimento do pêndulo pela excitação no fulcro====&lt;br /&gt;
Depois de posicionar definitivamente a estrutura e de ter o pêndulo em repouso, inicie uma oscilação suave (movimento lento), excitando o pêndulo no fulcro, no topo, a fim de definir o plano de oscilação.&lt;br /&gt;
&lt;br /&gt;
*Em primeiro lugar, assegure que esta oscilação é mais ou menos paralela ao lançador/parede, rodando o suporte do fulcro.&lt;br /&gt;
&lt;br /&gt;
*Com a ajuda de uma lanterna (i) na frente da pá/pêndulo e (ii) colocando um papel branco com uma linha preta vertical central no topo da pá, na origem (iii) ajuste os parafusos de inclinação horizontal do lançador até que a plataforma do lançador esteja perfeitamente alinhada com o plano de oscilação. Isto pode ser verificado facilmente se o centro da sombra do pêndulo não se mover na horizontal e se a sombra do cabo não se desviar da linha preta do papel.&lt;br /&gt;
&lt;br /&gt;
===Consola da interface para o microcontrolador===&lt;br /&gt;
O microcontrolador fornece um menu que permite ao utilizador definir os parâmetros da experiência e executar funções predefinidas para configuração e testes. A interface entre o utilizador e o microcontrolador é realizada através da ligação em série RS-232, com os seguintes parâmetros:&lt;br /&gt;
    • Baud-rate: 115200 bps&lt;br /&gt;
    • Parity: No&lt;br /&gt;
    • Data bits: 8&lt;br /&gt;
    • Stop bits: 1&lt;br /&gt;
Verifique se tem outra aplicação que utiliza o dispositivo correspondente. Pode ter o daemon JAVA a funcionar, impedindo o acesso à porta-série. Em caso afirmativo, este deve ser parado (executando o comando com a bandeira STOP) antes de executar a aplicação de minicom, como no exemplo seguinte (adapte à sua localização):&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
Depois de alguma manutenção onde foi necessário parar este daemon, este deve ser reiniciado através do comando recíproco: &lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
Como exemplo, a consola &amp;quot;minicom&amp;quot; pode ser utilizada para comunicar com o microcontrolador. No RaspberryPi, esta interface pode ser chamada a partir do seguinte comando:&lt;br /&gt;
    minicom -D /dev/ttyS0&lt;br /&gt;
ou&lt;br /&gt;
    minicom -D /dev/ttyAMA0&lt;br /&gt;
O &amp;quot;/dev/ttyS0&amp;quot; ou &amp;quot;/dev/ttyAMA0&amp;quot; representa a localização do dispositivo (microcontrolador). O programa minicom criará uma ligação em série com os parâmetros-padrão que, em princípio, são os mesmos que os mencionados acima. Caso contrário, recorra à página de ajuda do programa minicom (escreva &amp;quot;man minicom&amp;quot;) para ver como definir esses parâmetros. Depois de iniciar o programa, não se esqueça de adicionar uma quebra de linha para que as mensagens enviadas pelo microcontrolador surjam em novas linhas. No minicom, a quebra de linha é ativada/desativada premindo '''Ctrl+a'' seguido de '''a'''. &lt;br /&gt;
Uma vez estabelecida a comunicação (ligação), é possível aceder ao menu do microcontrolador através do envio:&lt;br /&gt;
    ? (question mark followed by an enter hit)&lt;br /&gt;
ou&lt;br /&gt;
    help (“help” followed by an enter hit)&lt;br /&gt;
O output será semelhante ao que é mostrado na figura seguinte:&lt;br /&gt;
&lt;br /&gt;
[[File:dsPic_console_menu.png|700px|Menu da consola da interface para o microcontrolador]]&lt;br /&gt;
&lt;br /&gt;
Cada comando deve ser seguido por uma quebra de linha - &amp;quot;\r&amp;quot; (premir ‘Enter’) para que o microcontrolador processe a cadeia enviada. A tecla ‘Enter’ também limpa o buffer de entrada do microcontrolador, de forma a que também possa ser utilizado para esse fim. As palavras nos comandos são separadas por um único caracter de espaço, exceto para o comando &amp;quot;cfg deltaX[...] N[...]&amp;quot; onde as palavras/inputs são separadas por um único caracter ‘tab’ &amp;quot;\t&amp;quot;. Se o comando enviado for sucessivamente recebido, o microcontrolador responderá devolvendo o comando em maiúsculas. Se o comando for executado sucessivamente, o microcontrolador responderá com um OK.&lt;br /&gt;
&lt;br /&gt;
Os &amp;quot;[ ]&amp;quot; (parêntesis retos) nos comandos definem o intervalo de valores de entrada aceites. A representação numérica destes limites indica o tipo de valor aceite, isto é, inteiro ou flutuante. Se o valor limite contiver uma casa decimal, os valores aceites para esse parâmetro são flutuantes. Se o valor limite não possuir uma casa decimal, os valores aceites são apenas números inteiros. Ver os seguintes exemplos:&lt;br /&gt;
    cfg    deltaX[5:25]    N[10:1000]                                      -&amp;gt;    cfg    15    30&lt;br /&gt;
    set maximum position %lf [40.0 60.0] (cm)                              -&amp;gt;    set maximum position 47.7&lt;br /&gt;
    set catch ball delay %d [1 2000] (ms)                                  -&amp;gt;    set catch ball delay 300&lt;br /&gt;
    set pulley diameter %lf [1.0 4.0] (cm)                                 -&amp;gt;    set pulley diameter 2.356&lt;br /&gt;
    set ID string %s [maximum length of 32 characters]                     -&amp;gt;    set ID string WORLD_PENDULUM_LISBON&lt;br /&gt;
    cur                                                                    -&amp;gt;    cur&lt;br /&gt;
    go to origin speed[1.0:50.0] acceleration[1.0:150.0]                   -&amp;gt;    go to origin 11.5 41.1&lt;br /&gt;
    move forward deltaX[1:50.0] speed[1.0:50.0] acceleration[1.0:150.0]    -&amp;gt;    move forward 4.5 2.2 2.0    &lt;br /&gt;
&lt;br /&gt;
Antes de ligar o microcontrolador, é importante realizar duas medições de posição (máxima e vertical). O procedimento para a medição destas posições é descrito em [[#Definição de parâmetros específicos para a experiência|Definição de parâmetros específicos para a experiência]].&lt;br /&gt;
&lt;br /&gt;
====Descrição do menu da consola (comandos/saídas)====&lt;br /&gt;
Comandos relacionados com o autómato e comunicação com o driver do e-lab (programa Java a correr no RaspberryPi):&lt;br /&gt;
* '''cur''': Pede a configuração atual ao microcontrolador. O microcontrolador responde com o seguinte:&lt;br /&gt;
:[[File:cur_dsPic_return.png|x60px|resposta ao comando cur dsPic]]&lt;br /&gt;
* '''str''': Altera o estado do microcontrolador para STARTED e inicia uma experiência, isto se tiver sido previamente configurado usando um comando &amp;quot;cfg&amp;quot;. Uma vez iniciada a experiência, o microcontrolador emitirá os dados no seguinte formato: 1ª coluna - ordem/nº dos dados, 2ª coluna - período (s), 3ª coluna - g (m/s²), 4ª coluna - velocidade na localização do laser (cm/s), 5ª coluna - temperatura ambiente (ºC). Ver a figura abaixo para ilustração:&lt;br /&gt;
:[[File:str_and_data_dsPic_return.png|x230px|resposta ao comando str dsPic]]&lt;br /&gt;
* '''stp''': Interrompe uma experiência e remete o microcontrolador para o estado STOPED&lt;br /&gt;
* '''rst''': Reinicia o microcontrolador e remete o mesmo para o estado RESET&lt;br /&gt;
* '''ids''': Pede ao microcontrolador para enviar as suas identificações. Por exemplo: IDS WP_LIS STOPED&lt;br /&gt;
* '''cfg''': Envia a configuração para uma nova experiência. Este comando aceita dois parâmetros inteiros: 1º - deslocamento inicial em cm, 2º - número de oscilações&lt;br /&gt;
:[[File:cfg_dsPic_return.png|x60px|resposta ao comando cfg dsPic]]&lt;br /&gt;
&lt;br /&gt;
Comandos para executar funções predefinidas, úteis para calibrações e testes:&lt;br /&gt;
* '''stop ball''': Este comando é utilizado para parar a oscilação da bola. Depois de parar a bola, a pá está na posição de repouso no fotodiodo. &lt;br /&gt;
* '''prepare launch''': Este comando aceita um número inteiro que corresponde ao deslocamento inicial (amplitude máxima) antes de soltar a bola. O comando desloca a pá para a posição pedida e repousa nessa posição.&lt;br /&gt;
* '''launch ball''': Este comando liberta a bola enviando a pá para a origem na sua velocidade máxima.&lt;br /&gt;
* '''test laser''': Esta função é utilizada para testar simultaneamente o laser e o fotodíodo. Em [[#Teste do laser e do sensor fotoelétrico | Teste do laser e do sensor fotoelétrico]] pode encontrar uma descrição mais detalhada deste comando, bem como procedimentos a verificar no caso de um teste falhado. &lt;br /&gt;
* '''go to origin''': Este comando aceita duas entradas: 1º - velocidade em cm/s (duplo) e 2º - aceleração em cm/s² (duplo). Envia a pá para a origem (até chegar ao microinterruptor). &lt;br /&gt;
* '''move forward''': Este comando aceita três entradas: 1º - deslocamento horizontal em cm (duplo), 2º - velocidade em cm/s (duplo) e 3º - aceleração em cm/s² (duplo). Desloca a pá em frente (para longe da origem).&lt;br /&gt;
* '''move backward''': Este comando aceita três entradas: 1º - deslocamento horizontal em cm (duplo), 2º - velocidade em cm/s (duplo) e 3º - aceleração em cm/s² (duplo). Desloca a pá no sentido inverso do comando anterior (em direção à origem).&lt;br /&gt;
* '''move to photodiode''': Este comando aceita duas entradas: 1º - velocidade em cm/s (duplo) e 2º - aceleração em cm/s² (duplo). Envia a pá para o fotodíodo se a pá estiver para além deste, na direção da frente. Se a pá estiver entre o fotodíodo e a origem, o comando envia a pá para a origem (até chegar ao microinterruptor).&lt;br /&gt;
* '''light bulb on''': Acende a lâmpada para iluminar a experiência.&lt;br /&gt;
* '''light bulb off''': Apaga a lâmpada.&lt;br /&gt;
* '''laser on''': Acende o laser.&lt;br /&gt;
* '''laser off''': Apaga o laser.&lt;br /&gt;
* '''reboot''': Executa um reset do software para o microcontrolador. Antes de reiniciar, o microcontrolador armazena o número atual de oscilações na memória flash.&lt;br /&gt;
&lt;br /&gt;
Comandos para definir os parâmetros específicos da experiência (ver secção [[#Definição de parâmetros específicos para a experiência| Definição de parâmetros específicos para a experiência]] para mais detalhes). São guardados na memória flash, para que não se percam no caso de falha de energia:&lt;br /&gt;
* '''set maximum position''': Guarda a posição máxima absoluta permitida da pá em cm (posição que é mecanicamente impossível de ultrapassar na direção da frente).&lt;br /&gt;
* '''set sphere diameter''': Guarda o diâmetro da esfera em cm, medido no plano equatorial.&lt;br /&gt;
* '''set pendulum length''': Guarda o comprimento do pêndulo. Ver [[#Medição do fio| Medição do fio]] para detalhes sobre como medir o comprimento do fio. IMPORTANTE: o comprimento do pêndulo deve incluir o raio da bola.&lt;br /&gt;
* '''set origin position''': Guarda a posição da pá quando localizada na origem, ou seja, quando a pá é parada pressionando o microinterruptor.&lt;br /&gt;
* '''set vertical position''': Guarda a posição da pá quando o pêndulo (bola + corda) está perfeitamente vertical.&lt;br /&gt;
* '''set photodiode position''': Guarda a posição da pá quando localizada no local do fotodíodo.&lt;br /&gt;
* '''set catch ball delay''': Guarda o atraso utilizado para apanhar (parar) a bola quando esta oscila com uma amplitude relativamente grande. NOTA: Este parâmetro já não é utilizado nas versões recentes de firmware porque o microcontrolador já é capaz de apanhar automaticamente a bola com base na sua velocidade. Para que a captura da bola funcione corretamente, assegure-se de que o alinhamento desta é definido como especificado nos esquemas de [http://www.elab.ist.utl.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica#Ordem_de_montagem_e_enchimento_com_areia Ordem da montagem e enchimento com areia].&lt;br /&gt;
* '''set pulley diameter''': Guarda o diâmetro da roldana presa ao motor de passo. Este valor é utilizado para calibrar o deslocamento da pá.&lt;br /&gt;
* '''set display intensity''': Guarda a intensidade luminosa do monitor. Este valor deve ser definido de forma a que os números sejam visíveis/legíveis na transmissão de vídeo quando a experiência está a decorrer, ou seja, quando a lâmpada está ligada. 0 é a intensidade mínima e 15 é a máxima.&lt;br /&gt;
* '''set global oscillation counter''': Guarda o número total de oscilações. Também é utilizado para anular/reiniciar o contador.&lt;br /&gt;
* '''set ID string''': Guarda a cadeia de identificação da experiência (nome da experiência). A cadeia de caracteres é limitada a um máximo de 32 caracteres.&lt;br /&gt;
&lt;br /&gt;
Valores/parâmetros atuais para informação:&lt;br /&gt;
* '''expected period''': Mostra o período de oscilação esperado, em segundos. Este valor é calculado com o comprimento do pêndulo e é essencial para o bom funcionamento do aparelho experimental.&lt;br /&gt;
* '''uptime''': Mostra o tempo, em segundos, desde o momento em que o microcontrolador foi ligado.&lt;br /&gt;
* '''shovel is at origin''': Indica se a pá se encontra na origem (yes/no).&lt;br /&gt;
* '''shovel is at photodiode''': Indica se a pá se encontra no fotodíodo (yes/no)&lt;br /&gt;
* '''laser is on''': Indica se o laser está ligado (yes/no).&lt;br /&gt;
* '''photodiode is on''': Indica se o fotodíodo está acesso (a conduzir) ou apagado (a não conduzir). A saída será, yes/no, respetivamente. &lt;br /&gt;
* '''temperature''': Indica a temperatura em graus Celsius. O sensor de temperatura está localizado na caixa DB25, ligado à placa do microcontrolador.&lt;br /&gt;
* '''ERR 1''': Indica que existe um problema com o laser ou com o sensor fotoelétrico. Ver [[#Teste do laser e do sensor fotoelétrico| Teste do laser e do sensor fotoelétrico]] para mais detalhes e procedimentos de resolução. &lt;br /&gt;
* '''ERR 2''': Indica que existe um problema com o microinterruptor. Ver [http://www.elab.ist.utl.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas#Conex.C3.B5es#Conexões |Conexões] para verificar se o microinterruptor está devidamente ligado.&lt;br /&gt;
&lt;br /&gt;
====Teste do laser e do sensor fotoelétrico====&lt;br /&gt;
O microcontrolador tem uma função dedicada (acessível a partir do menu da consola) para testar simultaneamente o laser e o sensor fotoelétrico. Esta função consiste em piscar o laser 5 vezes com um período completo de 100 ms (500 ms no total). Se o sensor detetar corretamente o estado do laser, o teste será bem sucedido. Para executar manualmente este teste, basta digitar o comando &amp;quot;test laser&amp;quot; na consola. No seu início, o microcontrolador executa a função de teste do laser e do sensor fotoelétrico para assegurar que ambos os componentes estão a funcionar corretamente. Se o teste falhar, o microcontrolador devolve o código de erro &amp;quot;ERR1&amp;quot;. Este erro pode estar associado a um ou mais dos seguintes problemas:&lt;br /&gt;
* Ligações elétricas erradas: verifique a secção [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas#Conex.C3.B5es Conexões] para assegurar que tanto o laser como o sensor estão devidamente ligados ao microcontrolador.&lt;br /&gt;
* Alinhamento incorreto do laser com o sensor: verifique se a luz laser está devidamente apontada para o furo da estrutura do sensor e, se necessário, ajuste como descrito na secção  [[#Alinhamento do laser e sensor fotoelétrico]].&lt;br /&gt;
* O sensor fotoelétrico está em condução permanente: se a luz ambiente for demasiado intensa ou se alguma outra fonte de luz que não o laser estiver a atravessar o orifício da estrutura com intensidade suficiente, pode acontecer que este esteja sempre a conduzir tornando impossível ao microcontrolador distinguir entre os estados ON e OFF do laser. Neste caso, a solução é reduzir a luz ambiente ou mudar a orientação da experiência para que o sensor receba menos luz.&lt;br /&gt;
[[File:Laser focus.png |thumb| Focagem do feixe laser|right|border|164px]]&lt;br /&gt;
* Laser desfocado: se o laser não estiver devidamente focado, a intensidade da luz pode não ser suficiente para ativar o sensor. O laser pode ser focado rodando ligeiramente a sua lente (para um lado ou para o outro): rodar até que o ponto vermelho seja o mais pequeno possível, abaixo de 1mm, a uma distância de ~150mm. Para rodar a lente, é necessário retirar o laser do seu suporte. O laser é fixado apenas por pressão e, em alguns casos, com uma gota de cola ou verniz. IMPORTANTE: Não desaparafuse completamente a lente do corpo, pois isso danificará o laser. '''Nunca segure a ‘Parte A’ do laser pela pequena placa de circuito impresso.'''&lt;br /&gt;
&lt;br /&gt;
Depois de tentar corrigir o erro, volte a executar o teste para verificar se o problema está resolvido.&lt;br /&gt;
&lt;br /&gt;
====Definição de parâmetros específicos para a experiência====&lt;br /&gt;
Alguns dos parâmetros reguláveis são essenciais para o funcionamento correto e seguro do lançador e da experiência na sua globalidade. Esta subsecção descreve como medir e definir cada um dos parâmetros.&lt;br /&gt;
Os seguintes parâmetros reguláveis devem ser medidos com o microcontrolador desligado. Estes parâmetros são:&lt;br /&gt;
* '''maximum position''': A posição máxima da pá é medida deslocando lentamente a pá com a mão para a extremidade da estrutura deslizante (até que o deslizador esteja totalmente estendido). Quando a pá atinge a posição final (quando não se consegue mover mais), registe a sua posição absoluta lendo o valor na escala fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:[[File:maximum_position.png|x100px|Posição máxima]]&lt;br /&gt;
&lt;br /&gt;
* '''vertical position''': Esta posição é obtida quando o pêndulo (bola + corda) está perfeitamente vertical. Para isso, mova lentamente a pá no sentido inverso (em direção à origem ou microinterruptor), até que tenha passado a posição vertical do pêndulo. Espere que a bola pare totalmente. A partir daí, aproxime a pá em direção à bola até tocar na mesma, sem a deslocar. Registe a posição absoluta da pá lendo o valor na escala métrica fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:[[File:vertical_position.png|x100px|Posição vertical]]&lt;br /&gt;
&lt;br /&gt;
Uma vez medidos os parâmetros acima, ligue o microcontrolador, ligando o Raspberry Pi. Durante o arranque, o microcontrolador efetua alguns testes iniciais.&lt;br /&gt;
Antes de tentar enviar comandos para o controlador, aguarde até que estes testes estejam concluídos.&lt;br /&gt;
Entretanto, configure a ligação da consola para receber mensagens do controlador.&lt;br /&gt;
Assim que o controlador estiver a enviar a sua cadeia de identificação ou um código de erro, este termina o arranque e já é possível definir os parâmetros específicos para a experiência.&lt;br /&gt;
&lt;br /&gt;
Para isso, utilize os comandos acima descritos. Segue-se um exemplo:&lt;br /&gt;
    set maximum position 47.7&lt;br /&gt;
Se o comando foi enviado e interpretado com sucesso, o microcontrolador deve responder da seguinte forma:&lt;br /&gt;
:[[File:return_set_maximum_position.png|x100px|Retornar à posição máxima]]&lt;br /&gt;
&lt;br /&gt;
Realize o mesmo procedimento para a posição vertical.&lt;br /&gt;
* '''sphere diameter''': O diâmetro da esfera deve ser medido no plano equatorial da bola, onde o laser aponta para a mesma. Se não for mencionado ou impossível de medir, considere 8 cm, que deve ser uma medida suficientemente próxima das esferas normalmente utilizadas. Esta medição é utilizada principalmente para a determinação da velocidade do pêndulo no local do laser. Uma vez medido o diâmetro da esfera, guarde o valor na memória flash do microcontrolador, utilizando o comando &amp;quot;set sphere diameter&amp;quot;. Realize &amp;quot;múltiplas leituras equatoriais&amp;quot; em diferentes posições e considere o seu valor médio porque a esfera é muito provavelmente uma elipsóide!  &lt;br /&gt;
:[[File:sphere_diameter_measurement_crop.png|x200px|Medição do diâmetro da esfera]]&lt;br /&gt;
&lt;br /&gt;
* '''pendulum length''': O procedimento para medir o fio é descrito em [[#Medição do fio| Medição do fio]]. Depois, o raio da esfera/bola (na direção vertical, ou seja, ao longo da direção do fio) deve ser adicionado ao comprimento da corda, resultando no comprimento do pêndulo. A unidade deste comprimento é o metro (ao contrário das outras que são centimétricas). Uma vez medido o comprimento do pêndulo, guarde o valor na memória flash do microcontrolador, utilizando o comando &amp;quot;set pendulum length&amp;quot;.&lt;br /&gt;
* '''origin position''': Esta é a localização da pá quando esta é parada pelo microinterruptor (ver figura abaixo). Para medir esta posição:&lt;br /&gt;
:* envie a pá para a origem utilizando o seguinte comando:&lt;br /&gt;
    go to origin 2 2&lt;br /&gt;
:* uma vez parada a pá, registe a posição absoluta da pá lendo o valor na escala métrica fixada no lançador, com a ajuda do indicador acoplado à pá.&lt;br /&gt;
:* guarde o valor medido (xx.xx) na memória flash do microcontrolador, usando o comando &amp;quot;set origin position&amp;quot;.&lt;br /&gt;
:[[File:origin_position.png|x100px|Posição original]]&lt;br /&gt;
&lt;br /&gt;
* '''pulley diameter''': O diâmetro da roldana que está ligada ao motor de passo é utilizado para calibrar o deslocamento da pá. Um bom palpite inicial pode ser obtido medindo diretamente o seu diâmetro, como mostra a figura abaixo. Após guardar este parâmetro no microcontrolador, deve ser efetuada uma calibração mais precisa, descrita abaixo:&lt;br /&gt;
:* mova a pá para a origem utilizando o comando &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* utilize o comando &amp;quot;move forward&amp;quot; pedindo um deslocamento de 40 cm, por exemplo &amp;quot;move forward 40 2 2&amp;quot; (uma velocidade de 2 cm/s é suficientemente lenta para garantir uma boa calibração)&lt;br /&gt;
:* verifique quanto foi o deslocamento real: posição alcançada - posição de origem&lt;br /&gt;
:* se o deslocamento real for diferente do pedido (por mais de 1 mm) escale linearmente o diâmetro da roldana para que estes passem a corresponder. Utilize a fórmula:&lt;br /&gt;
&amp;lt;math&amp;gt; &lt;br /&gt;
New\;pulley\;diameter = Old \; pulley \; diameter \cdot \frac{Actual \; displacement}{Requested \;displacement}&lt;br /&gt;
&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:* guarde o novo &amp;quot;diâmetro da roldana&amp;quot; no microcontrolador utilizando o comando &amp;quot;set pulley diameter&amp;quot;&lt;br /&gt;
:* reenvie a pá para a origem usando o comando &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* verifique a correção feita utilizando novamente o comando &amp;quot;move forward&amp;quot; e pedindo um deslocamento de 40 cm. Desta vez, a posição alcançada deve corresponder a um deslocamento de 40 cm.&lt;br /&gt;
:[[File:pulley_diameter_measurement_crop.png|x200px|Medição do diâmetro da roldana]]&lt;br /&gt;
&lt;br /&gt;
* '''photodiode position''': A posição do fotodíodo corresponde à localização da pá quando esta é parada no fotodíodo, como está ilustrado na figura abaixo. O procedimento para obter esta posição é o seguinte:&lt;br /&gt;
:* posicione a pá para além do fotodíodo e do laser (na direção da frente). Isto pode ser conseguido utilizando o comando &amp;quot;move forward&amp;quot;, como anteriormente.&lt;br /&gt;
:* envie a pá para o fotodíodo usando o comando &amp;quot;move to photodiode&amp;quot;, por exemplo, &amp;quot;move to photodiode 2 2&amp;quot; (de forma a usar uma velocidade pequena de 2 cm/s)&lt;br /&gt;
:* uma vez parada a pá, registe a posição na escala métrica e guarde-a no microcontrolador usando o comando &amp;quot;set photodiode position&amp;quot;&lt;br /&gt;
:[[File:photodiode_position.png|x100px|Posição do fotodíodo]&lt;br /&gt;
&lt;br /&gt;
Após definir todos os parâmetros, verifique se foram devidamente guardados no microcontrolador, escrevendo &amp;quot;?&amp;quot; ou &amp;quot;ajuda&amp;quot; na consola:&lt;br /&gt;
:[[File:setting_parameters_check.png|200px|Set de parâmetros]&lt;br /&gt;
&lt;br /&gt;
===Acesso à gravidade local===&lt;br /&gt;
&lt;br /&gt;
A gravidade local nas grandes cidades é, em geral, bem conhecida e documentada pelas entidades geológicas nacionais, representando, normalmente, o valor mais exato. No entanto, pode realizar-se uma boa comparação recorrendo a harmónicas espaciais calculadas online por algumas calculadoras como esta  [https://www.sensorsone.com/local-gravity-calculator/ Calculadora da Gravidade Local].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Gestão de software | Página anterior (Gestão de Software)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Parceiros | Página seguinte (Parceiros)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Calibration | Versão em Inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Calibración  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Calibration&amp;diff=4334</id>
		<title>Precision Pendulum Assembly: Calibration</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Calibration&amp;diff=4334"/>
		<updated>2021-08-26T14:01:11Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Local gravity access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calibration==&lt;br /&gt;
&lt;br /&gt;
===String measurement===&lt;br /&gt;
[[File:CalibracaoFitaMetrica.jpg||thumb|Measuring tape rigorous calibration with a caliper aid to surpass any offset.|right|border|240px]]&lt;br /&gt;
[[File:CableMeasurement.png||thumb|Detail of the pendulum cable length calibration, where the plateau touch the measuring tape to avoid parallax giving in this particular case 2824 mm.|right|border|240px]]&lt;br /&gt;
The pendulum accuracy depends strongly in its rigorous length measurement (~2,8 m) with less than 0,5 mm. Indeed this is the crucial factor to achieve the desired 0,02% accuracy and for that propose a well-calibrated measuring tape as to be chose. If this method is adopted special care has to be taken to avoid parallax. Alternative methods like ultrasonic measurement with laser targeting are the best, using a metallic or marble stone plane fitted tangential to the weight (allowing it to roll but touching the plane). With this method a few takes shall be done surrounding the ball and their average value will be considered the pendulum reference length. &lt;br /&gt;
&lt;br /&gt;
Recalibration of the length as to be pursuit every month to guarantee a reasonable precision.&lt;br /&gt;
&lt;br /&gt;
In the first figure is shown how to rectify the measuring tape initial offset by careful eliminating the systematic error from the contact with the sphere. Then, the tape passes through the plateau's hole where the fulcrum seats till it reaches the ball surface. Then a few measurements should be taken in order to have a proper average.&lt;br /&gt;
&lt;br /&gt;
===Plane of oscillation===&lt;br /&gt;
[[File:CalibrationVideoShort.gif||thumb|Correctness of the launcher alignment after the procedure to adjust the plane of oscilations.|right|border]]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The plane of oscillation has to be critical defined in order to avoid second order effects on the period determination due to an elliptic moment instead of a planar one. Of course Coriolis force can not be avoided but only for very long runs (&amp;gt;15 min) it will influence significantly the movement.&lt;br /&gt;
&lt;br /&gt;
To have the plane well established any tangential force during the bob's launch as to be avoided. For such, a perfect alignment of the shovel trajectory within the plane of oscilation has to be verified.&lt;br /&gt;
&lt;br /&gt;
====Floor parallelism from top and bottom triangles====&lt;br /&gt;
The first calibration is to provide a coarse parallelism between the upper and lower structural triangles. For that end  the structure as to be laid down in a regular floor and have a final tighten of the screws leading to a rigid armor fixture.&lt;br /&gt;
&lt;br /&gt;
Then, the top triangle has to be leveled by using the bob itself, letting it be in the center position of the lower triangle and at ~10-12 cm from the back; in the orthogonal direction of the oscillatory plane a spirit level has to be used in first approximation and later a fine tuning of the bob has to be refined according to the photo-gate position. It as to be guaranteed that the bob travel exactly by the middle of the photo-gate.&lt;br /&gt;
====Bob movement given by fulcrum excitation====&lt;br /&gt;
After locating the pendulum in it's final place and having the bob at rest, start a gentle swinging (slow movement) by exciting it in the fulcrum at the top in order to define the plane of oscillation. &lt;br /&gt;
&lt;br /&gt;
*First of all assure that this oscillation is roughly parallel to the launcher/wall by rotating the fulcrum's holder.&lt;br /&gt;
&lt;br /&gt;
*With the help of a flashlight (i) in the front of the shovel/bob and (ii) putting a white paper with a vertical centered black line on top of the shovel at the origin (iii) adjust the horizontal tilt screws of the launcher in order to have the launcher platform perfectly aligned with the plane of oscillation. This can be seen easily if the shadow center of the bob do not move horizontally and the cable's shadow do no deviate from the paper's black line.&lt;br /&gt;
&lt;br /&gt;
===Interface console to micro-controller===&lt;br /&gt;
The micro-controller provides a menu that allows the user to set the parameters of the experiment and run predefined functions to allow configuration and testing.&lt;br /&gt;
The interface between user and micro-controller is performed via the RS-232 serial connection with the following parameters:&lt;br /&gt;
    • Baud-rate: 115200 bps&lt;br /&gt;
    • Parity: No&lt;br /&gt;
    • Data bits: 8&lt;br /&gt;
    • Stop bits: 1&lt;br /&gt;
Please be aware if you have another application using the corresponding device. Actually you can have the JAVA daemon running, preventing access to the serial port. In such case it should be stopped (by running the command with the flag STOP) prior to run the minicom application as in the following example (please adapt to your local path):&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
After any maintenance where it was deemed necessary to stop this daemon is has to be restarted by issueing the reciprocal command:&lt;br /&gt;
&lt;br /&gt;
 elab@WP-RAI:~ $ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop&lt;br /&gt;
&lt;br /&gt;
As an example, the “minicom” console interface can be used to communicate with the micro-controller. In the RaspberryPi, this interface can be called from a shell using the following command:&lt;br /&gt;
    minicom -D /dev/ttyS0&lt;br /&gt;
or&lt;br /&gt;
    minicom -D /dev/ttyAMA0&lt;br /&gt;
The “/dev/ttyS0” or &amp;quot;/dev/ttyAMA0&amp;quot; is the device (micro-controller) location. The minicom program will create a serial connection with default parameter which, in principle, are the same as the ones mentioned above. If not, check the help page of the minicom program (type &amp;quot;man minicom&amp;quot;) to see how to set those parameters. After launching the program, be sure to add a line feed so that the messages sent by the micro-controller appear in new lines. In minicom, the line feed is activated/deactivated by pressing '''Ctrl+a''' followed by '''a'''.&lt;br /&gt;
Once the communication (connection) is established, it is possible to access the micro-controller menu by sending:&lt;br /&gt;
    ? (question mark followed by an enter hit)&lt;br /&gt;
or&lt;br /&gt;
    help (“help” followed by an enter hit)&lt;br /&gt;
The output will be similar to the one shown in the following figure:&lt;br /&gt;
&lt;br /&gt;
[[File:dsPic_console_menu.png|700px|Interface console menu to micro-controller]]&lt;br /&gt;
&lt;br /&gt;
Every command should be followed by a carriage return – “\r” (hit enter) so that the micro-controller can process the sent string. Hitting enter also clears the micro-controller input buffer, so it can also be used for that purpose. The words in the commands are separated by one space character only except for the “cfg    deltaX[…]    N[...]” command where the words/inputs are separated by one tab character “\t”. If the sent command is successively received, the micro-controller will reply to the sent command by returning the send command in capital letters. If the command is successively executed the micro-controller will reply with an OK.&lt;br /&gt;
&lt;br /&gt;
The “[ ]” (square brackets) in the commands define the range of accepted input values. The numeric representation of these limits indicate the type of accepted value, i.e., integer or float. If the limit value contains a decimal case, the accepted values for that parameter are float. If the limit value does not contain a decimal case, the accepted values are integer only.&lt;br /&gt;
See the following examples:&lt;br /&gt;
    cfg    deltaX[5:25]    N[10:1000]                                      -&amp;gt;    cfg    15    30&lt;br /&gt;
    set maximum position %lf [40.0 60.0] (cm)                              -&amp;gt;    set maximum position 47.7&lt;br /&gt;
    set catch ball delay %d [1 2000] (ms)                                  -&amp;gt;    set catch ball delay 300&lt;br /&gt;
    set pulley diameter %lf [1.0 4.0] (cm)                                 -&amp;gt;    set pulley diameter 2.356&lt;br /&gt;
    set ID string %s [maximum length of 32 characters]                     -&amp;gt;    set ID string WORLD_PENDULUM_LISBON&lt;br /&gt;
    cur                                                                    -&amp;gt;    cur&lt;br /&gt;
    go to origin speed[1.0:50.0] acceleration[1.0:150.0]                   -&amp;gt;    go to origin 11.5 41.1&lt;br /&gt;
    move forward deltaX[1:50.0] speed[1.0:50.0] acceleration[1.0:150.0]    -&amp;gt;    move forward 4.5 2.2 2.0    &lt;br /&gt;
&lt;br /&gt;
Before turning the micro-controller on, it is important to perform two position measurements (maximum and vertical). The procedure to measure these positions is described in [[#Setting specific parameters for the experiment|Setting specific parameters for the experiment]].&lt;br /&gt;
&lt;br /&gt;
====Description of the console menu (commands/outputs)====&lt;br /&gt;
Commands related with the state machine and communication with e-lab driver (Java program running in the RaspberryPi):&lt;br /&gt;
* '''cur''': Ask the micro-controller about its current configuration. The micro-controller will return the following line:&lt;br /&gt;
:[[File:cur_dsPic_return.png|x60px|cur dsPic return]]&lt;br /&gt;
* '''str''': Change the micro-controller state to STARTED and starts an experiment if previously configured using a &amp;quot;cfg&amp;quot; command. Once the experiment has started the micro-controller will output the data in the following format: 1st column - data point number, 2nd column - period (s), 3rd column - g (m/s²), 4th column - velocity at laser location (cm/s), 5th column - room temperature (degC). See the figure below for illustration:&lt;br /&gt;
:[[File:str_and_data_dsPic_return.png|x230px|str and data dsPic return]]&lt;br /&gt;
* '''stp''': Stops an experiment and send the micro-controller to the STOPED state.&lt;br /&gt;
* '''rst''': Resets the micro-controller and send it to the RESET state.&lt;br /&gt;
* '''ids''': Ask the micro-controller to send its identifications. E.g.: IDS     WP_LIS  STOPED&lt;br /&gt;
* '''cfg''': Send the configuration for a new experiment. This command accepts two integer parameters: 1st - initial displacement in cm, 2nd - number of oscillations&lt;br /&gt;
:[[File:cfg_dsPic_return.png|x60px|cfg dsPic return]]&lt;br /&gt;
&lt;br /&gt;
Commands to execute predefined functions, useful for calibrations and testing:&lt;br /&gt;
* '''stop ball''': This command is used to stop the ball from oscillating. After stopping the ball, the shovel resting position is at the photo-diode/photo-gate.&lt;br /&gt;
* '''prepare launch''': This command accepts one integer which corresponds to the initial displacement (maximum amplitude) before releasing the ball. The command displaces the shovel to the required position and rests at that position.&lt;br /&gt;
* '''launch ball''': This command releases the ball by sending the shovel to the origin at its maximum speed.&lt;br /&gt;
* '''test laser''': This function is used to simultaneously test the laser and the photo-gate/photo-diode. A more detailed description of this command is found in [[#Laser and photo-gate test|Laser and photo-gate test]] as well as procedures to check in case of a failed test.&lt;br /&gt;
* '''go to origin''': This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the origin (until it reaches the micro-switch).&lt;br /&gt;
* '''move forward''': This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the forward direction (away from the origin).&lt;br /&gt;
* '''move backward''': This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the backward direction (towards the origin).&lt;br /&gt;
* '''move to photodiode''': This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the photo-diode/photo-gate if the shovel is beyond the photo-diode/photo-gate in the forward direction. If the shovel is between the photo-diode and the origin the command sends the shovel to the origin (until it reaches the micro-switch).&lt;br /&gt;
* '''light bulb on''': Turns the light bulb on to illuminate the experiment.&lt;br /&gt;
* '''light bulb off''': Turns the light bulb off.&lt;br /&gt;
* '''laser on''': Turns the laser on.&lt;br /&gt;
* '''laser off''': Turns the laser off.&lt;br /&gt;
* '''reboot''': Performs a software reset to the micro-controller. Before resetting, the micro-controller stores the current number of oscillations into the flash memory.&lt;br /&gt;
&lt;br /&gt;
Commands to set the specific parameters for the experiment (see section [[#Setting specific parameters for the experiment|Setting specific parameters for the experiment]] for more details). This parameters are stored in the flash memory so that they are not lost in case of a power down situation:&lt;br /&gt;
* '''set maximum position''': Stores the shovel maximum absolute allowed position in cm (where it is mechanically impossible to go further in the forward direction).&lt;br /&gt;
* '''set sphere diameter''': Stores the sphere diameter in cm and measured at the equatorial plane.&lt;br /&gt;
* '''set pendulum length''': Stores the length of the pendulum. See [[#String measurement|String measurement]] for details on how to measure the string length. IMPORTANT: the pendulum length should include the radius of the ball.&lt;br /&gt;
* '''set origin position''': Stores the position of the shovel when located at the origin, i.e., when the shovel is stopped by pressing the micro-switch.&lt;br /&gt;
* '''set vertical position''': Stores the position of the shovel when the pendulum (ball +  string) is perfectly vertical.&lt;br /&gt;
* '''set photodiode position''': Stores the position of the shovel when located at the photo-doide/photo-gate location.&lt;br /&gt;
* '''set catch ball delay''': Stores the delay used to catch (stop) the ball when this one is oscillating with a relatively large amplitude. NOTE: This parameter is no longer used in the recent firmware versions because the micro-controller is now able to automatically catch the ball based on its velocity. For the catch ball to work well, ensure the ball alignment is set as specified in the schematics of [https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly#Order_of_assembly_and_filling_with_sand Order of assembly and filling with sand].&lt;br /&gt;
* '''set pulley diameter''': Stores the diameter of the pulley attached to the step-motor. This value is used to calibrate the displacement of the shovel.&lt;br /&gt;
* '''set display intensity''': Stores the display light intensity. This value should be set so that the numbers are visible/readable on the live video stream when the experiment is running, i.e., when the light bulb is on. 0 is the lowest intensity and 15 is the maximum one.&lt;br /&gt;
* '''set global oscillation counter''': Stores the number of total global oscillations. It is also used to override/reset the counter.&lt;br /&gt;
* '''set ID string''': Sores the experiment identification string (name of the experiment). The string is limited to a maximum of 32 characters.&lt;br /&gt;
&lt;br /&gt;
Current values/parameters for information:&lt;br /&gt;
* '''expected period''': Shows the expected oscillation period in seconds. This value is calculated with the pendulum length and it essential for the proper operation of the experimental apparatus.&lt;br /&gt;
* '''uptime''': Shows the time in seconds since the micro-controller was powered up.&lt;br /&gt;
* '''shovel is at origin''': Indicates if the shovel is located at the origin (yes/no).&lt;br /&gt;
* '''shovel is at photodiode''': Indicates if the shovel is located at the photo-diode/photo-gate (yes/no).&lt;br /&gt;
* '''laser is on''': Indicates if the laser is switched on (yes/no).&lt;br /&gt;
* '''photodiode is on''': Indicates if the photo-diode/photo-gate is lit (conducting state) or dark (non-conduction state). The output is yes/no.&lt;br /&gt;
* '''temperature''': Indicates the temperature in degrees Celsius. The temperature sensor is located in the DB25 box connected to the micro-controller board.&lt;br /&gt;
* '''ERR 1''': Indicates that there is a problem with the laser or photo-diode/photo-gate. See [[#Laser and photo-gate test|Laser and photo-gate test]] for more details and debug procedures.&lt;br /&gt;
* '''ERR 2''': Indicates that there is a problem with the micro-switch. See [http://www.elab.ist.utl.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces#Connections | Connections] to double-check that the micro-switch is properly connected.&lt;br /&gt;
&lt;br /&gt;
====Laser and photo-gate test====&lt;br /&gt;
The micro-controller has a dedicated function (accessible from the console menu) to test the laser and photo-gate simultaneously. This function consist of blinking the laser 5 times with a full period of 100 ms (500 ms total). If the photo-gate correctly detects the laser state the test will be successful. To manually run the laser and photo-gate test, just type the “test laser” command in the console.&lt;br /&gt;
During booting, the micro-controller runs the laser and photo-gate test function to ensure that both components are working properly. If the test fails, the micro-controller returns the “ERR1” error code. This error can be associated with one or more of the following possible problems:&lt;br /&gt;
* Wrong electrical connections: Check section [http://www.elab.ist.utl.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Electrical_interfaces#Connections | Connections] to ensure that both laser and photo-gate are properly connected to the micro-controller.&lt;br /&gt;
* Laser and photo-gate misalignment: Check if the laser light is properly pointed to the photo-gate structure hole and adjust as described in section [[#Photo-gate and laser alignment|Photo-gate and laser alignment]] if needed.&lt;br /&gt;
* The photo-gate is always closed (conducting): If the ambient light is too intense or if some source of light other than the laser is going through the photo-gate structure hole with enough intensity, it can happen that the photo-gate is always conducting making it impossible to the micro-controller to distinguish between laser ON and OFF states. In this case, the solution is to reduce the ambient light or change the experiment orientation so that the photo-gate receives less light.&lt;br /&gt;
[[File:Laser focus.png |thumb| Procedure to focus the laser beam.|right|border|164px]]&lt;br /&gt;
* Unfocused laser: If the laser is not properly focused, the light intensity may not be sufficient to close the photo-gate. The laser can be focused by slightly rotating its lens (to one side or the other): rotate until the red dot is the smallest as possible (bellow 1mm) at a distance of ~150mm. To rotate the lens it is necessary to remove the laser from its support. The laser is fixed by pressure only and, in some cases, with a drop of glue or polish nail. IMPORTANT: Do not fully unscrew the lens from the body as it will result in damaging the laser. '''Never hold laser part A by the small printed circuit board.'''&lt;br /&gt;
&lt;br /&gt;
After trying to correct the possible source of errors, re-run the test to check if the problem is solved.&lt;br /&gt;
&lt;br /&gt;
====Setting specific parameters for the experiment====&lt;br /&gt;
Some of the settable parameters are essential for the correct and safe operation of the launcher and overall experiment. This subsection describes how to measure and set each one of the parameters.&lt;br /&gt;
The following settable parameters need to be measured with the micro-controller turned off (powered off). These parameters are:&lt;br /&gt;
* '''maximum position''': The shovel maximum position is measured by slowly displacing the shovel with the hand towards the end of the sliding structure (when the slider is fully extended). Once the shovel reaches the end position (cannot move further) record its absolute position by reading the value at the scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:[[File:maximum_position.png|x100px|Maximum position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''vertical position''': This position is obtained when the pendulum (ball +  string) is in the perfectly vertical position. For that, slowly move the shovel in the backwards direction (towards the origin or micro-switch) until it has passed the vertical pendulum position. Wait for the ball to stop totally. Once the ball is fully stopped, approach the shovel in the direction of the ball until it touches the ball but without displacing it. Record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:[[File:vertical_position.png|x100px|Vertical position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the above parameters have been measured, turn on the micro-controller by powering on the Raspberry Pi. During boot, the micro-controller performs some initial tests.&lt;br /&gt;
Allow some time until those tests are finished before trying to send commands to the controller.&lt;br /&gt;
In the meantime, set-up the serial console connection to receive messages from the controller.&lt;br /&gt;
Once the controller is sending its identification string or an error code, the controller finished to boot and we can now set the specific parameters for the experiment.&lt;br /&gt;
For that, use the commands described above. Here follows one example:&lt;br /&gt;
    set maximum position 47.7&lt;br /&gt;
If the command was sent and interpreted successfully, the micro-controller should reply in the following way:&lt;br /&gt;
:[[File:return_set_maximum_position.png|x100px|Return maximum position]]&lt;br /&gt;
&lt;br /&gt;
Perform the same for the vertical position.&lt;br /&gt;
&lt;br /&gt;
* '''sphere diameter''': The sphere diameter should be measured at the ball equatorial plane where the laser points on the ball. If not mentioned or impossible to measure, consider 8 cm, which should be close enough to the usually used spheres. This measurement is mainly used for the determination of the pendulum speed at the laser location. Once the sphere diameter has been measured, store the value in the micro-controller flash by using the command &amp;quot;set sphere diameter&amp;quot;. Consider to have ''multiple equatorial readings'' in different positions and take their average value because the sphere is most likely an ellipsoid!  &lt;br /&gt;
:[[File:sphere_diameter_measurement_crop.png|x200px|Sphere diameter measurement]]&lt;br /&gt;
&lt;br /&gt;
* '''pendulum length''': The procedure to measure the string is described in [[#String measurement|String measurement]]. Then, the radius of the sphere/ball (in the vertical direction, i.e., along the string direction) should be added to the string length, resulting in the pendulum length. The unit of length for this quantity is meter (unlike the other ones which is centimeter). Once the pendulum length has been measured, store the value in the micro-controller flash by using the command &amp;quot;set pendulum length&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* '''origin position''': This is the location of the shovel when it is stopped by the micro-switch (see figure below for illustration). To measure this position:&lt;br /&gt;
:* send the shovel to the origin using the following command:&lt;br /&gt;
    go to origin 2 2&lt;br /&gt;
:* once the shovel is stopped, record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.&lt;br /&gt;
:* store the measured value (xx.xx) in the micro-controller flash memory using the command &amp;quot;set origin position&amp;quot;.&lt;br /&gt;
:[[File:origin_position.png|x100px|Origin position]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''pulley diameter''': The diameter of the pulley that is attached to the step-motor is used to calibrate the displacement of the shovel. A good initial guess can be obtained by measuring its diameter directly, as shown in the figure below. After storing this parameter in the micro-controller a more accurate calibration should be performed, described as the following:&lt;br /&gt;
:* move the shovel to the origin by sending the command &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* use the command &amp;quot;move forward&amp;quot; and request a displacement of 40 cm, e.g., &amp;quot;move forward 40 2 2&amp;quot; (speed of 2 cm/s is slow enough to guarantee a good calibration)&lt;br /&gt;
:* check how much was the actual displacement: reached position - origin position&lt;br /&gt;
:* if the displacement is different then the requested one (by more than 1 mm) scale linearly the pulley diameter to match the actual displacement with the requested one by using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; &lt;br /&gt;
New\;pulley\;diameter = Old \; pulley \; diameter \cdot \frac{Actual \; displacement}{Requested \;displacement}&lt;br /&gt;
&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:* store the new &amp;quot;pulley diameter&amp;quot; in the micro-controller by using the command &amp;quot;set pulley diameter&amp;quot;&lt;br /&gt;
:* resend the shovel back to the origin using the command &amp;quot;go to origin 2 2&amp;quot;&lt;br /&gt;
:* check the correctness made by using again the command &amp;quot;move forward&amp;quot; and request a displacement of 40 cm. This time the reached position should corresponds to a displacement of 40 cm.&lt;br /&gt;
:[[File:pulley_diameter_measurement_crop.png|x200px|Pulley diameter measurement]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''photodiode position''': The photodiode position corresponds to the location of the shovel when this one is stopped at the photo-diode/photo-gate, see the figure below for illustration. The procedure to obtain this position is the following:&lt;br /&gt;
:* locate the shovel beyond (in the forward direction) the photo-gate and laser location. This can be achieved by using the command &amp;quot;move forward&amp;quot;, as before.&lt;br /&gt;
:* send the shovel to the photodiode using the command &amp;quot;move to photodiode&amp;quot;, e.g., &amp;quot;move to photodiode 2 2&amp;quot; (to use a small speed of 2 cm/s)&lt;br /&gt;
:* once the shove is stopped record the position on the metric scale and store it in the micro-controller using the command &amp;quot;set photodiode position&amp;quot;&lt;br /&gt;
:[[File:photodiode_position.png|x100px|Photodiode_position]]&lt;br /&gt;
&lt;br /&gt;
After setting all parameters, double check if they were properly stored in the micro-controller by checking them on the menu by typing &amp;quot;?&amp;quot; or &amp;quot;help&amp;quot; on the console:&lt;br /&gt;
&lt;br /&gt;
[[File:setting_parameters_check.png|200px|Parameter set]]&lt;br /&gt;
&lt;br /&gt;
===Local gravity access===&lt;br /&gt;
&lt;br /&gt;
Local gravity in big cities normally is well known and documented by national geological entities which encompasses usually the most accurate value. Nevertheless a good comparison can be obtained with spatial harmonics even calculated on-line by a few calculators such as this  [https://www.sensorsone.com/local-gravity-calculator/ Local Gravity Calculator].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Software management| Previous Page (Software management)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Partners| Next Page (Partners)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Calibração | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Calibración  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4333</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4333"/>
		<updated>2021-08-26T13:59:07Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada, usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Descrição do aparato | Página Seguinte (Descrição do aparato)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Remote Experiment Controller | Versão em inglês (English Version)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4332</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4332"/>
		<updated>2021-08-26T13:58:44Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[FREE - Framework for Remote Experiments in Education |Previous Page (FREE - Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4331</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4331"/>
		<updated>2021-08-26T13:58:27Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[FREE - Framework for Remote Experiments in Education |Previous Page ( FREE - Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4330</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4330"/>
		<updated>2021-08-26T13:58:05Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[FREE - Framework for Remote Experiments in Education |Previous Page (Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4329</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4329"/>
		<updated>2021-08-26T13:57:40Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[FREE - Framework for Remote Experiments in Education |Previous Page (Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4328</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4328"/>
		<updated>2021-08-26T13:57:11Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* ReC Client and Multicast Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[FREE - Framework for Remote Experiments in Education | Previous Page (Framework for Remote Experiments in Education)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4327</id>
		<title>Remote Experiment Controller</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Remote_Experiment_Controller&amp;diff=4327"/>
		<updated>2021-08-26T13:53:04Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Pre-requisites =&lt;br /&gt;
&lt;br /&gt;
== Build environment ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Multicast Controller and rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparation steps =&lt;br /&gt;
&lt;br /&gt;
Setup JAVA_HOME environment variable pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Setup ~/.m2/toolchains.xml pointing to a valid openjdk11 installation:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First checkout the project from github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Then we need to switch to jdk11-migration branch:&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
To create a pendulum experiment, the script create_pendulum_experiment.sh helps to create a base experiment for a brand new pendulum&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Sample script execution to create pendulum:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
Configure the following properties based on your environment:&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4326</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4326"/>
		<updated>2021-08-26T13:52:28Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Ligações */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada, usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Descrição do aparato | Página Seguinte (Descrição do aparato)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Remote Experiment Controller | Versão em inglês (English Version)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4325</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4325"/>
		<updated>2021-08-26T13:51:33Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Cliente ReC e Controlador Multicast */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada, usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Descrição do aparato | Página Seguinte (Descrição do aparato)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4324</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4324"/>
		<updated>2021-08-26T13:50:42Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Cliente ReC e Controlador Multicast */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada, usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4323</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4323"/>
		<updated>2021-08-26T13:50:06Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Construção */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada, usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4322</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4322"/>
		<updated>2021-08-26T13:49:35Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Nome da(s) experiência(s) a criar, vírgula (,) como delimitação.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Nome do anfitrião onde o Controlador Multicast vai ser instalado (''default'': elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Porta CORBA listada usada para receber ligações do servidor de Hardware, rec.web e rec.client (''default'': 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Porta JMX listada, usada para receber ligações de rec.web (''default'': 25001)&lt;br /&gt;
* '''install.dir''': Directório base onde o Controlador Multicast será instalado (''default'': /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub-directório onde o Controlador Multicast será instalado (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL onde aceder ao ''webswing'' (por exemplo, https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Dispositivo porta-série (por exemplo, /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Crie pacotes com tudo&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copie os pacotes resultantes para os servidores de destino:&lt;br /&gt;
&lt;br /&gt;
* Servidor Multicast&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Servidor de Hardware&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Instalação =&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador ''elab''&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Adicionar o utilizador ao grupo ''docker''&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Carregue as imagem do Docker (apenas se a construção for realizada fora do servidor de implantação alvo)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copie o ficheiro docker-compose.yml para ''home'' do utilizador do elab&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Inicie todos os serviços&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Substitua wpexperiment pelo nome da sua experiência&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Crie o utilizador elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Crie o directório da experiência&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Descompacte o pacote da experiência para o directório da mesma&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Inicie a experiência&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Teste =&lt;br /&gt;
&lt;br /&gt;
* Acesso direto à experiência&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com) + nome da experiência (por exemplo, wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* ''Webswing'' e administração da consola&lt;br /&gt;
&lt;br /&gt;
URL de acesso configurado em WEBSWING_PUBLIC_URL (por exemplo, https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
Utilizador: admin&lt;br /&gt;
Palavra-passe: pwd&lt;br /&gt;
&lt;br /&gt;
= Operações =&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== Cliente ReC e Controlador Multicast ==&lt;br /&gt;
&lt;br /&gt;
* Arranque&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Encerramento&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Registos&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Passos para a ligação ao ambiente do IST:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4321</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4321"/>
		<updated>2021-08-26T12:30:55Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4320</id>
		<title>Controlador de Experiências Remotas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Controlador_de_Experi%C3%AAncias_Remotas&amp;diff=4320"/>
		<updated>2021-08-26T12:30:33Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PARA PORTUGUÊS&lt;br /&gt;
&lt;br /&gt;
= Pré-requisitos =&lt;br /&gt;
&lt;br /&gt;
== Ambiente de construção ==&lt;br /&gt;
&lt;br /&gt;
* Git (2.30.2+)&lt;br /&gt;
* Ant (1.10.9+)&lt;br /&gt;
* Maven (3.6.3+)&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Controlador multicast e rec.client ==&lt;br /&gt;
&lt;br /&gt;
* Docker (20.10+)&lt;br /&gt;
* docker-compose (1.25.4+)&lt;br /&gt;
&lt;br /&gt;
== Servidor de Hardware ==&lt;br /&gt;
&lt;br /&gt;
* OpenJDK 11 (11.0.8+)&lt;br /&gt;
&lt;br /&gt;
= Preparação =&lt;br /&gt;
&lt;br /&gt;
Configure a variável do ambiente JAVA_HOME com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    $ export JAVA_HOME=/path/to/openjdk11&lt;br /&gt;
&lt;br /&gt;
Configure ~/.m2/toolchains.xml com vista a uma instalação openjdk11 válida:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;toolchains&amp;gt;&lt;br /&gt;
        &amp;lt;toolchain&amp;gt;&lt;br /&gt;
            &amp;lt;type&amp;gt;jdk&amp;lt;/type&amp;gt;&lt;br /&gt;
                &amp;lt;provides&amp;gt;&lt;br /&gt;
                    &amp;lt;vendor&amp;gt;openjdk&amp;lt;/vendor&amp;gt;&lt;br /&gt;
                    &amp;lt;version&amp;gt;11&amp;lt;/version&amp;gt;&lt;br /&gt;
                &amp;lt;/provides&amp;gt;&lt;br /&gt;
            &amp;lt;configuration&amp;gt;&lt;br /&gt;
                &amp;lt;jdkHome&amp;gt;/path/to/openjdk/jdk11.0.8&amp;lt;/jdkHome&amp;gt;&lt;br /&gt;
            &amp;lt;/configuration&amp;gt;&lt;br /&gt;
        &amp;lt;/toolchain&amp;gt;&lt;br /&gt;
    &amp;lt;/toolchains&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro, confira o projeto a partir de github:&lt;br /&gt;
&lt;br /&gt;
    $ git clone https://github.com/linkareti/rec-project.git&lt;br /&gt;
&lt;br /&gt;
(FIXME) Depois, é necessário mudar o ramo de migração jdk11&lt;br /&gt;
&lt;br /&gt;
    $ git checkout jdk11-migration&lt;br /&gt;
&lt;br /&gt;
Para criar uma nova experiência de pêndulo, o script create_pendulum_experiment.sh ajuda a criar uma experiência base para um novo pêndulo&lt;br /&gt;
&lt;br /&gt;
'''experiments/create_pendulum_experiment.sh'''&lt;br /&gt;
&lt;br /&gt;
    '''Mandatory arguments''':&lt;br /&gt;
    * '''1st argument''': Name of the experiment (e.g. worldpendulum)&lt;br /&gt;
    * '''2nd argument''': ID of the experiment (e.g. ELAB_WORLD_PENDULUM)&lt;br /&gt;
    * '''3rd argument''': Pendulum location (e.g. Faro)&lt;br /&gt;
&lt;br /&gt;
    '''Optional arguments''':&lt;br /&gt;
    * '''4th argument''': URL to the video (e.g. rtsp://elabmc.ist.utl.pt:80/wp_ccalg.sdp)&lt;br /&gt;
    * '''5th argument''': Pendulum serial device location (default: /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Exemplo de um script para a criação de um pêndulo:&lt;br /&gt;
&lt;br /&gt;
    $ ./create_pendulum_experiment.sh wpalentejo ELAB_WP_ALENTEJO Alentejo rtsp://elabmc.ist.utl.pt:80/wp_alentejo.sdp /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
= Construção =&lt;br /&gt;
&lt;br /&gt;
Configure as seguintes propriedades consoante o seu ambiente&lt;br /&gt;
&lt;br /&gt;
'''build_pendulum.properties''':&lt;br /&gt;
&lt;br /&gt;
* '''pendulum.experiment.list''': Name of the experiment(s) to build, comma (,) delimited.&lt;br /&gt;
* '''pendulum.multicast.controller.host''': Hostname where Multicast controller is going to be installed (default: elab-multicast)&lt;br /&gt;
* '''pendulum.multicast.controller.port''': Listen CORBA port used to recieve connections from Hardware Server, rec.web and rec.client (default: 9001)&lt;br /&gt;
* '''pendulum.rec.multicastcontroller.jmxremote.port''': Listen JMX port used to recieve connections from rec.web (default: 25001)&lt;br /&gt;
* '''install.dir''': Base directory where Multicast Controller is going to be installed (default: /home/elab)&lt;br /&gt;
* '''deployment.subdir''': Sub directory where Multicast Controller is going to be installed (default: /rec-deployment)&lt;br /&gt;
&lt;br /&gt;
'''deployment/compose/src/main/docker/docker-compose-pendulum.yml''':&lt;br /&gt;
&lt;br /&gt;
* '''WEBSWING_PUBLIC_URL''': URL where webswing is accessible (e.g. https://elab-dev.vps.tecnico.ulisboa.pt/)&lt;br /&gt;
&lt;br /&gt;
'''experiments/{experiment}/etc/build.properties'''&lt;br /&gt;
&lt;br /&gt;
* '''experiment.driver.device''': Serial port device (e.g. /dev/ttyS0)&lt;br /&gt;
&lt;br /&gt;
Package everything:&lt;br /&gt;
    $ mvn clean package -Dmaven.test.skip=true -Djarsigner.alias=&amp;quot;REC&amp;quot; -Dbuild.environment=pendulum -Dpack.docker.images -Dpublic.repo=docker.io&lt;br /&gt;
&lt;br /&gt;
Copy resulting packages to destination servers:&lt;br /&gt;
&lt;br /&gt;
* Multicast Server&lt;br /&gt;
    $ scp deployment/images/target/reverse-proxy.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/multicast.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing-admin.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/images/target/webswing.tar multicast-server-name:/tmp/&lt;br /&gt;
    $ scp deployment/compose/target/docker-compose-runner.yml multicast-server-name:/tmp/docker-compose.yml&lt;br /&gt;
&lt;br /&gt;
* Hardware Server&lt;br /&gt;
    $ scp dist/java/*HardwareServer*.zip hardware-server-name:/tmp/&lt;br /&gt;
&lt;br /&gt;
= Install =&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller==&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Add user to docker group&lt;br /&gt;
    $ sudo usermod -a -G docker elab&lt;br /&gt;
&lt;br /&gt;
* Load Docker images (only if building outside target deployment server)&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing.tar # ReC client image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/multicast.tar # Multicast Controller image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/webswing-admin.tar # ReC client admin console image&lt;br /&gt;
    $ sudo -u elab docker load --input /tmp/reverse-proxy.tar # Reverse Proxy image&lt;br /&gt;
&lt;br /&gt;
* Copy docker-compose.yml file to elab user home&lt;br /&gt;
    $ sudo -u elab cp /tmp/docker-compose.yml /home/elab/&lt;br /&gt;
&lt;br /&gt;
* Start all services&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Replace wpexperiment with your experiment name&lt;br /&gt;
    $ export experiment=wpexperiment&lt;br /&gt;
&lt;br /&gt;
* Create user elab&lt;br /&gt;
    $ sudo useradd --create-home --shell /bin/false --expiredate 1 elab&lt;br /&gt;
&lt;br /&gt;
* Create experiment directory&lt;br /&gt;
    $ sudo -u elab mkdir /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Unpack experiment package to experiment directory&lt;br /&gt;
    $ sudo -u elab unzip /tmp/${experiment}HardwareServer*.zip -d  /home/elab/rec-deployment/${experiment}&lt;br /&gt;
&lt;br /&gt;
* Start experiment&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&lt;br /&gt;
* Direct access to experiment:&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com) + experiment name (e.g. wpalentejo)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/wpalentejo&lt;br /&gt;
&lt;br /&gt;
* Webswing and administration console&lt;br /&gt;
&lt;br /&gt;
Access configured URL at WEBSWING_PUBLIC_URL property (e.g. https://elab.my.url.com)&lt;br /&gt;
&lt;br /&gt;
https://elab.my.url.com/&lt;br /&gt;
&lt;br /&gt;
User: admin&lt;br /&gt;
Pass: pwd&lt;br /&gt;
&lt;br /&gt;
= Operations =&lt;br /&gt;
&lt;br /&gt;
== Hardware Server ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh start&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab /home/elab/rec-deployment/${experiment}/${experiment}Daemon.sh stop&lt;br /&gt;
&lt;br /&gt;
* Logs&lt;br /&gt;
    $ /home/elab/rec-deployment/${experiment}/*.log&lt;br /&gt;
&lt;br /&gt;
== ReC Client and Multicast Controller ==&lt;br /&gt;
&lt;br /&gt;
* Startup&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml up -d&lt;br /&gt;
&lt;br /&gt;
* Shutdown&lt;br /&gt;
    $ sudo -u elab docker-compose -f /home/elab/docker-compose.yml down&lt;br /&gt;
&lt;br /&gt;
* Logs:&lt;br /&gt;
    $ docker logs rec.client # ReC client logs (webswing)&lt;br /&gt;
    $ docker logs rec.multicast # ReC Multicast Controller logs&lt;br /&gt;
    $ docker logs rec.proxy # ReC Proxy logs&lt;br /&gt;
    $ docker logs rec.client-admin # ReC client Administration Console logs (webswing)&lt;br /&gt;
&lt;br /&gt;
Steps to connect to IST environment:&lt;br /&gt;
&lt;br /&gt;
# TODO Steps&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description | Next Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Controlador de Experiências Remotas | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Controlador remoto del experimento  | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4319</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4319"/>
		<updated>2021-08-26T12:11:49Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no MacOS Catalina/Mojave/High Sierra e ligação ao RPi =====&lt;br /&gt;
*A Apple fornece [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento para a configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi selecionada, este campo pode ser preenchido com ''123.123.123.124'', e o campo  ''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas.&lt;br /&gt;
*Se não o tiver feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Para tal, basta ligar uma extremidade do cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*O símbolo da rede deve agora mostrar a ligação como estando concluída&lt;br /&gt;
*MacOS inclui um cliente SSH client na instalação predefinida do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador, e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que a configuração sugerida foi adotada, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e ''123.123.123.123'' , uma vez que nos estamos a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com ''123.123.123.123''. Tente voltar a ligar utilizando novamente o comando SSH. Surgirá um aviso que indica que se trata de um computador novo, desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi|Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
=== Configuração do Sistema Operativo do RPi ===&lt;br /&gt;
Depois de instalado, o SO precisa de ser configurado. As próximas instruções devem ser seguidas no prompt terminal. Se estiver a utilizar um teclado e monitor ligados ao RPi e instalado um SO com IGU, por favor abra um emulador terminal.&lt;br /&gt;
&lt;br /&gt;
Primeiro, proceda à configuração geral do sistema carregando o utilitário raspi-config, ao executar o comando:&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;
Quando solicitado, introduza a senha do utilizador ''pi''. Pode navegar no menu usando as teclas de Seta para seleção, tecla Escape para retroceder nos menus e Enter para selecionar a entrada em destaque.&lt;br /&gt;
&lt;br /&gt;
*A opção ''1 Change User Password'' pode ser ignorada, uma vez que o utilizador ''pi'' será apagado mais tarde.&lt;br /&gt;
&lt;br /&gt;
*Na opção ''2 Network Options'' é possível definir o ''Hostname'' (Nome do Anfitrião) e configurar uma ligação ''Wi-fi''&lt;br /&gt;
&lt;br /&gt;
O ''Hostname'' é o nome atribuído ao RPi e não tem qualquer significado especial. É útil porque facilita o reconhecimento do computador com base apenas no nome. &lt;br /&gt;
&lt;br /&gt;
A entrada ''Wi-fi'' permite a configuração de uma rede Wi-Fi introduzindo o SSID (nome da rede) e a palavra-passe da rede. Este diálogo só funciona para esquemas WEP, WPA e WPA2. O WPA-entreprise deve ser configurado manualmente através do [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore as restantes entradas, a não ser que tenha a certeza das alterações que estará a realizar. &lt;br /&gt;
&lt;br /&gt;
*Em ''3 Boot Options'', a entrada ''Desktop / CLI'' é a que seleciona se o RPi arranca num ambiente IGU ou num prompt de comando; a entrada ''Wait for Network at Boot'' se espera pela ligação à rede antes de completar o arranque e a ''Splash Screen'' se mostra uma imagem ou um texto de depuração durante o arranque.&lt;br /&gt;
&lt;br /&gt;
Tenha em atenção que a entrada ''Desktop / CLI'' só produz efeitos se tiver previamente instalado uma versão do Raspbian com IGU ou tiver instalado entretanto uma IGU na versão ''lite''.&lt;br /&gt;
&lt;br /&gt;
Estas configurações são seguras para aplicar consoante o que os utilizadores pretendem.&lt;br /&gt;
&lt;br /&gt;
*Em ''4 Localisation Options'', a entrada ''Change Locale'' permite configurar o RPi de modo a que a língua, e outros elementos de localização, tais como o formato da hora e da data, o nome dos dias da wiki, a moeda, etc., estejam de acordo com a localização do utilizador RPi; a entrada ''Change Timezone'' permite configurar o fuso horário local, para que o RPi mostre a hora e a data corretas; ''Change Keyboard Layout'' permite configurar o teclado para que as teclas digitadas no teclado físico coincidam com as que aparecem no ecrã, e a entrada ''Change Wi-fi Country'' configura o RPi para que este comunique nas frequências wi-fi corretas de acordo com as leis locais.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Keyboard Layout'' só é importante se o RPi for utilizado com um teclado que lhe está diretamente ligado. Os utilizadores ligados através do SSH não precisam de configurar o teclado.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Wi-fi Country'' deve ser utilizada se se pretender configurar uma ligação Wi-fi. Uma configuração errada pode resultar seja numa ligação não operacional, uma vez que o RPi tentará comunicar em frequências diferentes dos restantes dispositivos Wi-fi locais, seja em questões legais para o utilizador por transmitir em frequências proibidas.&lt;br /&gt;
&lt;br /&gt;
*Em ''5 Interfacing Options'', as entradas permitem ativar/desativar os vários serviços listados. Todos devem ser desativados, excepto os serviços ''SSH'' e/ou [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''], a interface ''Serial'' e o acesso ''Remote GPIO''&lt;br /&gt;
&lt;br /&gt;
Note que o serviço VNC só funcionará se for instalada uma IGU no sistema. Caso contrário, só poderá ser ativado o serviço ''SSH''.&lt;br /&gt;
&lt;br /&gt;
A activação do serviço  ''SSH'' torna desnecessário criar o ficheiro ssh em disco, tal como descrito anteriormente. Este estará disponível em cada arranque até ser novamente desativado.&lt;br /&gt;
&lt;br /&gt;
Na entrada ''Serial'', selecione ''No'' se a ''login shell'' deve estar disponível em série e ''Yes'' se o hardware da porta-série deve ser ativado.&lt;br /&gt;
&lt;br /&gt;
*Ignore as restantes opções, exceto a opção ''Expand Filesystem'' disponível na entrada ''Advanced Options''.&lt;br /&gt;
&lt;br /&gt;
*Saia do utilitário selecionando ''Finish'' e, quando solicitado, permita que o RPi seja reiniciado selecionando ''yes''. Se estiver ligado via SSH, a ligação será terminada automaticamente.&lt;br /&gt;
&lt;br /&gt;
*Aguarde que o RPi reinicie completamente. Não desligue o cabo de alimentação do RPi.&lt;br /&gt;
&lt;br /&gt;
*Quando o LED verde deixar de piscar, o processo está completo. Inicie a sessão no RPi como anteriormente.&lt;br /&gt;
&lt;br /&gt;
'''Antes''' de ligar o RPi à Internet, deve ser criado um novo utilizador e o utilizador predefinido deve ser eliminado. '''''Uma vez que todas as novas instalações de SO Raspbian têm o mesmo utilizador e a palavra-passe padrão que  [https://www.raspberrypi.org/documentation/linux/usage/users.md todos podem encontrar na Internet], mantê-los disponíveis no SO é uma vulnerabilidade de segurança muito grave. Desta forma, qualquer pessoa é livre de tentar entrar no seu RPi e, tendo sucesso, assumir o controlo do sistema.'''''&lt;br /&gt;
&lt;br /&gt;
Os seguintes comandos criam um utilizador chamado ''newton''. Podem, e devem, ser ser escolhidos outros nomes de utilizador  aquando da configuração do RPi. ''newton'' está apenas a ser utilizado como exemplo &lt;br /&gt;
*Crie o utilizador ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Introduza a palavra-passe do utilizador ''pi'' quando solicitada. Use a mesma palavra-passe que utiliza para iniciar sessão. Isto iniciará o processo de criação do utilizador onde uma nova palavra-passe para o novo utilizador será solicitada. Escolha uma nova palavra-passe, diferente da palavra-passe de utilizador ''pi'' padrão'''''. Ao escolher a nova palavra-passe, note que:'''''&lt;br /&gt;
&lt;br /&gt;
'''''As senhas fortes têm pelo menos 8 caracteres, uma mistura de letras maiúsculas e minúsculas, uma mistura de letras e números e incluem, pelo menos, um carácter especial, por exemplo, ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''Uma palavra-passe forte é difícil de adivinhar mas deve ser fácil de lembrar. Uma palavra-passe que tem de ser escrita não é forte, por mais que sejam as suas características acima mencionadas. '''''&lt;br /&gt;
&lt;br /&gt;
'''''Não escolha palavras-passe compostas por: qualquer palavra que possa ser encontrada num dicionário, em qualquer língua (por exemplo, avião), uma palavra de dicionário com algumas letras simplesmente substituídas por números (por exemplo, a1rplan3 ou aer0plan0), um caracter repetido ou uma série de caracteres (por exemplo, AAAAA ou 12345), uma série de caracteres de teclado (por exemplo, qwerty ou qazwsx) ou qualquer coisa que esteja escrita e guardada algures perto do seu computador'''''&lt;br /&gt;
&lt;br /&gt;
'''''O seu nome de utilizador e a palavra-passe são dos principais mecanismos de defesa contra o acesso não autorizado e adulteração. Ter nomes de utilizador fáceis de adivinhar, senhas fracas ou que sejam conhecidas publicamente afeta gravemente a segurança dos seus dispositivos e da sua rede.'''''&lt;br /&gt;
&lt;br /&gt;
*Adicione o novo utilizador aos grupos do sistema&lt;br /&gt;
&lt;br /&gt;
Comece por identificar os grupos dos quais o utilizador ''pi'' original é membro, executando o comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O comando produzirá três listas no formato ''número(texto)''. Mantenha este output no ecrã. Escreva, mas não execute, o seguinte comando:&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;
A partir do resultado do comando anterior, selecione a lista após ''groups='', exceto o primeiro elemento, clicando e arrastando com o rato sobre o texto. Copie-o para a linha de comando, clicando no botão do meio do rato depois de selecionar o texto. Edite o comando atual utilizando as setas do teclado para mover o cursor e retirar os números e parênteses, mas mantendo o texto e as vírgulas. Acrescente o nome do utilizador que está a ser criado no fim do comando. O comando final deve ter o seguinte formato:&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;
Confirme que o utilizador foi adicionado aos grupos do sistema com sucesso executando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depois de ''groups='', deverá encontrar os mesmos grupos que acima. '''Não continue antes que estes surjam'''.&lt;br /&gt;
&lt;br /&gt;
*Saia do RPi e inicie sessão utilizando o novo utilizador&lt;br /&gt;
&lt;br /&gt;
*Apague a conta do utilizador ''pi''&lt;br /&gt;
&lt;br /&gt;
O utilizador ''pi'' padrão ainda existe no sistema. Manter esta conta ativa é uma vulnerabilidade de segurança. Apague-a executando:&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;
*A fim de configurar a rede onde o RPi será ligado, muitas vezes é útil conhecer o [https://en.wikipedia.org/wiki/MAC_address endereço MAC] do adaptador de rede. Execute o seguinte comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se planear ligar a experiência via cabo Ethernet, copie o campo ''ether'' na entrada ''eht0''. Se ligar via ligação sem fios, copie o campo ''ether'' na entrada ''wlan0''.&lt;br /&gt;
&lt;br /&gt;
*Se planear utilizar uma ligação VPN para gerir experiências controladas remotamente, é também uma boa altura para enviar os ficheiros necessários para o RPi. Ao fazê-lo, assegura que as chaves continuarão secretas, uma vez que são enviadas através do cabo que liga o seu computador ao RPi. Se utilizar o RPi com teclado e monitor, considere desligá-lo e escrever os ficheiros diretamente no cartão SD, inserindo-o num computador. A configuração VPN é altamente dependente do seu ''setup'', pelo que deve ser completada caso a caso.&lt;br /&gt;
&lt;br /&gt;
*Se não o fizer, desligue o RPi. Espere que o LED verde no RPi pare de piscar antes de desligar a fonte de alimentação. Mova-o para a sua localização permanente, ligando-o à infraestrutura eletrónica e de rede da experiência.&lt;br /&gt;
&lt;br /&gt;
*Ligue o RPi, ligando a fonte de energia. Deve obter um endereço de IP da sua rede válido. A configuração da rede e da firewall é altamente dependente da sua infraestrutura de rede específica. Se as instruções acima foram seguidas, o RPi está configurado para aceitar ofertas de aluguer de IP DHCP. Para que o servidor de hardware e a transmissão de vídeo possam funcionar, o RPi deve ser capaz de comunicar&lt;br /&gt;
&lt;br /&gt;
*Inicie a sessão e atualize o software no RPi, executando sucessivamente os seguintes comandos:&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;
O último comando pode demorar algum tempo a completar-se. Enquanto isso, '''''NÃO DESCONECTE O RPi DA FONTE ALIMENTAÇÃO. SE O FIZER, MUITO PROVAVELMENTE CORROMPERÁ O CARTÃO SD E TERÁ DE COMEÇAR DE NOVO.''''' &lt;br /&gt;
&lt;br /&gt;
*Reinicie o RPi para assegurar que o software mais recente está a funcionar. Volte a entrar.&lt;br /&gt;
&lt;br /&gt;
*Instale o software necessário para o servidor de hardware e para a transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Para o servidor de hardware, deve ser instalado o seguinte software:&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;
Para a transmissão de vídeo, podem ser utilizados vários programas. O modo recomendado é utilizar o  GStreamer e as suas bibliotecas, visto que suportam o ''enconding'' de hardware de vídeo no RPi. Pode ser instalado através do seguinte comando:&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;
Se necessário, instale também o software para a ligação VPN. Por exemplo, o cliente ''openvpn'' seria instalado através do comando:&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;
Agora que a VPN está instalada, complete a sua configuração com os ficheiros transferidos para o RPi na última etapa.&lt;br /&gt;
&lt;br /&gt;
Note que o gestor do software irá sugerir pacotes extra, na sua maioria dependências dos que foram referidos explicitamente para instalar. Aceite quaisquer pacotes extra sugeridos.&lt;br /&gt;
&lt;br /&gt;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4318</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4318"/>
		<updated>2021-08-26T12:11:32Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Sistema Operativo do RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no MacOS Catalina/Mojave/High Sierra e ligação ao RPi =====&lt;br /&gt;
*A Apple fornece [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento para a configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi selecionada, este campo pode ser preenchido com ''123.123.123.124'', e o campo  ''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas.&lt;br /&gt;
*Se não o tiver feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Para tal, basta ligar uma extremidade do cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*O símbolo da rede deve agora mostrar a ligação como estando concluída&lt;br /&gt;
*MacOS inclui um cliente SSH client na instalação predefinida do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador, e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que a configuração sugerida foi adotada, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e ''123.123.123.123'' , uma vez que nos estamos a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com ''123.123.123.123''. Tente voltar a ligar utilizando novamente o comando SSH. Surgirá um aviso que indica que se trata de um computador novo, desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi|Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
=== Configuração do Sistema Operativo do RPi ===&lt;br /&gt;
Depois de instalado, o SO precisa de ser configurado. As próximas instruções devem ser seguidas no prompt terminal. Se estiver a utilizar um teclado e monitor ligados ao RPi e instalado um SO com IGU, por favor abra um emulador terminal.&lt;br /&gt;
&lt;br /&gt;
Primeiro, proceda à configuração geral do sistema carregando o utilitário raspi-config, ao executar o comando:&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;
Quando solicitado, introduza a senha do utilizador ''pi''. Pode navegar no menu usando as teclas de Seta para seleção, tecla Escape para retroceder nos menus e Enter para selecionar a entrada em destaque.&lt;br /&gt;
&lt;br /&gt;
*A opção ''1 Change User Password'' pode ser ignorada, uma vez que o utilizador ''pi'' será apagado mais tarde.&lt;br /&gt;
&lt;br /&gt;
*Na opção ''2 Network Options'' é possível definir o ''Hostname'' (Nome do Anfitrião) e configurar uma ligação ''Wi-fi''&lt;br /&gt;
&lt;br /&gt;
O ''Hostname'' é o nome atribuído ao RPi e não tem qualquer significado especial. É útil porque facilita o reconhecimento do computador com base apenas no nome. &lt;br /&gt;
&lt;br /&gt;
A entrada ''Wi-fi'' permite a configuração de uma rede Wi-Fi introduzindo o SSID (nome da rede) e a palavra-passe da rede. Este diálogo só funciona para esquemas WEP, WPA e WPA2. O WPA-entreprise deve ser configurado manualmente através do [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore as restantes entradas, a não ser que tenha a certeza das alterações que estará a realizar. &lt;br /&gt;
&lt;br /&gt;
*Em ''3 Boot Options'', a entrada ''Desktop / CLI'' é a que seleciona se o RPi arranca num ambiente IGU ou num prompt de comando; a entrada ''Wait for Network at Boot'' se espera pela ligação à rede antes de completar o arranque e a ''Splash Screen'' se mostra uma imagem ou um texto de depuração durante o arranque.&lt;br /&gt;
&lt;br /&gt;
Tenha em atenção que a entrada ''Desktop / CLI'' só produz efeitos se tiver previamente instalado uma versão do Raspbian com IGU ou tiver instalado entretanto uma IGU na versão ''lite''.&lt;br /&gt;
&lt;br /&gt;
Estas configurações são seguras para aplicar consoante o que os utilizadores pretendem.&lt;br /&gt;
&lt;br /&gt;
*Em ''4 Localisation Options'', a entrada ''Change Locale'' permite configurar o RPi de modo a que a língua, e outros elementos de localização, tais como o formato da hora e da data, o nome dos dias da wiki, a moeda, etc., estejam de acordo com a localização do utilizador RPi; a entrada ''Change Timezone'' permite configurar o fuso horário local, para que o RPi mostre a hora e a data corretas; ''Change Keyboard Layout'' permite configurar o teclado para que as teclas digitadas no teclado físico coincidam com as que aparecem no ecrã, e a entrada ''Change Wi-fi Country'' configura o RPi para que este comunique nas frequências wi-fi corretas de acordo com as leis locais.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Keyboard Layout'' só é importante se o RPi for utilizado com um teclado que lhe está diretamente ligado. Os utilizadores ligados através do SSH não precisam de configurar o teclado.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Wi-fi Country'' deve ser utilizada se se pretender configurar uma ligação Wi-fi. Uma configuração errada pode resultar seja numa ligação não operacional, uma vez que o RPi tentará comunicar em frequências diferentes dos restantes dispositivos Wi-fi locais, seja em questões legais para o utilizador por transmitir em frequências proibidas.&lt;br /&gt;
&lt;br /&gt;
*Em ''5 Interfacing Options'', as entradas permitem ativar/desativar os vários serviços listados. Todos devem ser desativados, excepto os serviços ''SSH'' e/ou [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''], a interface ''Serial'' e o acesso ''Remote GPIO''&lt;br /&gt;
&lt;br /&gt;
Note que o serviço VNC só funcionará se for instalada uma IGU no sistema. Caso contrário, só poderá ser ativado o serviço ''SSH''.&lt;br /&gt;
&lt;br /&gt;
A activação do serviço  ''SSH'' torna desnecessário criar o ficheiro ssh em disco, tal como descrito anteriormente. Este estará disponível em cada arranque até ser novamente desativado.&lt;br /&gt;
&lt;br /&gt;
Na entrada ''Serial'', selecione ''No'' se a ''login shell'' deve estar disponível em série e ''Yes'' se o hardware da porta-série deve ser ativado.&lt;br /&gt;
&lt;br /&gt;
*Ignore as restantes opções, exceto a opção ''Expand Filesystem'' disponível na entrada ''Advanced Options''.&lt;br /&gt;
&lt;br /&gt;
*Saia do utilitário selecionando ''Finish'' e, quando solicitado, permita que o RPi seja reiniciado selecionando ''yes''. Se estiver ligado via SSH, a ligação será terminada automaticamente.&lt;br /&gt;
&lt;br /&gt;
*Aguarde que o RPi reinicie completamente. Não desligue o cabo de alimentação do RPi.&lt;br /&gt;
&lt;br /&gt;
*Quando o LED verde deixar de piscar, o processo está completo. Inicie a sessão no RPi como anteriormente.&lt;br /&gt;
&lt;br /&gt;
'''Antes''' de ligar o RPi à Internet, deve ser criado um novo utilizador e o utilizador predefinido deve ser eliminado. '''''Uma vez que todas as novas instalações de SO Raspbian têm o mesmo utilizador e a palavra-passe padrão que  [https://www.raspberrypi.org/documentation/linux/usage/users.md todos podem encontrar na Internet], mantê-los disponíveis no SO é uma vulnerabilidade de segurança muito grave. Desta forma, qualquer pessoa é livre de tentar entrar no seu RPi e, tendo sucesso, assumir o controlo do sistema.'''''&lt;br /&gt;
&lt;br /&gt;
Os seguintes comandos criam um utilizador chamado ''newton''. Podem, e devem, ser ser escolhidos outros nomes de utilizador  aquando da configuração do RPi. ''newton'' está apenas a ser utilizado como exemplo &lt;br /&gt;
*Crie o utilizador ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Introduza a palavra-passe do utilizador ''pi'' quando solicitada. Use a mesma palavra-passe que utiliza para iniciar sessão. Isto iniciará o processo de criação do utilizador onde uma nova palavra-passe para o novo utilizador será solicitada. Escolha uma nova palavra-passe, diferente da palavra-passe de utilizador ''pi'' padrão'''''. Ao escolher a nova palavra-passe, note que:'''''&lt;br /&gt;
&lt;br /&gt;
'''''As senhas fortes têm pelo menos 8 caracteres, uma mistura de letras maiúsculas e minúsculas, uma mistura de letras e números e incluem, pelo menos, um carácter especial, por exemplo, ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''Uma palavra-passe forte é difícil de adivinhar mas deve ser fácil de lembrar. Uma palavra-passe que tem de ser escrita não é forte, por mais que sejam as suas características acima mencionadas. '''''&lt;br /&gt;
&lt;br /&gt;
'''''Não escolha palavras-passe compostas por: qualquer palavra que possa ser encontrada num dicionário, em qualquer língua (por exemplo, avião), uma palavra de dicionário com algumas letras simplesmente substituídas por números (por exemplo, a1rplan3 ou aer0plan0), um caracter repetido ou uma série de caracteres (por exemplo, AAAAA ou 12345), uma série de caracteres de teclado (por exemplo, qwerty ou qazwsx) ou qualquer coisa que esteja escrita e guardada algures perto do seu computador'''''&lt;br /&gt;
&lt;br /&gt;
'''''O seu nome de utilizador e a palavra-passe são dos principais mecanismos de defesa contra o acesso não autorizado e adulteração. Ter nomes de utilizador fáceis de adivinhar, senhas fracas ou que sejam conhecidas publicamente afeta gravemente a segurança dos seus dispositivos e da sua rede.'''''&lt;br /&gt;
&lt;br /&gt;
*Adicione o novo utilizador aos grupos do sistema&lt;br /&gt;
&lt;br /&gt;
Comece por identificar os grupos dos quais o utilizador ''pi'' original é membro, executando o comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O comando produzirá três listas no formato ''número(texto)''. Mantenha este output no ecrã. Escreva, mas não execute, o seguinte comando:&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;
A partir do resultado do comando anterior, selecione a lista após ''groups='', exceto o primeiro elemento, clicando e arrastando com o rato sobre o texto. Copie-o para a linha de comando, clicando no botão do meio do rato depois de selecionar o texto. Edite o comando atual utilizando as setas do teclado para mover o cursor e retirar os números e parênteses, mas mantendo o texto e as vírgulas. Acrescente o nome do utilizador que está a ser criado no fim do comando. O comando final deve ter o seguinte formato:&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;
Confirme que o utilizador foi adicionado aos grupos do sistema com sucesso executando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depois de ''groups='', deverá encontrar os mesmos grupos que acima. '''Não continue antes que estes surjam'''.&lt;br /&gt;
&lt;br /&gt;
*Saia do RPi e inicie sessão utilizando o novo utilizador&lt;br /&gt;
&lt;br /&gt;
*Apague a conta do utilizador ''pi''&lt;br /&gt;
&lt;br /&gt;
O utilizador ''pi'' padrão ainda existe no sistema. Manter esta conta ativa é uma vulnerabilidade de segurança. Apague-a executando:&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;
*A fim de configurar a rede onde o RPi será ligado, muitas vezes é útil conhecer o [https://en.wikipedia.org/wiki/MAC_address endereço MAC] do adaptador de rede. Execute o seguinte comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ifconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se planear ligar a experiência via cabo Ethernet, copie o campo ''ether'' na entrada ''eht0''. Se ligar via ligação sem fios, copie o campo ''ether'' na entrada ''wlan0''.&lt;br /&gt;
&lt;br /&gt;
*Se planear utilizar uma ligação VPN para gerir experiências controladas remotamente, é também uma boa altura para enviar os ficheiros necessários para o RPi. Ao fazê-lo, assegura que as chaves continuarão secretas, uma vez que são enviadas através do cabo que liga o seu computador ao RPi. Se utilizar o RPi com teclado e monitor, considere desligá-lo e escrever os ficheiros diretamente no cartão SD, inserindo-o num computador. A configuração VPN é altamente dependente do seu ''setup'', pelo que deve ser completada caso a caso.&lt;br /&gt;
&lt;br /&gt;
*Se não o fizer, desligue o RPi. Espere que o LED verde no RPi pare de piscar antes de desligar a fonte de alimentação. Mova-o para a sua localização permanente, ligando-o à infraestrutura eletrónica e de rede da experiência.&lt;br /&gt;
&lt;br /&gt;
*Ligue o RPi, ligando a fonte de energia. Deve obter um endereço de IP da sua rede válido. A configuração da rede e da firewall é altamente dependente da sua infraestrutura de rede específica. Se as instruções acima foram seguidas, o RPi está configurado para aceitar ofertas de aluguer de IP DHCP. Para que o servidor de hardware e a transmissão de vídeo possam funcionar, o RPi deve ser capaz de comunicar&lt;br /&gt;
&lt;br /&gt;
*Inicie a sessão e atualize o software no RPi, executando sucessivamente os seguintes comandos:&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;
O último comando pode demorar algum tempo a completar-se. Enquanto isso, '''''NÃO DESCONECTE O RPi DA FONTE ALIMENTAÇÃO. SE O FIZER, MUITO PROVAVELMENTE CORROMPERÁ O CARTÃO SD E TERÁ DE COMEÇAR DE NOVO.''''' &lt;br /&gt;
&lt;br /&gt;
*Reinicie o RPi para assegurar que o software mais recente está a funcionar. Volte a entrar.&lt;br /&gt;
&lt;br /&gt;
*Instale o software necessário para o servidor de hardware e para a transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Para o servidor de hardware, deve ser instalado o seguinte software:&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;
Para a transmissão de vídeo, podem ser utilizados vários programas. O modo recomendado é utilizar o  GStreamer e as suas bibliotecas, visto que suportam o ''enconding'' de hardware de vídeo no RPi. Pode ser instalado através do seguinte comando:&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;
Se necessário, instale também o software para a ligação VPN. Por exemplo, o cliente ''openvpn'' seria instalado através do comando:&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;
Agora que a VPN está instalada, complete a sua configuração com os ficheiros transferidos para o RPi na última etapa.&lt;br /&gt;
&lt;br /&gt;
Note que o gestor do software irá sugerir pacotes extra, na sua maioria dependências dos que foram referidos explicitamente para instalar. Aceite quaisquer pacotes extra sugeridos.&lt;br /&gt;
&lt;br /&gt;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4317</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4317"/>
		<updated>2021-08-26T11:52:27Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Sistema Operativo do RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no MacOS Catalina/Mojave/High Sierra e ligação ao RPi =====&lt;br /&gt;
*A Apple fornece [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento para a configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi selecionada, este campo pode ser preenchido com ''123.123.123.124'', e o campo  ''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas.&lt;br /&gt;
*Se não o tiver feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Para tal, basta ligar uma extremidade do cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*O símbolo da rede deve agora mostrar a ligação como estando concluída&lt;br /&gt;
*MacOS inclui um cliente SSH client na instalação predefinida do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador, e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que a configuração sugerida foi adotada, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e ''123.123.123.123'' , uma vez que nos estamos a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com ''123.123.123.123''. Tente voltar a ligar utilizando novamente o comando SSH. Surgirá um aviso que indica que se trata de um computador novo, desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi|Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
=== Configuração do Sistema Operativo do RPi ===&lt;br /&gt;
Depois de instalado, o SO precisa de ser configurado. As próximas instruções devem ser seguidas no prompt terminal. Se estiver a utilizar um teclado e monitor ligados ao RPi e instalado um SO com IGU, por favor abra um emulador terminal.&lt;br /&gt;
&lt;br /&gt;
Primeiro, proceda à configuração geral do sistema carregando o utilitário raspi-config, ao executar o comando:&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;
Quando solicitado, introduza a senha do utilizador ''pi''. Pode navegar no menu usando as teclas de Seta para seleção, tecla Escape para retroceder nos menus e Enter para selecionar a entrada em destaque.&lt;br /&gt;
&lt;br /&gt;
*A opção ''1 Change User Password'' pode ser ignorada, uma vez que o utilizador ''pi'' será apagado mais tarde.&lt;br /&gt;
&lt;br /&gt;
*Na opção ''2 Network Options'' é possível definir o ''Hostname'' (Nome do Anfitrião) e configurar uma ligação ''Wi-fi''&lt;br /&gt;
&lt;br /&gt;
O ''Hostname'' é o nome atribuído ao RPi e não tem qualquer significado especial. É útil porque facilita o reconhecimento do computador com base apenas no nome. &lt;br /&gt;
&lt;br /&gt;
A entrada ''Wi-fi'' permite a configuração de uma rede Wi-Fi introduzindo o SSID (nome da rede) e a palavra-passe da rede. Este diálogo só funciona para esquemas WEP, WPA e WPA2. O WPA-entreprise deve ser configurado manualmente através do [https://w1.fi/wpa_supplicant/ wpa_supplicant].&lt;br /&gt;
&lt;br /&gt;
Ignore as restantes entradas, a não ser que tenha a certeza das alterações que estará a realizar. &lt;br /&gt;
&lt;br /&gt;
*Em ''3 Boot Options'', a entrada ''Desktop / CLI'' é a que seleciona se o RPi arranca num ambiente IGU ou num prompt de comando; a entrada ''Wait for Network at Boot'' se espera pela ligação à rede antes de completar o arranque e a ''Splash Screen'' se mostra uma imagem ou um texto de depuração durante o arranque.&lt;br /&gt;
&lt;br /&gt;
Tenha em atenção que a entrada ''Desktop / CLI'' só produz efeitos se tiver previamente instalado uma versão do Raspbian com IGU ou tiver instalado entretanto uma IGU na versão ''lite''.&lt;br /&gt;
&lt;br /&gt;
Estas configurações são seguras para aplicar consoante o que os utilizadores pretendem.&lt;br /&gt;
&lt;br /&gt;
*Em ''4 Localisation Options'', a entrada ''Change Locale'' permite configurar o RPi de modo a que a língua, e outros elementos de localização, tais como o formato da hora e da data, o nome dos dias da wiki, a moeda, etc., estejam de acordo com a localização do utilizador RPi; a entrada ''Change Timezone'' permite configurar o fuso horário local, para que o RPi mostre a hora e a data corretas; ''Change Keyboard Layout'' permite configurar o teclado para que as teclas digitadas no teclado físico coincidam com as que aparecem no ecrã, e a entrada ''Change Wi-fi Country'' configura o RPi para que este comunique nas frequências wi-fi corretas de acordo com as leis locais.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Keyboard Layout'' só é importante se o RPi for utilizado com um teclado que lhe está diretamente ligado. Os utilizadores ligados através do SSH não precisam de configurar o teclado.&lt;br /&gt;
&lt;br /&gt;
A entrada ''Change Wi-fi Country'' deve ser utilizada se se pretender configurar uma ligação Wi-fi. Uma configuração errada pode resultar seja numa ligação não operacional, uma vez que o RPi tentará comunicar em frequências diferentes dos restantes dispositivos Wi-fi locais, seja em questões legais para o utilizador por transmitir em frequências proibidas.&lt;br /&gt;
&lt;br /&gt;
*Em ''5 Interfacing Options'', as entradas permitem ativar/desativar os vários serviços listados. Todos devem ser desativados, excepto os serviços ''SSH'' e/ou [https://en.wikipedia.org/wiki/Virtual_Network_Computing ''VNC''], a interface ''Serial'' e o acesso ''Remote GPIO''&lt;br /&gt;
&lt;br /&gt;
Note que o serviço VNC só funcionará se for instalada uma IGU no sistema. Caso contrário, só poderá ser ativado o serviço ''SSH''.&lt;br /&gt;
&lt;br /&gt;
A activação do serviço  ''SSH'' torna desnecessário criar o ficheiro ssh em disco, tal como descrito anteriormente. Este estará disponível em cada arranque até ser novamente desativado.&lt;br /&gt;
&lt;br /&gt;
Na entrada ''Serial'', selecione ''No'' se a ''login shell'' deve estar disponível em série e ''Yes'' se o hardware da porta-série deve ser ativado.&lt;br /&gt;
&lt;br /&gt;
*Ignore as restantes opções, exceto a opção ''Expand Filesystem'' disponível na entrada ''Advanced Options''.&lt;br /&gt;
&lt;br /&gt;
*Saia do utilitário selecionando ''Finish'' e, quando solicitado, permita que o RPi seja reiniciado selecionando ''yes''. Se estiver ligado via SSH, a ligação será terminada automaticamente.&lt;br /&gt;
&lt;br /&gt;
*Aguarde que o RPi reinicie completamente. Não desligue o cabo de alimentação do RPi.&lt;br /&gt;
&lt;br /&gt;
*Quando o LED verde deixar de piscar, o processo está completo. Inicie a sessão no RPi como anteriormente.&lt;br /&gt;
&lt;br /&gt;
'''Antes''' de ligar o RPi à Internet, deve ser criado um novo utilizador e o utilizador predefinido deve ser eliminado. '''''Uma vez que todas as novas instalações de SO Raspbian têm o mesmo utilizador e a palavra-passe padrão que  [https://www.raspberrypi.org/documentation/linux/usage/users.md todos podem encontrar na Internet], mantê-los disponíveis no SO é uma vulnerabilidade de segurança muito grave. Desta forma, qualquer pessoa é livre de tentar entrar no seu RPi e, tendo sucesso, assumir o controlo do sistema.'''''&lt;br /&gt;
&lt;br /&gt;
Os seguintes comandos criam um utilizador chamado ''newton''. Podem, e devem, ser ser escolhidos outros nomes de utilizador  aquando da configuração do RPi. ''newton'' está apenas a ser utilizado como exemplo &lt;br /&gt;
*Crie o utilizador ''newton''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
sudo useradd newton&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Introduza a palavra-passe do utilizador ''pi'' quando solicitada. Use a mesma palavra-passe que utiliza para iniciar sessão. Isto iniciará o processo de criação do utilizador onde uma nova palavra-passe para o novo utilizador será solicitada. Escolha uma nova palavra-passe, diferente da palavra-passe de utilizador ''pi'' padrão'''''. Ao escolher a nova palavra-passe, note que:'''''&lt;br /&gt;
&lt;br /&gt;
'''''As senhas fortes têm pelo menos 8 caracteres, uma mistura de letras maiúsculas e minúsculas, uma mistura de letras e números e incluem, pelo menos, um carácter especial, por exemplo, ! @ # ? ].'''''&lt;br /&gt;
&lt;br /&gt;
'''''Uma palavra-passe forte é difícil de adivinhar mas deve ser fácil de lembrar. Uma palavra-passe que tem de ser escrita não é forte, por mais que sejam as suas características acima mencionadas. '''''&lt;br /&gt;
&lt;br /&gt;
'''''Não escolha palavras-passe compostas por: qualquer palavra que possa ser encontrada num dicionário, em qualquer língua (por exemplo, avião), uma palavra de dicionário com algumas letras simplesmente substituídas por números (por exemplo, a1rplan3 ou aer0plan0), um caracter repetido ou uma série de caracteres (por exemplo, AAAAA ou 12345), uma série de caracteres de teclado (por exemplo, qwerty ou qazwsx) ou qualquer coisa que esteja escrita e guardada algures perto do seu computador'''''&lt;br /&gt;
&lt;br /&gt;
'''''O seu nome de utilizador e a palavra-passe são dos principais mecanismos de defesa contra o acesso não autorizado e adulteração. Ter nomes de utilizador fáceis de adivinhar, senhas fracas ou que sejam conhecidas publicamente afeta gravemente a segurança dos seus dispositivos e da sua rede.'''''&lt;br /&gt;
&lt;br /&gt;
*Adicione o novo utilizador aos grupos do sistema&lt;br /&gt;
&lt;br /&gt;
Comece por identificar os grupos dos quais o utilizador ''pi'' original é membro, executando o comando:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
id&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O comando produzirá três listas no formato ''número(texto)''. Mantenha este output no ecrã. Escreva, mas não execute, o seguinte comando:&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;
A partir do resultado do comando anterior, selecione a lista após ''groups='', exceto o primeiro elemento, clicando e arrastando com o rato sobre o texto. Copie-o para a linha de comando, clicando no botão do meio do rato depois de selecionar o texto. Edite o comando atual utilizando as setas do teclado para mover o cursor e retirar os números e parênteses, mas mantendo o texto e as vírgulas. Acrescente o nome do utilizador que está a ser criado no fim do comando. O comando final deve ter o seguinte formato:&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;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly&amp;diff=4316</id>
		<title>Precision Pendulum Assembly: Mechanical assembly</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Mechanical_assembly&amp;diff=4316"/>
		<updated>2021-08-25T13:57:36Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Maintenance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mechanical assembly=&lt;br /&gt;
&lt;br /&gt;
In this section is described the procedure to assemble the tripod metallic structure also known as ''Primary Pendulums''.&lt;br /&gt;
&lt;br /&gt;
==Order of assembly and filling with sand==&lt;br /&gt;
&lt;br /&gt;
# Screw the three plastic base support under the triangular base and level the base with the help of a spirit level;&lt;br /&gt;
# Fit together the three lower sections of each leg following the numeration presented in the figure below;&lt;br /&gt;
# Fix each one of the legs to the triangular base by tightening the provided screw and taking into account the letters &amp;quot;E&amp;quot; and &amp;quot;D&amp;quot;, as shown in the figure below leaving the screws a bit loosy;&lt;br /&gt;
# Fill the legs with sand while the whole structure is standing in the vertical (use a table or step ladder);&lt;br /&gt;
# Fit the last section of each leg following the numeration;&lt;br /&gt;
# Fit the aluminum top plate and tighten it slightly to each one of the legs using the screws;&lt;br /&gt;
# To check that both top plate and base triangle are aligned, one can lean the whole structure against a wall and adjust the top plate in accordance if necessary. Once both aligned, firmly tighten the screws of the (i) bottom triangle followed by the (ii) top plate;&lt;br /&gt;
# Pass the bob cable and fix it in such position that the equatorial plane crosses the photo-gate, as shown in the schematic below (Horizontal view);&lt;br /&gt;
# Align the whole structure (regulating the height of the three pads touching the floor) so that the horizontal rest position of the ball relatively to the laser beam is as specified in the schematic below (view from top);&lt;br /&gt;
# Having the bob at rest, start the pendular movement by slowly excite the fulcrum in the top;&lt;br /&gt;
# With the help of a flashlight in the front of the shovel and putting a white paper on the shovel other end adjust the horizontal tilt screws in order to have the launcher platform aligned with the plane of oscillation. This can be seen easily if the shadow center of the bob do not move horizontally.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:TripodMetallicAss_BaseWFeet.jpg|x400px|Base of the metallic structure]] &lt;br /&gt;
|[[File:structure_assembly_procedure_crop.png|x400px|Structure assembly procedure]]&lt;br /&gt;
|[[File:TripodMetallicAss_FillingSand.jpg|x400px|Fill the legs with sand]]&lt;br /&gt;
|[[File:TripodMetallicAss_TopPart.jpg|x400px|Top]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Ball and laser equatorial plane.png|x250px|Top|Frontal view of the laser alignment]]&lt;br /&gt;
|[[File:Ball and laser relative position.png|x250px|Top|Top view of the laser alignment]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Wall mount assembly==&lt;br /&gt;
&lt;br /&gt;
The simplified version of the pendulum is delivered as a toolkit to be fixed in a masonry or concrete wall. It do not include the tripod and consists on the launcher with shovel and the top holder to sustain the fulcrum.&lt;br /&gt;
&lt;br /&gt;
The main aspects to retain on the fixture is (i) to have all structure completely tied-up and firmly secured, (ii) the launcher perfectly horizontal and (iii) aligned with the natural plane of oscillations (please refer to previous sub-section &amp;quot;Order of assembly&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Maintenance==&lt;br /&gt;
The main components of the launcher should not need any maintenance; do not lubricate any part except the rail in case it gets sticky. For that end it should be disassembled, clean with a soft tissue and alcohol and lubricated lightly with a very small amount of grease or vaseline on the linear bearing. Check if every rolling sphere is working properly.&lt;br /&gt;
&lt;br /&gt;
If the shovel's cable (over the rail) broke it has to be substituted by a steel cable with a track capability of 250 N, typically found as fish lines of 25m coils. If the location is in a hard climate were corrosion show-up it can be replaced by an equivalent dyneema cable.&lt;br /&gt;
&lt;br /&gt;
Please let it have two turns on the motor's shaft. Although the string position is not critical we have found that in some situations is preferable to have it between the shovel and the motor. Nevertheless never use a high tension on the cable as it can jeopardize the fast movement of the shovel. Usually 2-5 N should be enough to avoid slipping in the shaft.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Apparatus description |Previous Page (Apparatus description)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Precision Pendulum Assembly: Electrical interfaces|Next Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Montagem mecânica |Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: ensamble mecanico |Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica&amp;diff=4315</id>
		<title>Montagem do Pêndulo de Precisão: Montagem mecânica</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Montagem_mec%C3%A2nica&amp;diff=4315"/>
		<updated>2021-08-25T13:57:07Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Montagem mecânica=&lt;br /&gt;
&lt;br /&gt;
Nesta secção é descrito o procedimento de montagem do tripé metálico, também conhecido como ''Pêndulos Primários''.&lt;br /&gt;
&lt;br /&gt;
==Ordem de montagem e enchimento com areia==&lt;br /&gt;
&lt;br /&gt;
# Aparafusar as três bases de plástico por baixo da base triangular e nivelar a base com o auxílio de um nivel de bolha;&lt;br /&gt;
# Encaixar as três secções inferiores de cada perna seguindo a numeração apresentada na figura abaixo;&lt;br /&gt;
# Fixar cada uma das pernas à base triangular apertando o parafuso fornecido e levando em consideração as letras &amp;quot;E&amp;quot; e &amp;quot;D&amp;quot;, como mostra a figura abaixo, deixando os parafusos um pouco frouxos;&lt;br /&gt;
# Encher as pernas com areia com a estrutura em pé, na vertical (usar uma mesa ou escada);&lt;br /&gt;
# Ajustar a última secção de cada perna seguindo a numeração;&lt;br /&gt;
# Encaixar a placa superior de alumínio e apertar os parafusos levemente em cada uma das pernas;&lt;br /&gt;
# Para verificar se a placa superior e a base triângular estão alinhados, pode-se encostar toda a estrutura contra uma parede e ajustar a placa superior conforme necessário. Depois de ambos alinhados, apertar firmemente os parafusos do (i) triângulo inferior, seguido da (ii) placa superior;&lt;br /&gt;
# Passar o cabo do pêndulo e fixá-lo de forma a que o plano equatorial cruze a porta fotoelétrica, conforme mostra o esquema abaixo (vista horizontal);&lt;br /&gt;
# Alinhar toda a estrutura (regulando a altura das três almofadas que ficam em contacto com o chão) de forma a que a posição de descanso horizontal da bola, em relação ao feixe de laser, seja conforme especificado no esquema abaixo (vista de cima);&lt;br /&gt;
# Com o pêndulo em repouso, iniciar o movimento pendular movendo lentamente o fulcro no topo;&lt;br /&gt;
# Com o auxílio de uma lanterna na frente da pá e colocando um papel branco na sua outra ponta, ajustar os parafusos de inclinação horizontal para que a plataforma do lançador fique alinhada com o plano de oscilação. Isso pode ser visto facilmente se o centro da sombra do pêndulo não se mover horizontalmente.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:TripodMetallicAss_BaseWFeet.jpg|x400px|Base da estrutura metálica]] &lt;br /&gt;
|[[File:structure_assembly_procedure_crop.png|x400px|Procedimento da montagem da estrutura]]&lt;br /&gt;
|[[File:TripodMetallicAss_FillingSand.jpg|x400px|Colocação da areia nas pernas]]&lt;br /&gt;
|[[File:TripodMetallicAss_TopPart.jpg|x400px|Topo]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Ball and laser equatorial plane.png|x250px|Top|Vista frontal do alinhamento do laser]]&lt;br /&gt;
|[[File:Ball and laser relative position.png|x250px|Top|Vista de topo do alinhamento do laser]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Montagem do pêndulo numa parede==&lt;br /&gt;
&lt;br /&gt;
A versão simplificada do pêndulo é fornecida como um kit de ferramentas para ser fixado numa parede de alvenaria ou de cimento. Não inclui o tripé e consiste num lançador com pá e num suporte superior para sustentar o fulcro.&lt;br /&gt;
&lt;br /&gt;
Os principais aspectos a reter na fixação são (i) ter toda a estrutura completamente amarrada e fixa firmemente, (ii) ter o lançador perfeitamente horizontal e (iii) alinhado com o plano natural das oscilações (consultar a subsecção anterior &amp;quot;Ordem de montagem&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Manutenção==&lt;br /&gt;
Os principais componentes do lançador não devem precisar de manutenção; não lubrificar nenhuma parte, exceto a calha, caso esta fique pegajosa. Para isso, deve ser desmontada, limpa com um pano macio e álcool e lubrificada levemente com uma quantidade muito pequena de graxa ou vaselina. Verificar se todas as esferas rolantes funcionam corretamente.&lt;br /&gt;
&lt;br /&gt;
Se o cabo da pá (sobre o calha) se partir, este deve ser substituído por um cabo de aço com capacidade de 250 N, normalmente encontrado em linhas de pesca com bobinas de 25m. Se o pêndulo se encontrar num clima difícil onde a corrosão se manifesta facilmente, este cabo pode ser substituido por um cabo 'dyneema' equivalente.&lt;br /&gt;
&lt;br /&gt;
Sugerimos dar duas voltas no eixo do motor. Embora a posição da coluna não seja crítica, descobrimos que em algumas situações é preferível colocá-la entre a pá e o motor. No entanto, nunca usar uma tensão elevada no cabo, pois pode comprometer o movimento rápido da pá. Normalmente, 2-5 N deve ser suficiente para evitar escorregar no eixo.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Descrição do aparato|Página Anterior (Descrição do aparato)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Interfaces elétricas|Página Seguinte (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Mechanical assembly |Versão em inglês (English Version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: ensamble mecanico |Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas&amp;diff=4314</id>
		<title>Montagem do Pêndulo de Precisão: Interfaces elétricas</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Interfaces_el%C3%A9tricas&amp;diff=4314"/>
		<updated>2021-08-25T13:56:42Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Interfaces elétricas==&lt;br /&gt;
Esta secção descreve os componentes elétricos usados para operar o aparato experimental. De forma geral, cada lançador consiste em:&lt;br /&gt;
* um Raspberry Pi (ou computador com Linux): faz a interface entre o microcontrolador e o Homem (por exemplo, por conexão direta a uma consola) ou servidor de e-lab via Internet.&lt;br /&gt;
* um microcontrolador (dsPic): faz a interface entre os componentes elétricos (incluindo o motor de passo) e o computador.&lt;br /&gt;
* componentes elétricos complementares: laser, microinterruptor, sensor fotoeléctrico (também conhecido como fotodiodo), lâmpada, sensor de temperatura e display de 7 dígitos.&lt;br /&gt;
Consulte [[#Elementos |Elementos]] para uma descrição detalhada. Estes componentes são a interface entre o aparato experimental e o microcontrolador, ao mesmo tempo que fornecem tanto formas de controlar o pêndulo como recursos de medição.&lt;br /&gt;
&lt;br /&gt;
Veja a subsecção [[#Conexões |Conexões]] para detalhes sobre como conectar os componentes elétricos.&lt;br /&gt;
&lt;br /&gt;
[[File:ComparisonPhotodiodeLDR.png|thum|Comparação do erro de dispersão entre um fotodiodo (StDev = 0,002) e um fotodetector LDR (StDev = 0,006) devido à taxa de variação.|right|border|180px]]&lt;br /&gt;
&lt;br /&gt;
O sensor fotoeléctrico/fotodiodo e o alinhamento do laser são descritos na subseção [[# Fotodiodo e alinhamento do laser |Fotodiodo e alinhamento do laser]]. Mais particularmente, os fotodiodos foram escolhidos devido às suas características de transição mais rápida, reduzindo o seu jitter geral e, consequentemente, o erro aleatório. &lt;br /&gt;
&lt;br /&gt;
Isto deve ser executado somente após ter sido ligado o microcontrolador. Leia a secção [[#Consola de interface para o microcontrolador | Consola de interface para o microcontrolador]] primeiro.&lt;br /&gt;
&lt;br /&gt;
===Elementos===&lt;br /&gt;
Esta subsecção descreve os diferentes elementos elétricos da experiência:&lt;br /&gt;
* '''Raspberry Pi (RPi)''': Dispositivo que executa o Linux para permitir a conexão remota com a experiência, bem como uma forma simples de interagir com o microcontrolador. O microcontrolador e as conexões dos cabos planos correspondentes são projetados para o Raspberry Pi 3 modelo B, que possui as conexões de pinagem conforme descrito em https://www.raspberrypi.org/documentation/usage/gpio. O Raspberry Pi também é usado para alimentar o microcontrolador, como tal, deve ser usada uma fonte de alimentação de +5 V com pelo menos 2,5 A.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_1.png|x100px]]&lt;br /&gt;
|[[File:rpi_ps_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Cartão SD''': O cartão SD vem com o sistema operacional Linux e todos os programas adicionais necessários. Deve ser um cartão industrial com especificações robustas.&lt;br /&gt;
* '''Placa do microcontrolador''': Esta placa contem um microcontrolador (dsPic33F) tal como todos os componentes periféricos necessários para o controlo da experiência. A placa pode ser alimentada usando um cabo plano conectado ao Raspberry Pi ou por uma conexão USB (um jumper integrado é usado para selecionar a fonte de alimentação, a posição padrão corresponde à do cabo plano/fonte Raspberry). A placa contem 4 LEDs: 2 vermelhos, 1 azul e 1 verde. Os LEDs vermelhos indicam se a alimentação está conectada à placa. Observando as figuras abaixo, o LED vermelho da esquerda corresponde aos +5V que alimentam a placa do microcontrolador. O LED vermelho da direita corresponde aos +12V que alimentam o motor de passo. Os LEDs azul e verde (no topo da figura) são usados para a saída de informação pelo microcontrolador durante o tempo de execução da experiência. O LED azul (esquerda) acende quando o microinterruptor é pressionado, i.e., quando a pá está na posição de origem. O LED verde (direita) acende quando fotodiodo está activo (a conduzir), i.e., quando é acionado pelo laser. Os LEDs azul e verde também são usados ​​para dois outros casos: (i) no arranque e (ii) para indicar que o microcontrolador está em estado de erro. No arranque, os LEDs piscam 5 vezes com um período de 400ms e em estados alternados (quando o LED azul está LIGADO, o LED verde está DESLIGADO e vice-versa). Para indicar um estado de erro, os LEDs piscam por um período de cerca de 2s.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:dspic_board_closed.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_open.png|x100px]]&lt;br /&gt;
|[[File:dspic_board_closed_LEDs.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_blue.jpg|x100px]]&lt;br /&gt;
|[[File:dspic_board_LEDs_green.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Webcam''': A webcam é usada para fornecer streaming de vídeo ao vivo durante a execução da experiência. É conectada ao Raspberry Pi por meio de um cabo USB. O RPi realiza a codificação e envia esta informação pela Internet.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:webcam.png|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Lâmpada''': A lâmpada consiste numa lâmpada LED de 12 V localizada acima do lançador. Esta lâmpada acende durante a execução da experiência para iluminar o pêndulo e o lançador (especialmente útil se a experiência for realizada durante a noite).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:light_bulb.png|x125px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Motor de passo''': O motor de passo é parte do lançador e é controlado pelo microcontrolador através de um ''quad 1/2 H bridge driver''. O motor de passo é responsável pelo deslocamento da pá.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:step_motor_1.png|x100px]]&lt;br /&gt;
|[[File:step_motor_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Microinterruptor''': O microinterruptor está localizado na origem, próximo dos 0cm da escala métrica do lançador. É usado para indicar ao microcontrolador que a pá atingiu a origem e não pode avançar mais no sentido inverso (fim do seu percurso).&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ms_1.png|x100px]]&lt;br /&gt;
|[[File:ms_2.png|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Laser''': O laser está localizado aproximadamente no centro do lançador. Em conjunto com o fotodiodo, o laser é usado para medir o período de oscilação bem como a localização da pá. Este laser possui uma regulação para o foco, pode ser ajustado girando a lente.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:laser_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:Laser_2_crop.jpeg|x100px]]&lt;br /&gt;
|[[File:Laser_3_crop.jpeg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Sensor fotoeléctrico (também conhecido como fotodiodo)''': Está localizado na frente do laser. O pêndulo viaja entre estes interrompendo a luz do laser periodicamente, o que resulta numa mudança de estado no pino de entrada do microcontrolador. Assim, sabendo o seu diâmetro de antemão, é possível medir o período do pêndulo e a sua velocidade. '' NOTA '': Evite a luz solar direta ou áreas extremamente luminosas na frente deste sensor.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ph_gate_1.jpg|x100px]]&lt;br /&gt;
|[[File:ph_gate_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Sensor de temperatura''': Está localizado na caixa DB25 para medir a temperatura ambiente. A temperatura ambiente influencia o comprimento do pêndulo. Portanto, é importante monitorizá-la para medições de alta precisão.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:temp_sensor_1.jpg|x100px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Display''': O display de 7 dígitos mostra o número total acumulado de oscilações. Consiste em 8 dígitos, cada um deles com um display de 7 segmentos. Algumas das versões da placa do microcontrolador permitem a ligação do display diretamente à placa a partir do exterior da caixa.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:display_loose_crop.jpg|x100px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Fonte de alimentação''': O motor de passo requer uma fonte de alimentação externa de +12V capaz de fornecer 2A.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:ps_1_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_2_crop.jpg|x100px]]&lt;br /&gt;
|[[File:ps_3_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Botão Iniciar''': Permite iniciar localmente uma experiência com uma configuração predefinida (deslocamento inicial de 10 cm, 20 oscilações). Deve ser usado um cronómetro externo como complemento para fornecer o tempo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x100px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Conexões===&lt;br /&gt;
Esta subsecção mostra como estão conectados entre si os componentes e os cabos. &lt;br /&gt;
* '''RPi''': O Raspberry Pi liga-se aos elementos seguintes:&lt;br /&gt;
** Fonte de alimentação (via conector micro USB)&lt;br /&gt;
** Internet (via cabo Ethernet)&lt;br /&gt;
** Webcam (via cabo USB)&lt;br /&gt;
** Placa do microcontrolador (via cabo plano dedicado)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:rpi_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Cabo plano dedicado''': Estabelece a ligação entre a placa do microcontrolador (dsPic), o RPi e o monitor. No lado do microcontrolador, o cabo possui um conector DB25.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
No lado do RPi, o cabo é um conector de 2x20 pinos para garantir uma conexão correta, como se pode observar nas figuras abaixo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_rpi_1_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_2_crop.jpg|x150px]]&lt;br /&gt;
|[[File:flat_cable_rpi_3_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade do display, o conector é um conector 1x5. Certifique-se de que o lado do conector é o correto antes de ligar ao display: o pino VCC do display conecta-se ao fio que está destacado (neste caso, com um traço azul). A figura abaixo, do lado esquerdo, ilustra o referido. Algumas versões permitem que o monitor seja conectado diretamente à caixa do microcontrolador. Nesses casos, o display deve ser conectado conforme se pode observar abaixo, no lado direito.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:flat_cable_display_crop.jpg|x150px]]&lt;br /&gt;
|[[File:display_fixed_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Micro-controlador''': A placa dsPic conecta-se aos seguintes elementos:&lt;br /&gt;
** Fonte de alimentação de +12 V para alimentar o motor de passo&lt;br /&gt;
** RPi (via cabo plano)&lt;br /&gt;
** Componentes elétricos (via multicabo dedicado)&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Dspic_board_closed_crop_connections.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
* '''Multi-cabo dedicado''': O multi-cabo conecta a placa dsPic aos componentes elétricos usados para realizar a experiência. O cabo possui um conector DB25 na extremidade da placa dsPic conforme mostrado na figura abaixo.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_DB25_crop.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade da lâmpada, do micro-interruptor, do laser e do sensor fotoelétrico, o multicabo tem um conector de 2 pinos, conforme mostrado nas figuras seguintes:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_light_bulb_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_ms_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_laser_crop.jpg|x75px]]&lt;br /&gt;
|[[File:multi_cable_photogate_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
Na extremidade do motor de passo, o multicabo possui um conector de 4 pinos. Visto que este é o único conector de 4 pinos, não é identificado como os restantes, como se pode observar na figura abaixo:&lt;br /&gt;
{|&lt;br /&gt;
|[[File:multi_cable_step_motor_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
O botão Iniciar e o sensor de temperatura são conectados diretamente ao conector DB25. Desta forma, não são necessários conectores intermediários.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:push_button_crop.jpg|x75px]]&lt;br /&gt;
|[[File:temp_sensor_2_crop.jpg|x75px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Fotodiodo e alinhamento do laser===&lt;br /&gt;
O fotodiodo e o alinhamento do laser só podem ser executados depois de o microcontrolador ser ligado e estiver a comunicar com uma consola. Consulte a subsecção [[# Consola de interface para o microcontrolador  | Consola de interface para o microcontrolador ]] para saber como ligar o microcontrolador e como controlar o laser.&lt;br /&gt;
Como se pode observar na figura abaixo, à esquerda, o alinhamento consiste em apontar o laser para dentro do orifício da estrutura do sensor fotoelétrico. A orientação do laser pode ser ajustada utilizando os 3 parafusos da estrutura de suporte, como ilustra a seguinte figura ao centro.&lt;br /&gt;
&lt;br /&gt;
O procedimento para o alinhamento consiste no seguinte:&lt;br /&gt;
# Ligue o laser usando o comando &amp;quot;Laser on&amp;quot;&lt;br /&gt;
# Verifique com a ajuda de um lençol branco se a dimensão do foco do laser está abaixo de 1mm no fotodíodo; caso contrário, deve ser ajustado aparafusando o laser.&lt;br /&gt;
# Se necessário, ajuste a orientação do laser de forma a que o feixe entre no orifício do sensor fotoelétrico (figura à esquerda). A figura à direita mostra um exemplo de desalinhamento.&lt;br /&gt;
# Realize o [[#Teste do laser e do sensor fotoeléctrico | Teste do laser e do sensor fotoeléctrico]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Laser_in_photogate_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_structure_3_screws_crop.jpg|x200px]]&lt;br /&gt;
|[[File:Laser_out_photogate_crop.jpg|x200px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Testes elétricos===&lt;br /&gt;
* Teste o microinterruptor com a ajuda de um multímetro (ohmímetro): quando pressionado, deve apresentar uma impedância muito baixa (~ 0 Ohm). Em caso contrário, deve apresentar uma impedância muito alta (ordem de MOhm), e realize a medição tanto no microinterruptor e como nos pinos DB25 (entre os pinos nº3 e 4)&lt;br /&gt;
* Verifique a tensão da fonte de alimentação do motor de passo para garantir que não é superior a +12 V.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Montagem mecânica| Página Anterior (Montagem mecânica)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[Montagem do Pêndulo de Precisão: Gestão de software| Página Seguinte (Gestão de software)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Electrical interfaces | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Interfaces eléctricas  | Versão espanhola (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4313</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4313"/>
		<updated>2021-08-25T13:49:28Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no MacOS Catalina/Mojave/High Sierra e ligação ao RPi =====&lt;br /&gt;
*A Apple fornece [https://support.apple.com/guide/mac-help/use-dhcp-or-a-manual-ip-address-on-mac-mchlp2718/mac instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento para a configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi selecionada, este campo pode ser preenchido com ''123.123.123.124'', e o campo  ''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas.&lt;br /&gt;
*Se não o tiver feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Para tal, basta ligar uma extremidade do cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*O símbolo da rede deve agora mostrar a ligação como estando concluída&lt;br /&gt;
*MacOS inclui um cliente SSH client na instalação predefinida do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador, e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que a configuração sugerida foi adotada, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e ''123.123.123.123'' , uma vez que nos estamos a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com ''123.123.123.123''. Tente voltar a ligar utilizando novamente o comando SSH. Surgirá um aviso que indica que se trata de um computador novo, desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi|Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
=== Configuração do Sistema Operativo do RPi ===&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;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4312</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4312"/>
		<updated>2021-08-25T13:33:58Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Network tools and utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 | 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 and utilities ===&lt;br /&gt;
The connectivity of the computer were the hardware server will be installed can be tested and verified 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 test the port access to elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which has admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4311</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4311"/>
		<updated>2021-08-25T13:33:34Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Network tools and utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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;
=== Ferramentas e utilitários de rede ===&lt;br /&gt;
A conectividade do computador onde o servidor de hardware será instalado pode ser testada e verificada através da instalação de algumas ferramentas como o 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;
O programa ''nmap'' é utilizado para testar o acesso às portas para elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Espera-se que as portas 443, 80, 8080, 22, e [9000..9010] estja abertas. elabmc deveria ter sido acrescentado às portas UDP para &amp;quot;streaming&amp;quot; (ver última secção).&lt;br /&gt;
&lt;br /&gt;
Sugerimos a utilização do utilitário cron caso seja necessário reiniciar. Para evitar pedidos de registo simultâneos, é estabelecido um atraso de 5 minutos de acordo com a ordem da experiência. ''Nano'' é o editor eleito.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e a seguinte linha é acrescentada para reiniciar a cada 4h e 35m da manhã (posição 7 na tabela)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lista as tarefas a serem executadas num determinado momento.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4310</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4310"/>
		<updated>2021-08-25T13:28:48Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Network tools and utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 | 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 and utilities ===&lt;br /&gt;
The connectivity 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 test the port access to elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which has admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4309</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4309"/>
		<updated>2021-08-25T13:27:40Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Install a OpenVPN certificate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 | 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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which has admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4308</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4308"/>
		<updated>2021-08-25T13:27:38Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Instalar um certificado OpenVPN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, reinicie o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4307</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4307"/>
		<updated>2021-08-25T13:27:11Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Install a OpenVPN certificate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Instalar um certificado OpenVPN ===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, *reinicie* o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4306</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4306"/>
		<updated>2021-08-25T13:26:55Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Install a OpenVPN certificate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
Se o seu certificado se tornar inválido para permitir que o seu sistema entre no OpenVPN do elab, pode recuperar um recente, emitindo o seguinte comando:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Aqui deve utilizar a palavra-passe do sistema remoto ''elab1''&lt;br /&gt;
&lt;br /&gt;
Depois, deve movê-lo para o diretório OpenVPN que, que tem privilégios de administrador:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Introduza a palavra-passe do utilizador ''wpa local''&lt;br /&gt;
&lt;br /&gt;
Para concluir, *reinicie* o sistema para ter efeito.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4305</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4305"/>
		<updated>2021-08-25T13:19:39Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuring the Ethernet Adapter on MacOS Catalina/Mojave/High Sierra and connecting to the RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 | 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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4304</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4304"/>
		<updated>2021-08-25T13:18:22Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo do RPi| Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4303</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4303"/>
		<updated>2021-08-25T13:18:07Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo RPi| Configuração do Sistema Operativo RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo do RPi | Configuração do Sistema Operativo do RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4302</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4302"/>
		<updated>2021-08-25T13:17:47Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Sistema Operativo RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo RPi| Configuração do Sistema Operativo RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo do RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4301</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4301"/>
		<updated>2021-08-25T13:17:33Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuring the Ethernet Adapter on Windows 10/8.1/7 and connecting to the RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 | 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 now 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 | 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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4300</id>
		<title>Precision Pendulum Assembly: Software management</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Precision_Pendulum_Assembly:_Software_management&amp;diff=4300"/>
		<updated>2021-08-25T13:17:03Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuring the Ethernet Adapter on Linux using Network Manager and connecting to the RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains the instruction set and most software utilities used in the remote experiment controller and the way it is connected to the internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Raspberry software=&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 of your Ethernet adapter so you can rollback any changes made, by either taking screenshots of the appropriate dialogs or taking notes. ''' 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 through 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 now 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 | 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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&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 elab 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 Hardware Server 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;
A [[list of TCP ports | List of TCP ports]] is deemed necessary to be open for the correct internet connection between the apparatus' computer and the central server.  &lt;br /&gt;
&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 can 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;
=dsPIC firmware=&lt;br /&gt;
&lt;br /&gt;
==Program dsPIC with Raspberry Pi==&lt;br /&gt;
With the help of a programmer software, the dspic can be programmed using the Raspberry Pi. See this [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use page] for instructions.&lt;br /&gt;
&lt;br /&gt;
==Download firmware file==&lt;br /&gt;
&lt;br /&gt;
The official firmware releases available for download are presented below.&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Electrical interfaces | Previous Page (Electrical interfaces)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Precision Pendulum Assembly: Calibration| Next Page (Calibration)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*[[Montagem do Pêndulo de Precisão: Gestão de software | Portuguese Version (Versão em português)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Spanish Version (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
	<entry>
		<id>https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4299</id>
		<title>Montagem do Pêndulo de Precisão: Gestão de software</title>
		<link rel="alternate" type="text/html" href="https://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=Montagem_do_P%C3%AAndulo_de_Precis%C3%A3o:_Gest%C3%A3o_de_software&amp;diff=4299"/>
		<updated>2021-08-25T13:15:38Z</updated>

		<summary type="html">&lt;p&gt;Ist428984: /* Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EM CONSTRUÇÃO&lt;br /&gt;
&lt;br /&gt;
Nesta página pode encontrar-se o ‘set’ de instruções e a maioria dos utilitários de software utilizados no controlador remoto da experiência, bem como a forma como este está ligado à Internet.&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
=Software Raspberry=&lt;br /&gt;
== Gestão do Software ==&lt;br /&gt;
O computador Raspberry Pi faz a interface entre o microcontrolador da experiência e os servidores do e-lab. Sem ele, o acesso remoto não é possível. Assim, é essencial que este seja devidamente instalado e configurado para garantir uma elevada fiabilidade e segurança.&lt;br /&gt;
&lt;br /&gt;
=== Instalação do Sistema Operativo ===&lt;br /&gt;
Ao iniciar com um cartão SD vazio, a primeira tarefa é instalar o Sistema Operativo (SO). Existem vários sistemas operativos que suportam o Raspberry Pi (RPi) e, em teoria, qualquer um dos que suportam o software necessário pode ser utilizado. Ainda assim, o uso do Raspbian é ''' ''altamente '' ''' recomendado. É o SO oficial da Fundação Raspberry Pi para todos os modelos RPi, tem uma vasta seleção de software suportado disponível nos repositórios oficiais e abundam tutoriais e guias, online e em outros meios.&lt;br /&gt;
&lt;br /&gt;
'''''As instruções abaixo deste ponto assumem a utilização do Raspbian. Outros SOs podem ter diferentes métodos de configuração.'''''&lt;br /&gt;
&lt;br /&gt;
Ao criar um novo cartão SD, deve ser instalada a última versão do sistema operativo. Isto assegura que o sistema vai funcionar com todas as correções de segurança e desempenho disponíveis. A última versão do Raspbian pode ser descarregada a partir deste [https://www.raspberrypi.org/downloads/raspbian/ deste link]. Estão disponíveis três versões:&lt;br /&gt;
* A ''versão lite'' contém a quantidade mínima de software necessária para arrancar o RPi. Nenhum software extra está incluído. Isto implica a falta de uma Interface Gráfica do Utilizador (IGU), o que significa que, se ligado a um ecrã, o RPi mostrará apenas uma linha de comando (como ilustrado).&lt;br /&gt;
* A ''versão desktop'' contém o mesmo software que a versão lite mais o software necessário para utilizar uma IGU. Quando ligado a um ecrã, o RPi mostrará uma IGU (na imagem).&lt;br /&gt;
* A ''versão desktop e de software recomendado'' contém o mesmo software que a versão desktop mais alguns softwares e utilitários pré-selecionados.&lt;br /&gt;
&lt;br /&gt;
O mesmo software está disponível para instalação em todas as versões, o que significa que se pode começar com uma ''versão lite'' e mais tarde instalar todo o software incluído na ''versão desktop e de software recomendado''. '''Se o RPi estiver a ser preparado para funcionar apenas como servidor para a experiência, recomenda-se que seja escolhida a versão ''lite'' ou ''desktop'', uma vez que ter um SO que possua apenas o software necessário é mais seguro e melhora o desempenho e a capacidade de manutenção. Em particular, a versão ''lite'' é de especial interesse se o objetivo for utilizar o RPi sem display, visto que não inclui a IGU, que só é útil se utilizar um display.'''&lt;br /&gt;
&lt;br /&gt;
A Fundação Raspberry Pi fornece instruções de instalação para o SO Raspbian [https://www.raspberrypi.org/documentation/installation/installing-images/README.md aqui].&lt;br /&gt;
&lt;br /&gt;
=== Depois da Instalação ===&lt;br /&gt;
Depois de instalado o SO, o cartão SD está pronto para arrancar o RPi. No entanto, antes de inserir o cartão SD no RPi, é necessário considerar como fazer a interface com o RPi. É possível fazê-lo através de dois métodos diferentes:&lt;br /&gt;
&lt;br /&gt;
==== Usar o RPi através de um teclado, rato e monitor ====&lt;br /&gt;
Ao utilizar um teclado, rato e monitor, o RPi funciona tal como qualquer outro computador. Visto que é possível interagir com o RPi através do teclado, rato e monitor, o cartão SD pode ser inserido no RPi e o processo de arranque pode ser iniciado ligando o adaptador de alimentação ao RPi. Este é um procedimento mais simples mas mais caro devido ao hardware extra necessário. '''Não ligue o RPi à Internet antes de completar a configuração do SO, tal como descrito abaixo.'''&lt;br /&gt;
Quando a configuração for bem sucedida, deverá ver um prompt a apresentar:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
ou a interface gráfica habitual do utilizador do sistema operativo, dependendo da versão do Raspbian escolhida.&lt;br /&gt;
&lt;br /&gt;
Avance para a seção [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]].&lt;br /&gt;
&lt;br /&gt;
==== Ligação ao RPi através de uma ligação SSH ====&lt;br /&gt;
Se não estiverem disponíveis um teclado, rato e monitor para utilizar e interagir com o RPi, ainda é possível interagir com este através da configuração do serviço [https://en.wikipedia.org/wiki/Secure_Shell SSH] antes de inserir o cartão SD no RPi. O serviço SSH permite ligações com um RPi através de uma interface de rede, a partir da qual os comandos podem ser enviados. Isto faz uso do teclado, rato e monitor de um segundo computador (um computador portátil ou fixo já configurado, por exemplo). Para tal, o Raspberry Pi e o computador utilizado necessitam que a sua configuração de rede seja ajustada.&lt;br /&gt;
&lt;br /&gt;
Para permitir externamente o serviço SSH no RPi:&lt;br /&gt;
*Insira o cartão SD num computador, por exemplo, o utilizado para instalar o SO no cartão.&lt;br /&gt;
*Após a instalação do SO, o cartão aparecerá nos computadores como sendo composto por duas unidades. Uma unidade mais pequena de algumas centenas de MBs e uma unidade maior de alguns GBs (dependendo do tamanho do cartão SD).&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; mais pequena, crie um ficheiro vazio chamado '''ssh'''. Isto permite o serviço SSH ''apenas'' durante o próximo arranque do RPi. Esta configuração será tornada permanente mais tarde.&lt;br /&gt;
*Na &amp;quot;drive&amp;quot; maior, edite o ficheiro &amp;quot;/etc/dhcpcd.conf&amp;quot;. No final do ficheiro, deverá haver uma secção de texto semelhante a esta:&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;
Edite o ficheiro tal como o texto mostrado acima. A linha:&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;
Define o endereço IP de recurso do Raspberry Pi quando não recebe ofertas IP através do [https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol DHCP]. Em geral, isto acontece quando não há nenhuma ligação disponível na rede ou quando foi ligado a um computador portátil ou fixo comum. Podem ser escolhidos outros IPs de ''fallback'' para além de 123.123.123.123. Este é sugerido porque é simples de memorizar.&lt;br /&gt;
*O cartão SD pode agora ser removido em segurança do computador e inserido no Raspberry Pi para arrancar.&lt;br /&gt;
&lt;br /&gt;
Em seguida, o computador que se ligará ao RPi deve ter a sua própria ligação Ethernet configurada de modo a ligar-se à mesma [https://en.wikipedia.org/wiki/Subnetwork sub-rede] que o RPi. Isto significa que, seguindo a configuração mostrada acima, o seu IP deve ser configurado para ''123.123.123.xxx'', onde o último número pode ser qualquer um de 001 a 254, e uma ''netmask'' de ''255.255.255.000''. O procedimento exato a seguir para o conseguir é altamente dependente do SO instalado no computador. É importante proceder de uma forma adequada ao sistema operativo específico. '''Se o seu computador utiliza a porta Ethernet para a ligação diária à Internet, é possível que lhe seja atribuída alguma configuração específica para tornar esta ligação possível na sua rede. Certifique-se que preserva as configurações originais da rede do seu adaptador Ethernet para que possa reverter quaisquer alterações realizadas, seja tirando capturas de ecrã dos diálogos apropriados ou tomando notas.''' Pode encontrar alguns exemplos de SOs comuns abaixo.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Windows 10/8.1/7 e ligação ao RPi =====&lt;br /&gt;
*A Microsoft fornece [https://support.microsoft.com/en-us/help/15089/windows-change-tcp-ip-settings  instruções] sobre como configurar manualmente o adaptador Ethernet.&lt;br /&gt;
*Siga o procedimento de configuração manual das definições IPv4. Quando solicitado, preencha o campo ''IP Address'' com um endereço apropriado de acordo com a configuração selecionada para o RPi. Assumindo que foi escolhida a configuração de exemplo mostrada nesta página, este campo pode ser preenchido com ''123.123.123.124'', e o campo ''Subnet prefix length''/''Subnetmask'' pode ser preenchido com ''255.255.255.0'' ou ''24''. As configurações relativas aos campos ''Gateway'' e ''DNS'' e ao IPv6 podem ser ignoradas. &lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através de Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi.&lt;br /&gt;
*O símbolo de rede no Windows deve agora mostrar a ligação Ethernet. Provavelmente afirmará que se trata de uma rede desconhecida.&lt;br /&gt;
*O Windows não instala um cliente SSH por &amp;quot;default&amp;quot;. . Para se ligar ao RPi via SSH deve ser configurado um. Embora outros possam ser utilizados, o [https://putty.org/ putty] é um software cliente SSH de código aberto e gratuito para Windows. Pode ser instalado ou utilizado como autónomo, o que significa que a instalação não é necessária. Os passos seguintes seguir-se-ão à utilização do putty. Embora a configuração geral também se aplique a outro software, as instruções específicas podem ser diferentes.&lt;br /&gt;
*Preencha o campo ''Host Name (or IP Address)'' com o IP configurado do RPi. Se a configuração sugerida estiver a ser seguida, deverá ser preenchido com ''123.123.123.123''. Nos botões de rádio abaixo, selecione ''SSH''. Se desejar guardar esta configuração para que não seja necessário recordá-la ou reescrevê-la sempre, escreva qualquer nome memorável no campo  ''Saved Sessions'' e clique em ''Save''. Assim, poderá recuperar esta configuração selecionando o nome da lista e selecionando ''Load''.&lt;br /&gt;
*Pode aparecer um aviso indicando que o anfitrião, o computador ao qual se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e se a ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Aceite o aviso, selecionando ''Yes'' e a ligação deve ser completada.&lt;br /&gt;
*Quando lhe forem pedidos o utilizador e a palavra-passe, introduza o utilizador predefinido e a palavra-passe do SO Raspian que pode ser encontrada [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui].&lt;br /&gt;
*Note que neste caso são utilizados o ''pi'' e ''123.123.123.123'' uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP ''123.123.123.123'' configurado. Depois de criar um novo utilizador, de apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode proceder à [[#Configuração do Sistema Operativo RPi| Configuração do Sistema Operativo RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adotou a configuração IP sugerida, saiba que esta fornece uma configuração funcional.&lt;br /&gt;
&lt;br /&gt;
===== Configuração do Adaptador Ethernet no Linux utilizando o Network Manager e ligação ao RPi =====&lt;br /&gt;
*O Linux não é um SO monolítico. O que é geralmente referido como Linux é um conjunto de várias distribuições, também conhecidas como &amp;quot;distros&amp;quot;, que constroem um SO na mesma base, o Linux kernel. Dependendo da &amp;quot;distro&amp;quot; utilizada, o procedimento específico a seguir será diferente. O procedimento seguinte aplica-se às distribuições que têm o Network Manager configurado para gerir a conetividade. Este é o caso da maioria das distribuições populares, tais como Ubuntu e os seus sabores, Linux Mint, Fedora, etc.&lt;br /&gt;
*Clique com o botão direito do rato sobre o ícone ''Network Manager'' e selecione  ''Edit connections''&lt;br /&gt;
*Clique no sinal ''+'' no canto inferior esquerdo da janela, selecione ''Ethernet'' no diálogo mostrado e clique em ''Create''. Ao criar uma nova configuração, as definições utilizadas para o acesso normal à Internet são preservadas, tornando mais fácil reverter as alterações.&lt;br /&gt;
*O campo ''Name'' pode ser preenchido com qualquer nome, embora seja recomendado escrever um fácil de lembrar, tal como ''Raspberry'' ou ''Ethernet RPi''.&lt;br /&gt;
*Selecione o separador ''IPv4 Settings'' e, no menu ''Method dropdown'', selecione ''Manual''.&lt;br /&gt;
*Clique em ''Add'' junto à tabela ''Adresses'' e, quando solicitado, preencha o campo ''Address'' com um endereço apropriado de acordo com a configuração escolhida para o RPi. Assumindo que a configuração de exemplo mostrada nesta página foi a escolhida, este campo pode ser preenchido com  ''123.123.123.124''e o campo vizinho ''Netmask'' pode ser preenchido ou com  ''255.255.255.0'' ou ''24''.&lt;br /&gt;
*O resto dos campos podem ser ignorados em segurança. Clique em ''Save'' para guardar as novas definições de ligação. As novas configurações surgirão agora na lista com o nome escolhido.&lt;br /&gt;
*Caso não o tenha feito antes, o RPi pode ser iniciado e ligado ao computador através da Ethernet. Isto é conseguido ligando uma extremidade de um cabo Ethernet à porta Ethernet do computador e a outra extremidade do cabo à porta Ethernet do RPi&lt;br /&gt;
*Ao tentar ligar-se o RPi, o ícone do Gestor de Rede deve mostrar um símbolo rotativo. Clique no símbolo do Gestor de Rede e selecione, no menu, a ligação Ethernet com o nome escolhido anteriormente. A ligação deve agora ser configurada.&lt;br /&gt;
*A maioria das ''distros'' Linux incluem software SSH na instalação padrão do SO, tornando desnecessária a instalação de qualquer software adicional. Os comandos SSH seguem a sintaxe ''ssh user@ip'' ou ''ssh user@hostname''. O utilizador predefinido e a palavra-passe do SO Raspian podem ser encontrados [https://www.raspberrypi.org/documentation/linux/usage/users.md aqui]. Para se ligar ao RPi, abra um terminal no computador e escreva&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ssh pi@RPI ADDRESS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
O ''RPI ADDRESS'' deve ser substituído pelo endereço IP selecionado para o RPi na secção anterior. Assumindo que foi adotada a configuração sugerida, o comando deve ser:&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 que, neste caso, são utilizados o ''pi'' e o ''123.123.123.123'', uma vez que se está a ligar ao RPi como utilizador pi e este está diretamente ligado ao computador com o IP configurado ''123.123.123.123''. Depois de criar um novo utilizador, apagar o predefinido e ligar o RPi à rede normal, '''''isto irá mudar'''''.&lt;br /&gt;
*Pode surgir um aviso afirmando que o anfitrião, o computador a que se está a ligar, é novo e desconhecido. Ser-lhe-á perguntado se o novo computador é de confiança e a se ligação pode ser completada. Uma vez que se trata de uma nova instalação de um computador que possui e que foi configurado por si, pode responder com segurança que sim. Quando lhe for pedido, introduza a palavra-chave. Se esta não for a primeira vez que segue este guia, é possível que o aviso indique que o anfitrião, o computador a que se está a ligar, mudou. Isto é esperado, uma vez que pode agora aplicar estes passos a um RPi diferente. Edite o ficheiro indicado no aviso e apague a linha que começa com o IP do RPi. Se a configuração do exemplo estiver a ser seguida, esta será a linha que começa com &lt;br /&gt;
 ''123.123.123.123''. Experimente voltar a ligar utilizando novamente o comando SSH. Deverá ver um aviso que indica que se trata de um computador novo e desconhecido.&lt;br /&gt;
*Depois de introduzir com sucesso a palavra-passe predefinida, surgirá o seguinte texto:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
pi@raspberry:~ $&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Conectou-se com sucesso e pode agora proceder à [[#Configuração do Sistema Operativo RPi | Configuração do Sistema Operativo RPi]]&lt;br /&gt;
*Se surgiu um erro que indica: &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;
onde xxx.xxx.xxx.xxx é o IP utilizado no comando ssh, os adaptadores Ethernet foram mal configurados. Revisite a configuração dos adaptadores. Para uma ligação bem sucedida, tanto o computador como o RPi devem ser configurados de modo a estarem na mesma sub-rede. Se não adoptou a configuração IP sugerida saiba que esta fornece uma configuração funcional.&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;
=== Configuração do Sistema Operativo RPi ===&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 and utilities ===&lt;br /&gt;
The connectivity 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 elab.ist.utl.pt, elab1.ist.utl.pt and elabmc.ist.utl.pt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmap -v -A elab.ist.utl.pt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ports 443, 80, 8080, 22, and [9000..9010] are expected to be open. elabmc should have added the UDP ports for streaming (see last section).&lt;br /&gt;
&lt;br /&gt;
We suggest to use the cron utility in case a regular reboot is required. To avoid simultaneous registration requests at the same time a delay of 5 minutes is added according to the experiment order. ''Nano'' is the elected editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the following line is added to reboot every 4 am plus 35 minutes (position 7 on the table)&lt;br /&gt;
 &lt;br /&gt;
 0 4   *   *   *    /sbin/shutdown -r +35&lt;br /&gt;
&lt;br /&gt;
''Contab -l'' lists the jobs to be run at a particular time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install a OpenVPN certificate===&lt;br /&gt;
If your certificate becomes invalid to allow your system to login on elab OpenVPN you can retrieve a recent one by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;get ca.crt&amp;quot; | sftp -P2222 wpa@elab1.ist.utl.pt:/dist&lt;br /&gt;
&lt;br /&gt;
Here you should use the remote system ''elab1'' password.&lt;br /&gt;
&lt;br /&gt;
Then you need to move it to the OpenVPN directory which as admin privileges:&lt;br /&gt;
&lt;br /&gt;
 sudo mv ./ca.crt /etc/openvpn/privnet&lt;br /&gt;
&lt;br /&gt;
Please enter ''the local wpa'' user password.&lt;br /&gt;
&lt;br /&gt;
Finally just *reboot* the system to take effect.&lt;br /&gt;
&lt;br /&gt;
==Códigos autónomos==&lt;br /&gt;
&lt;br /&gt;
=== Servidor de hardware ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; Agora que tem o Raspberry Pi e o Pêndulo instalados, está pronto a ligá-lo à rede do projeto World Pendulum Alliance./p&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para tal, terá de instalar e executar uma aplicação no Raspberry. Esta aplicação chama-se &amp;quot;REC Hardware Server&amp;quot;, é uma aplicação Java sendo necessário ter o JDK instalado.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Uma vez executado o &amp;quot;REC Hardware Server&amp;quot;, este tentará contactar automaticamente o seu pêndulo onde é expectável encontrar a sua  cadeia de identificação (por exemplo, &amp;quot;WP_UESC_IOS&amp;quot;). Se encontrar o ID esperado, ligar-se-á ao pêndulo e este deverá ganhar vida na página pública do elab. Caso contrário, surgirá uma mensagem de erro. Nesse caso, aconselhamo-lo a contactar a equipa de gestão do projeto.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;O &amp;quot;REC Hardware Server&amp;quot; específico para o seu pêndulo será fornecido pelos coordenadores do projeto num ficheiro .ZIP que estará disponível numa pasta específica no servidor elab1. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Para instalar uma nova versão do &amp;quot;REC Hardware Server&amp;quot; para um pêndulo específico, deverá abrir um terminal (por exemplo, Putty) e aceder ao aparelho onde o servidor de hardware será instalado - neste caso, o RPi - e seguir estes passos:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Confirme se o diretório &amp;quot;rec-deployment&amp;quot; existe. Se não, crie o directório através do comando:&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;
Liste os ficheiros .Zip do Servidor de Hardware:&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;
Uma vez identificado o servidor de hardware para o seu pêndulo, copie o ficheiro HardwareServerZip para o seu aparelho (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;
Aceda ao directório &amp;quot;rec-deployment&amp;quot;:&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;
Descompacte os ficheiros .zip do Servidor de Hardware para o diretório &amp;quot;rec-deployment&amp;quot;:&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;
Altere para o diretório da experiência:&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;
Inicie o Servidor de Hardware::&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;
''NOTA''&lt;br /&gt;
&lt;br /&gt;
O Servidor de Hardware só deve ser instalado após o procedimento de calibração descrito na página seguinte estar completo e executado com o minicom ou outro programa terminal.&lt;br /&gt;
&lt;br /&gt;
=== Transmissão de Vídeo ===&lt;br /&gt;
A transmissão de vídeo pode ser feita utilizando a [https://projects.raspberrypi.org/en/projects/getting-started-with-picamera picamera], a câmara do RPi, ou uma câmara USB comum. Os passos seguintes foram testados com uma câmara USB. Além disso, foram concebidos para trabalhar com um servidor de transmissão de vídeo que recebe o vídeo do RPi e o reenvia a todos os clientes ligados.&lt;br /&gt;
&lt;br /&gt;
*Inicie a transmissão no RPi com o comando:&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;
Embora seja quase certo que esteja em ''/dev/video0'', é possível que a câmara não apareça no sistema RPi em ''/dev/video0''. Verifique se aparece, com o seguinte comando: &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;
Como resultado, a entrada do formato ''videoX'', onde ''X'' é um número, é a localização da câmara no sistema. Edite o comando acima para que o número ''X'' seja o mesmo que o que consta no resultado do último comando.&lt;br /&gt;
&lt;br /&gt;
É possível aumentar a resolução do vídeo e a ''framerate'' alterando os campos ''width'' (largura), ''height'' (altura) e ''framerate'' no comando do exemplo acima. Os valores desse exemplo são muito conservadores mas asseguram que o fluxo de vídeo é possível, mesmo nas condições de rede mais difíceis, por gerar um fluxo de bitrate muito baixo. Note que qualquer largura, altura e ''framerate'' solicitadas precisam de ser suportadas pela câmara de vídeo, caso contrário, surgirá um erro. Edite os campos ''HOST'' e ''PORT'' para que apontem para o seu servidor de transmissão de vídeo.&lt;br /&gt;
&lt;br /&gt;
Uma vez verificado que o vídeo está a ser transmitido, este pode ser tornado permanente, alterando ligeiramente o comando para:&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;
Isto funcionará até que o RPi ou a câmara sejam desligados.&lt;br /&gt;
&lt;br /&gt;
=== Instruções específicas para o projeto World Pendulum Alliance ===&lt;br /&gt;
É necessária uma [[list of TCP ports | lista de portas TCP]] para a correta ligação à Internet entre o computador do aparelho e o servidor central. &lt;br /&gt;
&lt;br /&gt;
Para os pêndulos parceiros principais, o parâmetro ''HOST'' do comando de transmissão deve ser definido como instruído nas sessões de formação. O ''PORT'' deve ser definido como indicado na  [[List of UDP ports for streaming| página de listagem de portas.]]&lt;br /&gt;
Para cada pêndulo secundário, pode ser seguido o mesmo processo. No entanto, os parceiros devem criar uma infraestrutura de transmissão independente para a transmissão de vídeo dos pêndulos secundários.&lt;br /&gt;
&lt;br /&gt;
A fim de disponibilizar a informação necessária para que os utilizadores possam ligar-se à transmissão, os [https://en.wikipedia.org/wiki/Session_Description_Protocol| ficheiros SDP] devem ser partilhados. Assim, estes podem ser independentemente abertos num software de leitor de vídeo, como o [https://www.videolan.org/vlc/| VLC], ou vistos através do ''pendulum client software''. &lt;br /&gt;
O ficheiro pode ser criado através da adaptação do modelo abaixo, substituindo os campos ''EXPERIMENT NAME'' e ''PORT'' pelos campos apropriados, conforme mostrado na [[List of UDP ports for streaming| página de listagem de portas]]. O campo ''HOST'' deve ser definido com o valor descrito nas sessões de formação.&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;
O ficheiro SDP deve ser criado com o mesmo nome que o indicado na [[List of UDP ports for streaming| página de listagem de portas]]. Este ficheiro deve então ser transferido para o servidor responsável pela sua disponibilização na ''web'', conforme instruído nas sessões de formação.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=== Iniciar automaticamente no arranque do RPi ===&lt;br /&gt;
&lt;br /&gt;
Para que os programas iniciem automaticamente no arranque do RPi, edite o ficheiro ''/etc/rc.local'' executando:&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;
Assumindo que o servidor de hardware foi colocado na pasta indicada na seção anterior, ao adicionar as seguintes linhas ao ficheiro, antes de ''exit 0'' e depois de ''fi'', fará com que o RPi inicie automaticamente o servidor de hardware e a transmissão de vídeo enquanto arranca.&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 que os campos HOST e [[List of UDP ports for streaming| PORT]] devem ser substituídos como exemplificado acima. O campo USER deve ser alterado para corresponder à conta de utilizador criada, tipicamente ''wpa'' como previamente instruído.&lt;br /&gt;
No caso de não estar a ser utilizado o ttyS0, se necessário, pode recorrer-se a um ''linker'' simbólico:&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;
=Firmware dsPIC=&lt;br /&gt;
&lt;br /&gt;
==Programar o dsPIC com o Raspberry Pi==&lt;br /&gt;
O dsPIC pode ser programado utilizando o Raspberry Pi, com a ajuda de um software programador. Ver [http://www.elab.tecnico.ulisboa.pt/wiki/index.php?title=DsPic-Raspberry_programmer_interface#Software_use esta página] para instruções.&lt;br /&gt;
&lt;br /&gt;
==Descarregar o ficheiro de firmware==&lt;br /&gt;
&lt;br /&gt;
As versões oficiais de firmware disponíveis para download são apresentadas abaixo:&lt;br /&gt;
&lt;br /&gt;
Version 2021_01_96_22_08_46: [[File:Wp 2021 01 06 22 08 46.zip]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Página Anterior (Interfaces elétricas)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
[[Montagem do Pêndulo de Precisão: Calibração| Página Seguinte (Calibração)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Ligações==&lt;br /&gt;
&lt;br /&gt;
*[[Precision Pendulum Assembly: Software management | Versão em inglês (English version)]]&lt;br /&gt;
*[[Conjunto de péndulo de precisión: Gestión de software | Versão espanhol (Versión en español)]]&lt;/div&gt;</summary>
		<author><name>Ist428984</name></author>
		
	</entry>
</feed>