<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>https://www.binefa.com/index.php?action=history&amp;feed=atom&amp;title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu</id>
	<title>Accés remot a dispositius sense sistema operatiu - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="https://www.binefa.com/index.php?action=history&amp;feed=atom&amp;title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu"/>
	<link rel="alternate" type="text/html" href="https://www.binefa.com/index.php?title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu&amp;action=history"/>
	<updated>2026-04-06T09:46:41Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.binefa.com/index.php?title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu&amp;diff=4413&amp;oldid=prev</id>
		<title>Jordi Binefa a 14:14, 15 març 2022</title>
		<link rel="alternate" type="text/html" href="https://www.binefa.com/index.php?title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu&amp;diff=4413&amp;oldid=prev"/>
		<updated>2022-03-15T14:14:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisió del 14:14, 15 març 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Línia 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a tenir visibilitat externa de la pàgina web servida per la placa IoT-02 (per exemple amb la IP 192.168.1.151:80), ho redireccionarem a un port ( 192.168.1.151:80 --&amp;gt; localhost:5001 )&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a tenir visibilitat externa de la pàgina web servida per la placa IoT-02 (per exemple amb la IP 192.168.1.151:80), ho redireccionarem a un port ( 192.168.1.151:80 --&amp;gt; localhost:5001 )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a fer funcionar [https://binefa.cat/training/iot02/ota/edge/simple-port-forwarding.js simple-port-forwarding.js] caldrà haver afegit el paquet '''http-proxy''':&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a fer funcionar [https://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;www.&lt;/ins&gt;binefa.cat/training/iot02/ota/edge/simple-port-forwarding.js simple-port-forwarding.js] caldrà haver afegit el paquet '''http-proxy''':&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  npm install http-proxy&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  npm install http-proxy&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot; &gt;Línia 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  httpProxy.createProxyServer({target:'http://' + targetHost + ':' + portOrigen}).listen(portDesti);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  httpProxy.createProxyServer({target:'http://' + targetHost + ':' + portOrigen}).listen(portDesti);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a fer aquest redireccionador sigui un servei, es copia [https://binefa.cat/training/iot02/ota/edge/myForwardingService.service myForwardingService.service] a la carpeta '''/etc/systemd/system''' o el fem de nou amb un editor:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Per a fer aquest redireccionador sigui un servei, es copia [https://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;www.&lt;/ins&gt;binefa.cat/training/iot02/ota/edge/myForwardingService.service myForwardingService.service] a la carpeta '''/etc/systemd/system''' o el fem de nou amb un editor:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  cd /etc/systemd/system&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  cd /etc/systemd/system&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_binefa_com:diff::1.12:old-4411:rev-4413 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jordi Binefa</name></author>
		
	</entry>
	<entry>
		<id>https://www.binefa.com/index.php?title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu&amp;diff=4411&amp;oldid=prev</id>
		<title>Jordi Binefa: Es crea la pàgina amb «== Programació remota (OTA) ==  Programacio OTA de la placa IoT-02  === Dos programes de prova de programació remota === [https://www.b...».</title>
		<link rel="alternate" type="text/html" href="https://www.binefa.com/index.php?title=Acc%C3%A9s_remot_a_dispositius_sense_sistema_operatiu&amp;diff=4411&amp;oldid=prev"/>
		<updated>2022-03-15T14:12:57Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «== Programació remota (OTA) ==  &lt;a href=&quot;/index.php/Fitxer:Esp32Ota.png&quot; title=&quot;Fitxer:Esp32Ota.png&quot;&gt;center|Programacio OTA de la placa IoT-02&lt;/a&gt;  === Dos programes de prova de programació remota === [https://www.b...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Programació remota (OTA) ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Esp32Ota.png|center|Programacio OTA de la placa IoT-02]]&lt;br /&gt;
&lt;br /&gt;
=== Dos programes de prova de programació remota ===&lt;br /&gt;
[https://www.binefa.cat/training/iot02/ota/IoT-02_OTAWebUpdater_01.zip IoT-02_OTAWebUpdater_01] (Fa pampallugues el led blanc) Per a que us funcioni, haureu d'actualitzar el codi amb el vostre nom de xarxa sense fils (SSID) i la vostra contrasenya d'accés.&lt;br /&gt;
&lt;br /&gt;
[https://www.binefa.cat/training/iot02/ota/IoT-02_OTAWebUpdater_02.zip IoT-02_OTAWebUpdater_02] (Fa pampallugues el led verd) Per a que us funcioni, haureu d'actualitzar el codi amb el vostre nom de xarxa sense fils (SSID) i la vostra contrasenya d'accés.&lt;br /&gt;
&lt;br /&gt;
=== Programació a la vora (''edge'') ===&lt;br /&gt;
L'ordinador a la vora (''edge'') pot ser un ordinador normal, habitualment de poca potència, del tipus Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
Per a tenir visibilitat externa de la pàgina web servida per la placa IoT-02 (per exemple amb la IP 192.168.1.151:80), ho redireccionarem a un port ( 192.168.1.151:80 --&amp;gt; localhost:5001 )&lt;br /&gt;
&lt;br /&gt;
Per a fer funcionar [https://binefa.cat/training/iot02/ota/edge/simple-port-forwarding.js simple-port-forwarding.js] caldrà haver afegit el paquet '''http-proxy''':&lt;br /&gt;
&lt;br /&gt;
 npm install http-proxy&lt;br /&gt;
&lt;br /&gt;
El codi nodejs de redireccionament (suposant que la placa IoT-02 ha adquirit l'adreça IP 192.168.1.151):&lt;br /&gt;
 var httpProxy = require('http-proxy');&lt;br /&gt;
 var targetHost = '192.168.1.151';&lt;br /&gt;
 var portOrigen = 80;&lt;br /&gt;
 var portDesti = 5001;&lt;br /&gt;
 httpProxy.createProxyServer({target:'http://' + targetHost + ':' + portOrigen}).listen(portDesti);&lt;br /&gt;
&lt;br /&gt;
Per a fer aquest redireccionador sigui un servei, es copia [https://binefa.cat/training/iot02/ota/edge/myForwardingService.service myForwardingService.service] a la carpeta '''/etc/systemd/system''' o el fem de nou amb un editor:&lt;br /&gt;
&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
 sudo nano [https://binefa.cat/training/iot02/ota/edge/myForwardingService.service myForwardingService.service]&lt;br /&gt;
 sudo chmod 755 myForwardingService.service&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
 sudo systemctl '''start''' myForwardingService&lt;br /&gt;
&lt;br /&gt;
Per a veure l'estat del servei:&lt;br /&gt;
 systemctl '''status''' myForwardingService&lt;br /&gt;
&lt;br /&gt;
I per a fer que el servei es posi en marxa al reiniciar l'ordinador a la vora:&lt;br /&gt;
 sudo systemctl '''enable''' myForwardingService&lt;br /&gt;
&lt;br /&gt;
=== Programació al núvol ===&lt;br /&gt;
Mitjançant una xarxa virtual privada (VPN) de l'estil [https://www.zerotier.com/ ZeroTier] podem fer que l'ordinador a la vora i l'ordinador al núvol comparteixin la mateixa xarxa.&lt;br /&gt;
&lt;br /&gt;
Suposant que l'ordinador a la vora té la IP 10.242.156.158, podem redireccionar-hi 10.242.156.158:5001 --&amp;gt; localhost:7007 :&lt;br /&gt;
&lt;br /&gt;
 var httpProxy = require('http-proxy');&lt;br /&gt;
 var targetHost = '10.242.156.158';&lt;br /&gt;
 var portOrigen = 5001;&lt;br /&gt;
 var portDesti = 7007;&lt;br /&gt;
 httpProxy.createProxyServer({target:'http://' + targetHost + ':' + portOrigen}).listen(portDesti);&lt;br /&gt;
&lt;br /&gt;
I així tenim accés remot des del núvol, connectant mitjançant l'ordinador a la vora que es connecta a la placa IoT-02. &lt;br /&gt;
&lt;br /&gt;
Per accedir-hi des del navegador, escriviu a la URL: &lt;br /&gt;
 &amp;lt;nom_de_domini&amp;gt;:7007&lt;br /&gt;
Això visualitzarà el que presenta l'ordinador a la vora (la IP és la VPN a l'ordinador a la vora):&lt;br /&gt;
 10.242.156.158:5001&lt;br /&gt;
Que al seu temps presenta el servei pel port 80 de la placa IOT-02 connectada a la mateixa xarxa local que l'ordinador a la vora:&lt;br /&gt;
 192.168.1.151&lt;br /&gt;
&lt;br /&gt;
=== Els tres mètodes de programació OTA de l'ESP32 ===&lt;br /&gt;
[https://www.programmersought.com/article/90864120754/ How to implement OTA online update of ESP32 firmware]&lt;/div&gt;</summary>
		<author><name>Jordi Binefa</name></author>
		
	</entry>
</feed>