Firmware/Remote: Difference between revisions

From OLPC
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Firmware Remote Diagnosis =
= Firmware Remote Diagnosis =


How to allow an expert to help you with a firmware problem.
== Using telnetd ==


Open Firmware contains many tools that can be assembled for this purpose, but the most suitable tool depends on the network you are using.
*on the target firmware system, start the telnet server:

ok telnetd
You must have Open Firmware versions Q7B18, Q4D28, Q3C12, Q2F16 or later.

= Using telnetd =
[[Image:Ofw-telnet-external.png|right|0px]]
On the target system:
*start the telnet server:
telnetd
*note the IP address shown,
*note the IP address shown,
*wait for connection to arrive.
*on the host system, start the telnet client and connect to the IP address,
On the host system:
ok telnet IP
*start the telnet client and connect to the IP address,
telnet IP


Once connected, the host keyboard and display will be using the command interpreter of the target.
This is ineffective if the target system is behind a NAT router with respect to the host.


To disconnect, type <code>exit-telnet</code> in the target command interpreter, or use <code>^]</code> to exit the telnet client.
== Using rdc via a relay ==


This method is ineffective if the target system is behind a NAT router with respect to the host, since the IP address is not routable.
The instructions are for the remote support agent:


= Using rdc via a relay =
*set up a TCP relay on ports 8024 and 8023 of a host that is accessible to the user over the internet:
[[Image:Ofw-rdc-relay.png|right|0px]]
Scenario: need to connect to a user laptop that is behind a NAT router. You are at the host. In the diagram, black lines are data flow, and the red lines show the direction of network connection.

On a relay server that is accessible to the user over the internet:
*set up a TCP relay that listens on ports 8024 and 8023:
% socat \
% socat \
TCP-LISTEN:8024,fork,reuseaddr,nodelay,bind=127.0.0.1 \
TCP-LISTEN:8024,fork,reuseaddr,nodelay,bind=127.0.0.1 \
TCP-LISTEN:8023,reuseaddr,nodelay
TCP-LISTEN:8023,reuseaddr,nodelay
On the host system:
*start your telnet client and connect to port 8024:
*start a telnet client and connect to port 8024 on the relay server:
telnet IP 8024
:(or, on a Linux client, type:
% telnet -- 127.0.0.1 -8024
% telnet -- 127.0.0.1 -8024
:(the odd arguments are to force automatic initiation of TELNET options which would otherwise be omitted due to the non-standard port number).
:the odd arguments are to force automatic initiation of TELNET options which would otherwise be omitted due to the non-standard port number).
*ask the user to type <code>rdc IP</code> on the remote system, where IP is the IP address of the host running socat:
On the target system, ask the user to start <code>rdc</code>:
ok rdc IP
rdc IP
:where IP is the IP address of the relay server.
*use the remote system via the connection. When done, type <code>exit-rdc</code> or just close the connection.

Once connected, the host keyboard and display will be using the command interpreter of the target.

To disconnect, type <code>exit-rdc</code> in the target command interpreter, or use <code>^]</code> to exit the telnet program on the host.


The port number can be changed by mutual agreement. The default is 8023. For instance, to use port 9023 you must (a) change the ''socat'' command from 8023 to 9023, and (b) add 9023 to the end of the <code>rdc</code> command:
The port number can be changed by mutual agreement. The default is 8023. For instance, to use port 9023 you must (a) change the ''socat'' command from 8023 to 9023, and (b) add 9023 to the end of the <code>rdc</code> command:
ok rdc IP 9023
rdc IP 9023


== Using rdc on a local network ==
= Using rdc on a local area network =
[[Image:Ofw-rdc-local.png|right|0px]]
On the host system:
*start <code>rdcd</code> to listen for connections, and note the IP address shown,
rdcd
On the target system:
*type <code>rdc IP</code>,
rdc IP


Once connected, the host keyboard and display will be using the command interpreter of the target.
*on the host firmware system, start <code>rdcd</code> to listen for connections, and note the IP address shown,
ok rdcd
*on the target firmware system, type <code>rdc IP</code>,
ok rdc IP
*use the remote system via the connection. When done, type <code>exit-rdc</code> or close the connection with ctrl-].


To disconnect, type <code>exit-rdc</code> in the target command interpreter, or use <code>^]</code> to exit the rdcd program on the host.
== Combining with serial terminal ==


Use of rdc, rdcd, telnet and telnetd are ineffective if the problem being diagnosed is networking. In that case, the target firmware system must be accessed via serial.
This method is ineffective if the host system is behind a NAT router with respect to the target, since the IP address is not routable.

= Combining with serial terminal =
[[Image:Ofw-net2ser.png|right|0px]]
Use of <code>rdc</code>, <code>rdcd</code>, <code>telnet</code> and <code>telnetd</code> on the target should be avoided if the problem being diagnosed is networking. In that case, the target firmware system must be accessed via serial.


Therefore, use another system as a relay, and start the <code>serial</code> program.
Therefore, use another system as a relay, and start the <code>serial</code> program.


The diagram on the right shows the relay connected to the target by back to back serial port. The setup sequence is:
= Internals =
* start <code>telnetd</code> on the relay,
* start <code>telnet</code> on the host,
* start <code>serial</code> on the relay,
* connect or power up the target.

Start the <code>serial</code> program before making the electrical connection or powering the target, so as to avoid a data loop.

The disconnection sequence is:
* power down or disconnect the target,
* exit <code>serial</code> using <code>^a^k</code>,
* exit <code>telnet</code> using <code>^]</code>.

= How it works =
The command interpreter [[Ok]] normally relies on keyboard input, and sends output to the display:

[[Image:Ofw-bare.png|0px]]

But it also uses an internal [[Serial_adapters|serial port]], behind two multiplexers. Input can come from the keyboard or serial port. Output is delivered to both the display and the serial port.

[[Image:Ofw-mux.png|0px]]

These multiplexers are used by <code>telnetd</code> and <code>rdc</code> as well.

In this next diagram, the use of <code>telnet</code> and <code>telnetd</code> can be seen in more detail. On the host, the keyboard and serial receive data are captured by the input multiplexer and given to the <code>telnet</code> client. The data is then forwarded over the network to the <code>telnetd</code> server on the target. The data is then injected into the input multiplexer of the target, and then reaches the command interpreter.

[[Image:Ofw-telnet-internal.png|0px]]

= Faster Output =

When Open Firmware is sending output to the display, the serial port, and the network connection, it is the display that constrains how fast the data is sent.

To avoid the display, prefix the lengthy command with {{code|omit}}, like this
omit words

= Glossary =


* telnet - a plain telnet client,
* telnet - a plain telnet client,
Line 49: Line 112:
* rdc - a telnetd that makes rather than accepting a connection.
* rdc - a telnetd that makes rather than accepting a connection.
* rdcd - a telnet that accepts rather than making a connection.
* rdcd - a telnet that accepts rather than making a connection.

= See Also =
* [[Tiny_Core_Linux#Remote_Diagnosis|Remote Diagnosis using Tiny Core Linux]] bootable USB drive, to set up an inbound SSH connection to an XO laptop.

Latest revision as of 06:59, 14 February 2014

Firmware Remote Diagnosis

How to allow an expert to help you with a firmware problem.

Open Firmware contains many tools that can be assembled for this purpose, but the most suitable tool depends on the network you are using.

You must have Open Firmware versions Q7B18, Q4D28, Q3C12, Q2F16 or later.

Using telnetd

0px

On the target system:

  • start the telnet server:
telnetd
  • note the IP address shown,
  • wait for connection to arrive.

On the host system:

  • start the telnet client and connect to the IP address,
telnet IP

Once connected, the host keyboard and display will be using the command interpreter of the target.

To disconnect, type exit-telnet in the target command interpreter, or use ^] to exit the telnet client.

This method is ineffective if the target system is behind a NAT router with respect to the host, since the IP address is not routable.

Using rdc via a relay

0px

Scenario: need to connect to a user laptop that is behind a NAT router. You are at the host. In the diagram, black lines are data flow, and the red lines show the direction of network connection.

On a relay server that is accessible to the user over the internet:

  • set up a TCP relay that listens on ports 8024 and 8023:
% socat \
  TCP-LISTEN:8024,fork,reuseaddr,nodelay,bind=127.0.0.1 \
  TCP-LISTEN:8023,reuseaddr,nodelay

On the host system:

  • start a telnet client and connect to port 8024 on the relay server:
telnet IP 8024
(or, on a Linux client, type:
% telnet -- 127.0.0.1 -8024
the odd arguments are to force automatic initiation of TELNET options which would otherwise be omitted due to the non-standard port number).

On the target system, ask the user to start rdc:

rdc IP
where IP is the IP address of the relay server.

Once connected, the host keyboard and display will be using the command interpreter of the target.

To disconnect, type exit-rdc in the target command interpreter, or use ^] to exit the telnet program on the host.

The port number can be changed by mutual agreement. The default is 8023. For instance, to use port 9023 you must (a) change the socat command from 8023 to 9023, and (b) add 9023 to the end of the rdc command:

rdc IP 9023

Using rdc on a local area network

0px

On the host system:

  • start rdcd to listen for connections, and note the IP address shown,
rdcd

On the target system:

  • type rdc IP,
rdc IP

Once connected, the host keyboard and display will be using the command interpreter of the target.

To disconnect, type exit-rdc in the target command interpreter, or use ^] to exit the rdcd program on the host.

This method is ineffective if the host system is behind a NAT router with respect to the target, since the IP address is not routable.

Combining with serial terminal

0px

Use of rdc, rdcd, telnet and telnetd on the target should be avoided if the problem being diagnosed is networking. In that case, the target firmware system must be accessed via serial.

Therefore, use another system as a relay, and start the serial program.

The diagram on the right shows the relay connected to the target by back to back serial port. The setup sequence is:

  • start telnetd on the relay,
  • start telnet on the host,
  • start serial on the relay,
  • connect or power up the target.

Start the serial program before making the electrical connection or powering the target, so as to avoid a data loop.

The disconnection sequence is:

  • power down or disconnect the target,
  • exit serial using ^a^k,
  • exit telnet using ^].

How it works

The command interpreter Ok normally relies on keyboard input, and sends output to the display:

0px

But it also uses an internal serial port, behind two multiplexers. Input can come from the keyboard or serial port. Output is delivered to both the display and the serial port.

0px

These multiplexers are used by telnetd and rdc as well.

In this next diagram, the use of telnet and telnetd can be seen in more detail. On the host, the keyboard and serial receive data are captured by the input multiplexer and given to the telnet client. The data is then forwarded over the network to the telnetd server on the target. The data is then injected into the input multiplexer of the target, and then reaches the command interpreter.

0px

Faster Output

When Open Firmware is sending output to the display, the serial port, and the network connection, it is the display that constrains how fast the data is sent.

To avoid the display, prefix the lengthy command with omit, like this

omit words

Glossary

  • telnet - a plain telnet client,
  • telnetd - a telnet server that binds the console to the accepted connection,
  • rdc - a telnetd that makes rather than accepting a connection.
  • rdcd - a telnet that accepts rather than making a connection.

See Also